All Questions

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

Gas estimation failed - remix

I am trying to figure out what is wrong with the following code as it does deploy successfully on remix. pragma solidity ^0.5.11; contract MyContract { // Storage address contractOwner; ...
0
votes
3answers
30 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...
0
votes
2answers
21 views

How can I talk to other contracts and store their function call returns as variables?

For example, I want to grab the current borrow rate for a token on compound.finance. In this contract InterestRateModel.sol, is there a way to call getBorrowRate from my own contract and get the ...
0
votes
0answers
12 views

Size of disk in one node is higher than other nodes in private ethereum

I have 4 nodes private ethereum. After work 2 years, 1 node suddently has over 80% disk of usage and the rest of nodes only 50 disk of usuage. Please explain for me, what's happen?
0
votes
1answer
16 views

how to handle gas run out in a payable function

function payMe() payable{ // doing some stuff with `msg.value` users[msg.sender].balance += modifiedMsgValue ; } In the above code what if gas runs out on the second line? so there will be ...
0
votes
1answer
18 views

Plasma protocol

How this protocol works, simple explain. How to do the exchange operation on this one? Best implimentation on your opinion? (subjective ofcouse)
0
votes
1answer
23 views

Get Contract Address by It's ByteCode

I have some bytecode and would like to find the contract address that it belongs to. Is there an easy way to do this?
1
vote
1answer
57 views

Accessing struct fields from assembly block

Say we have the following structure: struct MyStruct { uint256 x; uint256 y; } and that it is passed as an argument to some function. Inside that function, we have assembly block from where we ...
0
votes
0answers
19 views

Can a dapp/smart contract execute a transaction based on a private github file modification?

Scenario Suppose someone promises to deliver code to a private repository, that person is so sure they will, that they even said: "here is x eth, if I don't deliver in time, send the x eth to a ...
0
votes
2answers
26 views

handling block gas-limit in a large loop

I have a loop like this: struct User { string name; uint tokens; uint frozenTokens; bool isValid; } mapping(address => User) users; address[] public usersAddresses; function ...
0
votes
1answer
20 views

Simple Question on ecrecover

I think that I can verify a hash of a message using my signature within a Solidity contract, something like this: contract ecrecover { function testRecovery(bytes32 hash, bytes signature) returns ...
0
votes
1answer
54 views

Why admin.addPeer() command did not add parity client for private chain with Docker?

I would like to set up private chain which both geth and parity clients running on the same network. here is a sample repository with docker-compose file: https://github.com/user48736353001/devnet ...
0
votes
1answer
13 views

Connect dApp hosted on cloud with Geth running locally

I've my dApp running on AWS and Geth running locally. How am I supposed to connect my hosted dApp with the Geth? I'm connecting my web3(using web3.py) using my computer's(Windows OS) IP address. ...
0
votes
1answer
21 views

gas usage for a large loop

How expensive are loops in solidity? (in terms of gas usage). I need to loop through ~1000 wallet address, and send each of them some tokens. my code: struct User { uint32 frozenAt ; uint ...
-1
votes
1answer
27 views

How and when should I use a Ethereum smart contract in document verification process?

First, a student applies for a certificate in his/her University . The University creates his degree certificate . Now , how do I write a smart contract in Solidity so that anyone in blockchain can ...
-1
votes
1answer
31 views

How to build ERC20 based stablecoin?

I want to build stablecoin for my college project. I am thinking of developing ERC20 token pegged with fiat currency. Can someone please suggest me best tutorials/guides to build stablecoin on ERC20?
0
votes
1answer
18 views

How to get the pending transactions in the whole network from ethereum?

I would like to get the pending transactions in the whole network of ethereum. For example, the transaction '0xabcdefg' is right now pending in the pool, waiting to be mined by miners, after 12 ...
0
votes
0answers
23 views

Geth Private Network on restart of geth server account balance and all previous transactions are cleared [duplicate]

I first run the geth init command with the following genesis content: { "config": { "chainID": 937, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0 }, "alloc": { "acc1": { ...
0
votes
1answer
15 views

Data location must be “calldata” for parameter in external function, but none was given

I'm trying to compile my code in Remix and I try to fix it but I keep getting the same error: Data location must be “calldata” for parameter in external function, but none was given". The problem ...
0
votes
1answer
37 views

How to automatically identify which value is stored in specific location of transaction input , given a smart contract source code and ABI?

For example, a function's name and parameters are given as following: function batchTransfer(address[] _receivers, uint256 _value) public returns (bool); Then I want to get a python dictionary whose ...
0
votes
1answer
22 views

truffle test - does not Assert (Erc20, Solidity)

I am probably doing something wrong but can't see what exactly. Code: pragma solidity ^0.5.8; import "truffle/Assert.sol"; contract TestABC { function totalSupplyTest() public { bool a ...
-1
votes
2answers
41 views

Help a noob testing: it ' should deposit 1 Ether'

I wanted to revive or refactor this old smart contract as an exercise to learn solidity and js coding. Truffle compiled it and migrated it and it passed the first test (Although I'm not sure if it ...
0
votes
1answer
23 views

Transaction values exchanged even if transaction rejected, and double values exchanged if transaction confirmed

I'm trying to perform a function that exchanges one token for another, but I'm getting a very strange bug. If I call the function in web3, I get the standard metamask popup asking whether to confirm ...
0
votes
1answer
15 views

Can I call a contract function in the “data” element via web3, especially when I am using conversion to bytes?

In other words, say In Python I have something like that: signed_txn = w3.eth.account.signTransaction(dict( nonce=w3.eth.getTransactionCount('0x0000000000000000000000000000000'), gasPrice = ...
1
vote
1answer
12 views

Warning: This declaration shadows a builtin symbol

modifier require(bool condition) { if (! condition) revert(); _; } When I try to truffle compile my contract I get an error here: "Warning: This declaration shadows a builtin symbol."
4
votes
2answers
49 views

Prove that a solidity function was executable in the past

I was wondering if anyone knows a way of how to prove that a certain function of a solidity smart contract was executable (i.e. not reverting) after the fact without calling the function itself, e.g. ...
1
vote
2answers
44 views

How to know if transaction is failed due to insufficient balance?

I want to know if it is possible to know from "error" object returned by geth that the error it was due to insufficient balance (something to compare with) I have a js code like that: mycontract....
0
votes
1answer
32 views

is this the right way to simulate having a negative number?

I needed a number which could go negative but since there is no negative number in solidity this is how I'm doing it: // using safe Math uint pool = 0; // this is my number bool positivePool = true; ...
1
vote
1answer
17 views

Two calls to a contract: input of the first can only be revealed after the second call

I see that there are no parallel execution in EVM. The problem I am trying to solve is the following: I have a contract which takes the input of two parties -- say users A and B. The result of the ...
1
vote
1answer
26 views

What is the best way to deploy and test smart contracts on multiple machines?

I have recently started developement on Ethereum and the concepts are pretty much new to me. I need to test event emitting/listening on multiple machines for my contract. For the same, I have tried ...
0
votes
1answer
28 views

Defined GasLimit in genesis file and in web3j gasprovider

Im having issues when I try to implement a back end that generate smart-contract transaction calls using web3j. But I'm a lit confused with the gas limit concept. I have defined inside the genesis ...
0
votes
0answers
17 views

ERR_INVALID_ARG_TYPE when exporting/setting Private Key using code Buffer.from(process.env.PRIVATE_KEY_1, 'hex')

I'm getting the following error: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined From the ...
0
votes
2answers
18 views

How to find private keys on Remix ide

I want to sign a message on Remix and I can't find the pair of private/public key. For example - I going to Deploy & Run Transactions, then trying to "Sign a message using this account key" with ...
0
votes
1answer
21 views

What's the difference between the typical ERC20 Transfer(from, to, value) and the same but with bytes, e.q.: Trasnfer(from, to, value, msg.data)?

Better question: Can I send the bytes to a function that lacks this definition? In other words, say I have: event Transfer(address,address,uint256, bytes); And then: function transfer(msg....
0
votes
2answers
40 views

Smart contract design: Interacting with DAI

Let's say I want to build a product that let companies settle cross-border payments for invoices using DAI (https://makerdao.com/en/dai/) as medium of exchange to ensure stable value of the ...
1
vote
0answers
17 views

Is there any particular reason the position of the public/private keywords change depending on whether it's a function or variable?

I fear it will be difficult for me to remember if this quirk of the language is arbitrary...
0
votes
0answers
13 views

Should light clients listen on public ports?

quote: To only download data from other nodes, you don't need to open any outgoing ports at all. Opening your :30303 to the world is required only if you want to run full node, helping other people ...
-1
votes
0answers
32 views

How can I decode the logs same as ropsten.etherscan.io, which can resolve the logs error?

The execution result is at https://ropsten.etherscan.io/tx/0x92377cb678fa3f5ef19fc8f3189b76a4e3587090a6d027eab10de83fc6a07986. The following code give me "(node:2378) UnhandledPromiseRejectionWarning:...
-1
votes
1answer
40 views

Unable to test a smart contract on ropsten test network

I launch and verify an ERC20 based smart contract on a ropsten test network which allows user to interact with the contract (send eth to it and the contract automatically send token in returns as in ...
0
votes
1answer
36 views

Calling contract from contract not working

below are very simple setup of one contract calling another contract and I somehow can't get it to work. Contract C1 pragma solidity ^0.5.0; contract C1 { int public x = 1; function setX(...
0
votes
0answers
34 views

Incompatibility issue of solidity 0.5.12 (or perhaps ^0.5) with web3 js v1.2.2 or with Geth v1.9?

Is there any incompatibility issue of solidity 0.5.12 (or perhaps ^0.5) with web3 js v1.2.2 or with Geth v1.9? Because a contract in v0.4.24 works perfectly with given web3 version and Geth version, ...
1
vote
1answer
19 views

Why use anything but uint256/int256 outside of a struct?

I see how uint8 can save space within a struct, but outside of that I do not see any reason to use anything but uint256. The gas cost is slightly higher for uint8. The only reason I can think of is ...
0
votes
1answer
24 views

How to return the result of a Solidity view method from a javascript function?

I want to determine a view function of a smart contract result in web3js 1.x Suppose we have a view function getName(uint code) and want to get the name of a person having his code. So we write: ...
0
votes
1answer
16 views

Deleting vs. Assigning to Default Values

If I have a struct with many customer accounts: bytes32[] public customerID; mapping(bytes32 => CustomerAccounts) public customerAccounts; struct CustomerAccounts{ address customer; uint ...
0
votes
1answer
21 views

How to get tokens for crowdsale from the main token contract

Trying to deal with ethereum contracts using openzeppelin examples and remix. There is a token contract deployed in the test network pragma solidity ^0.5.0; import "./ERC20.sol"; import "./...
0
votes
1answer
14 views

AttributeError while trying to call a contract using web3py and Infura

I am trying to call a function from an already-deployed contract on the Ropsten network: from web3 import Web3 infura_url = "https://ropsten.infura.io/v3/XXXXXXXXXXXXXX" w3 = Web3(Web3.HTTPProvider(...
1
vote
1answer
18 views

Call Smart Contract Function in Python Script

My situation is reverse to most. I am relatively experienced in coding in Solidity, but have absolutely no experience in using Python. What I would ideally like to do is have a script that will, in ...
0
votes
1answer
14 views

What are the minimum requirements for Geth server only for API calls?

I want to run a platform based on Ethereum and PHP to let our customers to sell/buy Ethereum based currencies online, and we have not any plan to mine the blockchain. In this regard, please help me to ...
0
votes
2answers
17 views

How to get the result by parsing the log after executing the contract? How can I get the execution result?

How to get the result by parsing the log after executing the contract? How can I get the execution result ?
0
votes
1answer
19 views

Not possible to connect to the Web3 provider

I have a problem connecting my url to my quorum node. I already make sure the node has an account, I run it without problem but I have that error enter image description here enter image ...

15 30 50 per page