All Questions

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

How to substitute attributes instead of roles in access control coding for solidity?

Say, the role-based access control consists of two roles. But if I want to replace the roles to maybe location and time, how to go about it?
0
votes
1answer
29 views

ethers.js - estimating gas limit

Using the ethers.js library, how can I determine the gas limit when sending a transaction to a contract or deploying a new contract?
2
votes
1answer
19 views

ETC - Negative Balance

So playing around with ETC and wondering how in the world this address doesn't have a negative balance? https://gastracker.io/addr/0x6f1f8a70e2257354e81c306f130f7976dead8e8b First transactions are ...
2
votes
2answers
36 views

dYdX event log signature hash

dYdX has an event called LogDeposit(address indexed accountOwner, uint256 accountNumber, uint256 market, BalanceUpdate update, address from) within their SoloMargin contract. I am trying to get the ...
0
votes
1answer
24 views

How to call external payable contract function from app.js (DApp)?

The contract has a function: function purchaseTokens() external payable { require(msg.value>0); ...etceteras... } What I need is an app.js part, something that would look like this (lets ...
1
vote
0answers
19 views

pass struct from web3 python interface to solidity

I have created a smart contract with some solidity functions which take structs, enums and mappings(all defined in my contract) as arguments. I intend to call these functions from my web3 python ...
0
votes
0answers
33 views

Ocean Protocol Payment [closed]

How does payment happen in Ocean protocol? Whenever the data is shared, what logic is applied to enable payment? Is it a micropayment? If yes how to stop the payment when the data sharing stops.
0
votes
0answers
22 views

Different when calling deployed Address and new() contract

I follow the code of MetaCoin project and wonder how different between two types of test: pragma solidity >=0.4.25 <0.6.0; import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; ...
0
votes
1answer
15 views

Truffle Contract Abstraction Contract.at() not returning logs when methods are called

In my test file I have this set up: let acc = await Account.deployed() Then when I call a method, I can get the logs in the receipt: let deposit = await acc.deposit() console.log(deposit.receipt....
0
votes
1answer
15 views

How to know the execution time of transaction when miner execute it

When i send three consecutive transactions to my contract (deployed on ethereum testnet), how can i know the exact time (at milli/micro/nano level) which transaction executed (on miner side) first and ...
0
votes
1answer
29 views

Incorrect bytes32 to string conversion

My solidity function is returning a bytes32[] which I am looping in Javascript and converting to string using web3.toAscii(). Printing this in console shows extra � characters at the end as shown ...
0
votes
0answers
14 views

Blackjack - keep dealer second card hidden

I am working on a multiplayer blackjack implementation with an array of 52 cards as the deck that have a flag if they're selected or not. I'm implementing a random number generator to choose a random ...
1
vote
2answers
38 views

Emit of boolean returns “null” instead of “false” (Solidity, web3.js)

A Solidity event is supposed to emit a boolean. In case of won = true the transaction receipt in web3 logs true as expected, but if won = false the emit logs null instead false. I have no idea why. ...
0
votes
1answer
17 views

Can someone send their stable coin ERC-20 tokens to my smart contract?

Here is a business case. Two people own an asset, and they estimate the annual maintenance on that asset is $1000 over the next year. So they each want to put $500 and lock it up in my smart ...
0
votes
1answer
28 views

How to connect a external database with a solidity smart contarct? [closed]

I have a problem creating a external database and connecting it to solidity smart contract so to make a access control solution to it.is there any syggestion for creating the database and impliment ...
0
votes
1answer
27 views

List of ALL Ethereum Contract Events, for ex: Transfer, Mint, etc

A very simple question, yet couldn't find a simple answer. Where can I find a list of all event types such as Transfer, Mint, etc? Is this stored anywhere, for ex: online database or historically ...
0
votes
1answer
25 views

Does Geth provide a private or public network?

I'm new to the Blockchain world, lacking experience and I'm looking for some assistance. I'm just syncing with ethereum network by using Geth and rinkeby network. by using this command: geth --...
0
votes
0answers
18 views

Solidity: get transferrer address

Let's say there are following contracts: Exchange (my contract) Coin (my contract) Super token (foreign contract, but it's ERC20) I would like to let user to transfer tokens to my exchange. It's ...
0
votes
2answers
38 views

Transfer ether from one account to another using smart contract

I`m trying to transfer ether from account A to a smart contract and from the smart contract to account B. I wrote some code that approximately works on Remix IDE, but I completely got lost with the ...
1
vote
0answers
15 views

Why does Ethereum have nested trie structure that a storage trie is under a account in state trie?

As I understand it, the leaf node of the state trie has account data. The account data has a storage root, and the variables of the contract are stored in the leaf node of the storage root. But ...
0
votes
2answers
32 views

Solidity Warning

I want to know what's wrong with my function, 'cause Visual Studio Code give me warning : function state mutability can be restricted to view this is my function : function verifyVote(address ...
0
votes
1answer
11 views

What would it take to make ICAP addresses available to banks transfers that use IBAN?

How could we implement a way that ICAP addresses can be used in the IBAN field when making a normal bank transfer? What risks would it bring?
0
votes
1answer
27 views

Is it possible to create functions with specific addresses?

I want to do functions involving a few specific addresses. They are defined as such at the top of the contract : address lockaddress = 0x36667BCBBE6574520fba783410beB6C0AfDE5043; //replace with ...
0
votes
0answers
12 views

How to test for compiler bugs allowing arbitrary jumps?

OptimizerStateKnowledgeNotResetForJumpdestand OptimizerClearStateOnCodePathJoin allowed in certain condition a jump to incorrect destination. Yet, I’m not finding their specific issues in https://...
0
votes
3answers
34 views

Web3.Utils - WeiToEth and EthToWei Conversion choking on decimals

I have the following two helper functions. It was based on a course I'm going through, so I didn't think I would have to debug them. I don't understand why it works with whole numbers, but not with ...
0
votes
0answers
16 views

Does a contract creation failure leave the target address with nonce 1?

When contracts are created, they start with nonce 1 not nonce 0. This is since the implementation of EIP-161. The ETH wiki page on nonces outlines what happens when a contract A tries to create a ...
1
vote
2answers
36 views

Crazy Math Result from OpenZeppelin

I was getting a "EVM error", so I commented out some code and backtracked to find the issue. I added my _feeAmount to an Emit, and getting a what seems to be a bizarre math answer on a simple math ...
1
vote
0answers
25 views

Who confirms Ropsten and Rinkeby transactions?

Basic or more like "fundamental" question I guess: So if I got that right, each time someone runs Geth/Parity or other software they all become part of the EVM (ethereum virtual machine). However ...
1
vote
1answer
18 views

Why does proof of non-inclusion is useful in Ethereum?

Currently Ethereum uses modified Merkle patricia trie and maybe plan to move to a sparse Merkle tree (SMT), which both support `proof of non-inclusion', i.e. allowing one to proof that some key does ...
0
votes
2answers
23 views

Calling smart contract functions and submitting transacions in BACK-END in high level

I have read some references to create ethereum transactions by a BACK-END server, all in low level, for example, requiring that I control the nonce by myself. Are there safe ways to avoid this control ...
0
votes
0answers
19 views

web3.eth.subscribe('newBlockHeaders'): Cannot read property 'id' of undefined

I have this error when using web3.eth.subscribe('newBlockHeaders', (error, blockHeaders) => {...}) I put try/catch everywhere I could, but I still have this: UnhandledPromiseRejectionWarning: ...
2
votes
2answers
19 views

ERC standard: possible to set upper price limit for NFT?

Let's say I want to create a non-fungible token which represents a ticket to a venue. And I don't want ticket scalpers to buy tickets and resell these tickets for a higher price. It should only be ...
0
votes
1answer
26 views

State Variable of solidity Contract could not be updated through JavaScript

I have following contract and just want to update its state variable values i.e. totalSupply. But when I try to attempt this task through JavaScript code (given below) by calling its function i.e. ...
0
votes
0answers
20 views

Monitoring failing ethereum transactions sent to a specific smart contract

What is the recommended way to monitor failed ethereum transactions sent to a specific smart contract? Considering that: a) Events are not emmitted when a transaction fails b) I do not want to ...
-2
votes
0answers
26 views

Type is not callable, expression has to be an lvalue, when using specific address?

I want to create a locked address for the dev amount. It is defined at the top of the contract like this : address lockaddress = 0x36667BCBBE6574520fba783410beB6C0AfDE5043; Later I go on to use it ...
0
votes
1answer
18 views

Can a contract be inherited?

Just a random thought and a question. Can a smart contract written in solidity be inherited and if so, How?
0
votes
3answers
59 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
29 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
15 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
56 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
18 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 ...

15 30 50 per page