All Questions

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

Listen to a solidity event from a smart contract function

I have the following event: event WaitingPlayer2(address indexed player2); Which I call through: function partecipateAsPlayer2(address player2) public{ emit WaitingPlayer2(player2); } Is ...
0
votes
0answers
5 views

tracing new address on new wallet in Ethereum

I am just wondering how the new addresses are anonymous in Ethereum. Suppose that I have a wallet A including many addresses on it. Then I have a new wallet, say wallet B, and opening new address on ...
0
votes
1answer
7 views

zeppelin tutorial smart contract (noob alert) can't connect to network

I am following this tutorial - https://docs.openzeppelin.com/learn/deploying-and-interacting#local-blockchain Everything was going good until i was asked to type the command - $npx oz accounts - ...
1
vote
1answer
13 views

Signing message with private key and verifying signer in smart contract

I have a smart contract that provides a message to sign and then validates the signer of the message. Something like: mapping(address => uint) public userNonce; function getSigner(bytes32 ...
0
votes
0answers
17 views

Function stopped working? No check is being done now on transfer function

I created a function to deposit and transfer ether and it was working great until i tried to deploy again and now the transfer function is not working anymore No errors are being thrown, the transfer ...
0
votes
0answers
11 views

Do something when epoch time is

This is my struct where I have: timeBeforeRenew. The idea is that, if a customer does not deposit x amount of token before the time expires, his address then automatically sends all the tokens ...
0
votes
0answers
11 views

custom ERC20 token balance does not show up on my own 0x exchange

I created my own 0x exchange according to the 0x Launch kit and the FAQ. I could add my newly created, custom ERC20 token to my 0x exchange, the token appears and I could even buy/sell them. The ...
0
votes
1answer
16 views

getBalance of shows the wrong balance

I have this code to show the erc20 token balance of an account var tokenAddress = '0xb97E9bBB6fd49865709d3F1576e8506ad640a13B'; var walletAddress = '0x62f28320f688A7A4e0021c55d7ffD1acd770A133'; ...
2
votes
0answers
23 views

Contract does not exist at address

I have setup a private Quorum network and successfully deployed contracts and executed contract functions using Visual Studio Code and remix. When i try to deploy the exact same contract manually ...
0
votes
2answers
25 views

Cannot transfer ether from smart contract to another address

I am using truffle and when we type truffle develop it provides us with 10 address ** So, the problem I am facing is I have created 2 functions one to deposit ether and the other one to transfer the ...
0
votes
0answers
11 views

How to call contract function in deployed conctract with Infura and nethereum

i'am trying to call smart contract function in test network "Ropsten" https://ropsten.etherscan.io/address/0xa89d48b51801b61b27f9dee744b888ae152c2115 (few failed transaction is just testing with empty ...
0
votes
0answers
13 views

How is this possible using web3 and truffle accounts

all i want is this Alice sends contract 1 Ether. Now contract has 1 Ether. Contract forwards 1 Ether to Bob. Now contract has 0 Ether. I know this is possible but to accomplish it with front end AND ...
0
votes
0answers
10 views

“truffle migrate --network ropsten” stuck after compiling

I am trying to redeploy a contract on Ropsten Testnet using the command: truffle migrate --reset -f 1567182283 --network ropsten Here, "1567182283" is the prefix of my migration file. Upon executing,...
0
votes
1answer
21 views

What is the differenc between Person and Account variables

What is the difference between Person and Account? struct Account { address addr ; uint balance ; } Account[ ] public accounts; function applyInterest () public returns ( uint ) { for ( ...
0
votes
1answer
9 views

Problem with understanding contract containing array of structure

I got the following code for a contract from a Solidity tutorial website: pragma solidity 0.5.1; contract MyContractPersonStruct { Person[] public people; uint256 public peopleCount; ...
0
votes
1answer
7 views

Integrity of old blocks in the blockchain

I am learning Ethereum using Geth, and I am testing PoA-Clique networks. Now I have a conceptual doubt about old blocks integrity. Suppose I have a private blockchain network of only one miner node ...
0
votes
1answer
25 views

cant call contract instances on my UI

I want to be able to display the read functions of my contract on a UI. These are the calls I make to my UI Those functions work perfectly in the console using node but when i try to call them from ...
0
votes
1answer
19 views

How to store a erc token instead of eth into solidity function

How to store a token instead of eth into solidity function below are the code for storing ether. how to change into erc 20 token instead function deposit() public payable{ require(msg.value >= 1 ...
0
votes
1answer
16 views

Redeploy contract on Ropsten Network

I have already deployed my smart contract on Ropsten network for testing using truffle suite. The command line I used was: truffle deploy --network ropsten Now, I have made some changes to my ...
0
votes
0answers
35 views

Whas this Error Code and how can i get rid of it?

Im using this code to query the balance of the logged-in address // get sellPrice function sellPrice() { web3.eth.getAccounts(function (error, accounts) { contract.sellPrice(address, ...
0
votes
1answer
25 views

Making contract compatible with newer solidity version

I have a simple ERC20 contract however it doesn't work with modern solidity compilers, Could anyone make my contract compatible with solidity newer than 0.5.16? Thanks. Here is the code, it only ...
0
votes
0answers
17 views

How can I make function calls in UI based on these functions of my smart Contract [closed]

I want to call these functions as soon as an address is logged in to my UI Whats the best way to achieve this with metamask, web3 js?
0
votes
1answer
27 views

How can I access elements in Object?

I have my contract object and this has attributes like contract.balanceOf contract.myDividends contract.totalSupply contract.myTokens I get an error this._eth.call is not a function when i try to ...
0
votes
1answer
18 views

How to properly initialize nested storage array/struct?

contract Contract { struct A { int a; } struct B { A[] as; } mapping(address => B[]) bs; function addB(B memory b) { bs[msg.sender].push(...???...); } } I have nested hell of arrays and ...
0
votes
0answers
18 views

How can we send ether to smart contract address and then transfer it to a account? [closed]

Any ideas, code or suggestions is welcome I am using truffle ,web3 ,metamask Can we send rawtransaction to contract address and then Retrieved the amount? I need to deduct amount from 2 people ...
0
votes
0answers
18 views

Accessing a storage array is causing my contract to revert with no explanation

I have the following contract: // Inspired by https://fravoll.github.io/solidity-patterns/eternal_storage.html pragma solidity ^0.5.8; import "./lib/Ownable.sol"; import "./MemberStruct.sol"; ...
0
votes
2answers
32 views

How to access contract attributes?

I have initialized my contract and need to balanceOf the current logged in address const contract = new web3.eth.contract(abi).at(address); contract.balanceOf(function (error, balance) { $(...
0
votes
0answers
14 views

solidity smart contract thats uses off-chain ML model

I'm new. Hopefully this is an appropriate question for this forum. (This is a simplified example). I want to write a smart contract that receives a loan request, and based on certain features of ...
0
votes
0answers
6 views

Running Geth on Heroku

Wanted to setup a local network with nodes running on heroku. With settings like mine only when pending transactions, and transaction rate being around 10 per minute, what could be the repercussions I ...
0
votes
1answer
14 views

How data is stored in Ethereum blockchain?

If I become a full node in Ethereum and retrieve the current state, how all this data is going to be stored in my physical drive?
0
votes
0answers
16 views

Transfer ERC20 (usdt) token between two addresses using web3.py

Here is my code: token_from = "0x0d0707963952f2fba59dd06f2b425ace40b492fe" token_to = "0x763015f098cf18cfa28baf25653955f271fb63ff" token_to_private_key = "0x0000000000000000000000000000000" ...
0
votes
1answer
27 views

How to make Information automatically update when account is changed?

To get the account address of the contract that is currently logged in with Metamask I use this web3.eth.getAccounts(function(error, accounts) { document.getElementById('account-address')....
-1
votes
0answers
18 views

How to retrieve totalBalance of an ERC20 token contract? [closed]

Im using this to get the toalbalance of "AGI" in the contract https://ropsten.etherscan.io/address/0xe462cbee0cd420f6c199b0194b1d8d93fb5e7720#code window.addEventListener('load', async() => { // ...
0
votes
0answers
18 views

Transactions are failing randomly for multiple reasons when sending them in bulk for a benchmark

I'm trying to benchmark a private blockchain network (3 Vagrant nodes with 2gb of RAM running Geth Clique PoA, on an i7 7th gen Intel Core machine), following this process: A function launch n ...
1
vote
1answer
14 views

Deploy a token which you can only send in multiples of x

Im a beginner in solidity. Is there a way to deploy an ERC20 token that can only be sent in multiples of X or else the tx fails?
0
votes
0answers
50 views

Cant call solidity function from app.js?

Solidity function Using web3 0.20 version and Cant call solidity BETONTEAM function pragma solidity ^0.4.22; import "installed_contracts/strings.sol"; import "installed_contracts/oraclize-api/...
0
votes
0answers
13 views

How to disbale metamask privacy mode so i can deploy contract from remix?

I am trying to deploy a contract in remix but I'm not getting any popup from metamask i believe this is due to privacy mode, however i can see no way to turn it off in the settings. I am using brave ...
0
votes
0answers
10 views

What does it mean to trace application ABI calls using strace? [closed]

What is meant by "Application ABI calls"? (In Linux)
0
votes
2answers
21 views

How can I get the current user account selected in MetaMask with Web3 js?

I'm using the next function to get the first account from user's MetaMask: var account = web3.eth.getAccounts((error,result) => { if (error) { console.log(error); } ...
0
votes
0answers
10 views

how can I retrieve the exact pending nonce from parity ethereum node?

please help me, the rpc method parity_pendingTransactions cannot return the result that I hope. https://github.com/paritytech/parity-ethereum/issues/11385
-3
votes
2answers
57 views

How to get contract Balance of ERC20 TOken? [closed]

I have my smart contract here https://ropsten.etherscan.io/address/0xE462CbEE0cd420f6c199B0194B1D8D93Fb5e7720#writeContract I want to display the total token Balance of AGI inside my contract. My ...
0
votes
1answer
16 views

Error when connecting to web3 and metamask

I use this code to connect ui with smart contract window.addEventListener('load', () => { // Wait for loading completion to avoid race conditions with web3 injection timing. if (...
0
votes
0answers
27 views

how to “approve” function from another smart contract?

I need to first have my transaction approved by another smart contract before ic an use the token in my smart contract. How can i call this function from the UI using meatamsk? The contract is here ...
0
votes
1answer
14 views

Receiving unexpected JSONRPC requests on my website

I have a production website (nothing about blockchain or related) and I a received hundreds of POST request to "/" with these params. Obviously my server raise an error because it doesn't know how to ...
0
votes
0answers
15 views

Fatal: Failed to read genesis file: open /Ethereum/conf/genesis.json: no such file or directory

I am trying to set up a privatte blockchain on my local system and while setting up the genesis block, I am receiving the following error - Fatal: Failed to read genesis file: open /Ethereum/conf/...
1
vote
0answers
23 views

Transaction sent from wrong Ledger account in Metamask

I use two ETH accounts on my Ledger - account [1] and [2]. When submitting a contract or transfering ETH on the mainnet from account [2] via Metamask it still sends from [1]. To Reproduce Click on '...
1
vote
1answer
34 views

Solidity: Get mapping from Struct

I'm kinda new to Solidity, sorry for this in advance. I'm building a Dapp and cannot understand how to get a mapping or an array from a Struct. This is the struct that have inside a two mappings and ...
0
votes
0answers
13 views

Import error when publishing source on Etherscan

I am attempting to publish my source code on Etherscan. When I compile, I get the following error. I assume that this callback is not reaching the destination. myc:3:1: ParserError: Source "...
0
votes
0answers
11 views

Real time access of transaction using websockets and web3py

I want to build the backend in Django using django channels that access the realtime blockchain data. Here is my smart contract. mapping(uint => Task) public tasks; event TaskCreated( uint ...
0
votes
0answers
17 views

How can i transfer ether upon callback from Oraclize/Provable? [closed]

I am a newbie any help is highly appreciated I know how to send call to oraclize finally, and how to transfer ether between two accounts using web3,metamask But How can i transfer this fund when ...

15 30 50 per page