All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
529 views

Where is the compiler in Remix?

I installed remix-ide. It is able to compile contracts. So it somehow calls Solidity compiler. Where is this compiler located in the filesystem and how to use it without remix-ide?
0
votes
1answer
22 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
1answer
461 views

Can't get the func in `web3.eth.getAccounts` to run

I'm trying to perform a simple balance check, but the code inside web3.eth.getAccounts doesn't run. I'm trying to get web3 from the instance injected by Metamask. myWeb3.eth.getAccounts(function(err,...
4
votes
1answer
189 views

Is transfer() still safe after the Istanbul update?

In other words, is using transfer() safe? function transfer(address contractB) public { contractB.transfer(1000); //balances[msg.sender] -= 1000; } How about using call.gas? function ...
8
votes
4answers
3k views

Undefined results for “web3.eth.accounts” in truffle console

truffle(development)> web3.eth.accounts[0] gives output as "undefined" truffle(development)> web3.eth.accounts instead of showing all accounts details gives the below output Accounts { ...
0
votes
1answer
55 views

Network propagation delay and forks in Proof of Stake?

I am learning the fundamental of Proof of Stake (PoS), i came accross a question which i could not find answer to. Assume we have three validators (aka miners in PoW), V1, V2 and V3. Each of the ...
1
vote
1answer
758 views

Web3 Solidity events do not work any more in Chrome?

Ok, it seems like this issue is only present in chrome browser I am working with Version 64.0.3282.140 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit) Actually I had some ...
0
votes
1answer
69 views

Cannot Find Module Error for Truffle-contract

Error:- Uncaught Error: Cannot find module './truffle-contract.min.js' at c (web3.min.js:1) at c (web3.min.js:1) at index.html:27 <!DOCTYPE html> <html lang="en"> <head&...
2
votes
2answers
363 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
1
vote
1answer
35 views

How to decode InputValue of ethereum using java web3j

**I'm trying to decode the inputValue of an transaction using web3j without using any contract abi and wrapper class,Im loading the contract using its contract address ,is there any way/inbuilt ...
0
votes
1answer
989 views

Web3.py transact works but call doesn't

I am trying to call a fairly simple contract on a private blockchain: function getOwner() public returns (address) { return owner; } And here is my running it from an interactive Python shell: &...
0
votes
1answer
458 views

How to use 'geth' to find a smart contract in the ropsten testnet

I try to connect with web3.php to a smart contract, published in the ropsten test network via metamask. I used the following web3.php library: (https://github.com/sc0Vu/web3.php). To create an rpc ...
0
votes
0answers
18 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
2answers
61 views

find the bytecode of a contract during compilation

Is there a solution to recover the complete bytecode (init + runtime) of a contract imported in solidity. For example "bytes code = getBytecode (Escrow.sol)" and this would be replaced by bytecode ...
3
votes
1answer
261 views

How to access non-indexed event arguments from Go types.Log?

The Go bindings have a type called Log that has the following fields type Log struct { // Consensus fields: // address of the contract that generated the event Address common.Address `...
0
votes
1answer
28 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
659 views

How to get a pending filter only for a contract

I would like to do the equivalent of: pendingEvent = web3.eth.filter('pending'); but only for a specific contract: pendingContractEvent = myContractInstance.allEvents('pending'); or more ...
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) { $(...
1
vote
1answer
216 views

Ethereum crowdsale example - Stuck tokens (how to save)

I deployed a crowdsale contract using the source from ethereum.org and loaded it with some tokens. It works as expected, except that it has no code to return the unsold tokens to the beneficiary. Is ...
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
2answers
35 views

Script For Emptying Address

Does anyone have a script that can be used to transfer all ether found in an address to another address? The script will constantly check for any incoming ether and make an automatic transaction, ...
1
vote
0answers
24 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 '...
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
19 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"; ...
1
vote
4answers
976 views

How to access ethereum smart contract(already deployed) in a Java application via its address using web3j?

I have an existing Smart contract address,abi,binary code. I need to access it from a Java application.Is it possible to do this without creating a java wrapper class?
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?
1
vote
1answer
869 views

ETH stolen from two MEW wallets & moved to an unknown address & then to ShapeShift

I recently found out that my ETH funds were stolen from two MEW wallets and moved to an unknown address. Below are addresses of my two MEW wallets. 1) 0x16bf750Ee569F0A173BCCfD7b3F92F9Bb46c6AfC (...
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 ...
1
vote
1answer
242 views

What is auxdata in the asm output from solc?

I am using - solc --asm smartcontractname.sol I get at the end of the asm auxdata. I am trying to check different modules to see what is inherited. Does anyone know how auxdata is computed? Here is ...
2
votes
2answers
289 views

How to create test accounts with custom balance programatically in web3.py?

I am trying to write tests for a smart contract and am having trouble transferring funds to the contract's address. I'm using web3.py app which (if I understand correctly) runs its own TestRPC, like ...
0
votes
1answer
48 views

How to force update Drizzle cacheCall value

I have a contract value inside the Drizzle store. It updates correctly when a transaction directly interacts with a contract. But it doesn't updates when the transaction is internal. I want to update ...
0
votes
1answer
193 views

How can I show on web3j a list of all the instructors added on my blockchain?

I need to show on an html a list of all the instructors that are set up on the list pragma solidity ^0.4.18; contract Owned { address owner; function Owned() public { owner = msg.sender; } ...
0
votes
0answers
21 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" ...
1
vote
1answer
19 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
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 ...
2
votes
3answers
2k views

Accessing web3 object in Chrome terminal using React

I am receiving a "not defined" error when trying to access the web3 object in Chrome terminal. My current setup: running testrpc web3 object successfully instantiated in App.js built app using React ...
0
votes
1answer
32 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')....
2
votes
3answers
479 views

Ethereum wallet Vs Ethereum account?

I created an Ethereum node (geth) and this automatically created an Ethereum account. Is this account an Ethereum wallet? I then created 2 other accounts using personal.newAccount() command. Are these ...
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/...
-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
1answer
2k views

CONNECTION ERROR: Couldn't connect to node http://localhost:8545

I have started geth using below: geth --rpc --rpccorsdomain * --rpcport 8545 --rpcapi personal,web3,eth,net and this is my web3.js code: <script src="/bower_components/web3/dist/web3.min.js">&...
0
votes
0answers
19 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 ...
0
votes
1answer
55 views

# issue: Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

issue: Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? gas required exceeds allowance or always failing ...
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 ...
-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
695 views

Can not verify contract on etherscan.io “Error! Unable to generate Contract ByteCode and ABI”

I am getting the error "Error! Unable to generate Contract ByteCode and ABI" When I try to verify this code. I have split it into two pieces as I import it but not sure how to include it all in ...
0
votes
0answers
28 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 ...
2
votes
2answers
318 views

Difference between eth.newAccount and personel.newAccount

Can anyone explain the difference between `eth.accounts.create()` and `eth.personal.newAccount()` and which one we should use and why? As I am new to ethereum so its very confusing for me. Thanks
2
votes
1answer
249 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
1
vote
1answer
29 views

binary size of contract

If one imports another contract and instantiates it with 'new', then I assume the binary of that imported contract must be fully included in my contract (increasing its deployment size accordingly). ...

15 30 50 per page