All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
3 views

How to request tokens from msg.sender within contract function

transferring ethereum from the user of your smart contract is simple enough, you simply use msg.value and can use this within your contract's functions. But doing the same thing with tokens is a bit ...
0
votes
0answers
6 views

Why am I getting an out of gas error on transactions that should instead revert due to a require statement?

I've thoroughly tested a contract using Ganache, and when calling a method with a value that would trigger one of its require statements, it reverted as expected and returned the error message I ...
1
vote
0answers
6 views

Using AWS CloudHSM to sign transactions

Does somebody knows how to properly use AWS CloudHSM to sign ethereum transactions (Keccak256)?
0
votes
0answers
7 views

How to get transaction status (programatically, not etherscan)?

I have a problem when I interact with an Smart Contract, from a javascript webapp. I can execute the transaction correctly when the status is confirmed, but I cannot get any error response when it ...
0
votes
1answer
12 views

ERC721TokenReceiver, assuming that transfer function exists?

When trying to find out if a contract implemented onERC721Received from safeTransferFrom function, are we just safely assuming the contract has all the erc721 related functionalities? such as transfer,...
0
votes
1answer
16 views

create contract from function / contract

**Hey guys ! I just try to make a contract for create a contract. It supposed to be ERC-20 interface so my first contract for this. But I don’t know how can I do _mint and createContract functions ...
0
votes
0answers
9 views

Web3.js doesn't fire event callbacks anymore

I have a small dapp that uses web3.js to interact with a contract. I have one event listener: let activateEvent = nexusContract.events.Activate({ _member: defaultAccount }) activateEvent.watch((...
0
votes
1answer
12 views

Deposit event is not call while contract get token

My contract pragma solidity ^0.5.0; contract Transfereventaction { event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); function deposit(...
0
votes
0answers
13 views

Can I use a truffle-contract instance in the data field of web3.eth.signTransaction?

I use truffle-contract for contract abstraction. const myContract = TruffleContract(MyContractArtifact); myContract.setProvider(web3.currentProvider); I'm using Infura as the web3 provider so need ...
1
vote
1answer
15 views

Request to http://localhost:8545 from https website

I am building a website that should interact (from the browser, not back-end) with custom Ethereum nodes, including local, something like MyEtherWallet. I can connect to ganache http://localhost:8545 ...
0
votes
0answers
8 views

What are the risques to considered of PoA in production mod [Geth]?

We are using poa clique with period = 0, and we will pass to production soon, so what are the risques to considered in prod mod ? is there a best practices checklist?
0
votes
1answer
14 views

Illegal transactions can also be mined on geth

I used web3 to call the contract method (I initialized web3 with metamask, then metamask listens for the geth node). I used to deploy the contract to ganache. When I used the illegal parameter to ...
0
votes
0answers
6 views

console.log(App.ticTacToeInstance.events); in createNewgame function getting undefined

import Web3 from "web3"; import { default as contract } from 'truffle-contract' import ticTacToeArtifact from "../../build/contracts/TicTacToe.json"; import $ from "jquery"; let TicTacToe = ...
-2
votes
1answer
20 views

Call my smart contract method which should be reverted ,but the transaction is still be send and mined

When i interact with my contract by web3,metamask and ganache-cli everything's going well .eg i called the contract method with inccorect parameters ,then the error was throwed. But when i deploy my ...
0
votes
1answer
20 views

Why txHash in sendSignedTransaction giving Undefined value on sending on rinkeby testnet

let Tx= require('ethereumjs-tx').Transaction; const Web3= require('web3'); const url='https://rinkeby.infura.io/v3/d4dbc79ea192404fb42689cc55ce2fc0'; const web3 =new Web3(url); const account1= '...
0
votes
1answer
17 views

How will I determine the number of nodes required to run my private Blockchain Network stable?

I am designing a use case where millions of users will be using it and is expecting a transaction rate of 50 per second. I am looking forward to have it on Azure.
0
votes
1answer
11 views

what will happen to transactions on smaller length chain when peered with longer length chain in private ethereum

what will happen to transactions on smaller length chain when peered with longer length chain in private ethereum? Below is the scenario Step 1: I have started Ethreum private chain in 2 different ...
0
votes
0answers
8 views

Is it legal create an algorithmic trading cryptocurrency fund for social groups around the globe to pool in their money?

Is it legal create an algorithmic trading cryptocurrency fund for social groups around the globe to pool in their money? What is the viability of this project in terms of regulatory compliance?
0
votes
0answers
9 views

Error using drizzle and react

My contract Storage.sol - pragma solidity ^0.5.0; contract Storage { string public data; function getData() view external returns(string memory) { return data; } function setData(...
0
votes
0answers
7 views

Getting error when importing, no error when using code in single file: Failed to execute 'postMessage' on 'Window'

I am trying to access the web3 object injected into my browser by Metamask. I am using custom rpc (). I can see my accounts and correct balances in Metamask. I have the following code: //web3.js ...
0
votes
0answers
9 views

How Geth classify transaction as local or non-local? txpool validateTx skips gasPrice validation for local transactions

I see geth code skips the validation of the local transactions https://github.com/ethereum/go-ethereum/blob/master/core/tx_pool.go#L528 // Drop non-local transactions under our own minimal accepted ...
0
votes
0answers
15 views

Why do I get a bad instruction in the transaction?

Here is my withdraw dividend code : function WithdrawDividend(address) public { if (!_RestrictedFromDividend[address(msg.sender)]) { _SavedDividend[msg.sender] = _balances[address(...
-1
votes
0answers
13 views

Struggling to access Ethereum Contract on ServerSide

Hi I have a very basic DApp set up to write three pieces of data to a test contract. The data can be written and retrieved on the client side using the following HTML code <!DOCTYPE html> <...
0
votes
1answer
15 views

html:82 Uncaught ReferenceError: App is not defined at HTMLButtonElement.onclick (html:82)

It's showing me uncaught reference error in my index.html file <div id="candidate-box"></div> <button class="btn btn-primary" onclick="App.vote()">Vote</button> ...
1
vote
1answer
16 views

Assert.equals() weird behavior does not recognize (apparently) equal strings

I'm facing problems related to string comparison using Assert.equals() provided by remix_tests.sol. I made a toy contract and a related test to show what the problem is: https://gist.github.com/...
0
votes
0answers
7 views

Error send token

let minABI = [ // transfer { "constant": false, "inputs": [ { "name": "_to", "type": "address" ...
0
votes
0answers
7 views

Mining pool assign blocks

I've been researching mining pools to figure out how they assign work to miners. I understand that pool would get a job from the blockchain they only has a header, dag, difficulity, probably block ...
0
votes
0answers
15 views

Do I need a state-channel or side-chain?

I'm building a protocol which involves 2 phases. In the first phase anyone can participate and in the second phase only a randomly generated permissioned few. A lot of state changes and dynamic token ...
0
votes
1answer
36 views

How Do You Parse Web3 Retuned JSON Objects of Events?

I am using Web3 1.0 to listen to events from a contract like this: tokenContract.events.AddressList({ fromBlock: 6020474, toBlock: 'latest' }, (error, events) => { ...
1
vote
1answer
38 views

Token migration and IDEX smart contract problem

During a recent token migration from token A to token B, a large number of token A were held by a number of people in an IDEX address (where it was ready to trade). The IDEX address is part of a smart ...
0
votes
1answer
25 views

I don't understand why my function is not working

I have a read function to check whether someone should go and use the write MakeEligible function. Here is the code: function ShouldIMakeMyselfEligible(address) public view returns (bool) { if (...
0
votes
1answer
29 views

Problem: Values from a transaction(web3) are not stored in datastucture defined by Solidity

First of all i use Truffle and Ganache. I made a smart contract with solidity defining the following structures: struct TimestampproTeil { uint Fahrwerk; uint Chaussy; uint Kabine; ...
0
votes
1answer
23 views

Deploy smart contract on Ropsten with Truffle without truffle-hdwallet-provider

Here is my truffle-config.js networks: { ropsten: { network_id: 3, host: '127.0.0.1', port: 8545, gas: 4000000, from: "address_in_metamask" }, I ran a geth node using the command: geth --...
0
votes
0answers
24 views

How to deploying a contract address on the front-end?

So I'm using web3@0.26.0 to deploy my contract so I can get my contract address from it. And I used it from my backend too and it works. But when I want to implement it on my frontend, I've got an ...
0
votes
1answer
17 views

How do dapps connect to blockchain network?

Once the simple blockchain web applications runs on the web browser it uses the metamask to connect to the blockchain network, when it comes to mobile applications how the application connects to ...
1
vote
1answer
14 views

bytes data param in safeTransferFrom

In ERC721, safeTransferFrom has bytes data parameter. function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) public; how do I send data (is it in hex format?) and what ...
0
votes
0answers
10 views

How to save contract address to database with web3js and mongoose when I deploying a contract?

I wanted to get my contract address after it deployed, and then save it into my mongoDB. But instead of that, my contract address is deployed after it. So my mongoDB won't save my contract address. ...
0
votes
0answers
15 views

Handling a promise in a return function

I am trying to console.log the blockNumber that my transaction was confirmed in with the following code: web3.eth.sendTransaction( {from:account3, to: account2, value: web3.utils.toWei('1','ether'...
-3
votes
0answers
20 views

Who has the smallest public address [on hold]

With possession of the private key. I guess I mean, the smallest hashed public key.
0
votes
1answer
27 views

Mapping not updating after function is called

After calling this function: function WithdrawDividend(uint256 value) public { require(value <= _balances[msg.sender]); if (_RestrictedFromDividend[address(msg.sender)] <= 0) { ...
0
votes
1answer
18 views

uint[] to address with correct checksum

Lets say we have something like this as a given: bytes20 b = bytes20(someAddress); uint8[] memory array = new uint8[](b.length); for (uint256 n = 0; n < b.length; n++) { array[n] = uint8(uint160(...
0
votes
2answers
28 views

Deploy contract dynamically based on user request

Inspired by this blog: https://medium.com/coinmonks/escrow-service-as-a-smart-contract-the-business-logic-5b678ebe1955 I want to deploy contract once a buyer want to purchase a service. However, I ...
1
vote
0answers
10 views

How to add a custom JSON-RPC endpoint to geth?

I'm building an Ethereum private network and I want to make a custom JSON-RPC endpoint. I've been customizing and adding some things in the go-ethereum source code but I don't know yet where to look ...
1
vote
1answer
15 views

Solidity: Saving arbitrary data into bytes array and later parsing it

I want to create a function that receives two addresses and saves them into a bytes array. later a matching function will receive this bytes array and parse the two addresses. function ...
1
vote
2answers
17 views

Who is msg.sender in a nested call chain?

I read about who is msg.sender when calling a contract from a contract, but who is msg.sender when calling a contract from a contract that calls another contract and so on and so forth?
1
vote
1answer
23 views

How does EIP-55 prove a string is ACTUALLY a valid Ethereum address?

I wonder how EIP 55 check proves an address is actually an Ethereum address, or does it prove this at all? Am I missing an obvious point in Vitalik's code below from EIP 55? from ethereum import ...
0
votes
1answer
14 views

What are the parameters for the ideal gas limit?

I am new to writing smart contracts, in recent times I am having trouble in deploying the smart contracts couple of times so I need a solution for that. I am using the truffle most of the time so ...
0
votes
1answer
23 views

Event to alert when receive a token

I need to write a contract. That contract should detect and alert while receiving token/ether with some parameter. If somebody sends token/ether with some parameter to my contract. I need to know at ...
0
votes
0answers
12 views

address.call(abi.encodeWithSignature(“func(<param>)”, _params) doesnot work

contract C1 { uint public num; address public sender; function callSetNum(address c2, uint256 _num) public { (bool res,) = c2.call(abi.encodeWithSignature("setNum(uint256)",_num)); ...
1
vote
1answer
12 views

can etherscan.io show local ganache transaction details?

I am purchasing tokens on my sample Dapp with ganache-cli account using metamask. Metamask shows the confirm message and deduct the ether from total balance but in token section it still not update ...

15 30 50 per page