All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
24 views

How to properly define an interface in Solidity 0.6?

One of the breaking changes of solidity 0.5 was making explicit function visibility mandatory, hence all interface functions must be defined as external today. In solidity 0.6, there seems to be two ...
0
votes
2answers
23 views

Unknown Accounts suddenly appearing in MetaMask wallet…?

My MetaMask wallet has multiple accounts which I did not create. I have no idea how they there. Is my MetaMask wallet compromised? Or is this normal that MetaMask creates new wallet addresses when ...
5
votes
1answer
577 views

How to retrieve ERC20 from a hacked address monitored by a bot?

Check it out: https://discordapp.com/channels/554623348622098432/633092550407749652/714325610050355260 The address that was hacked: https://etherscan.io/address/...
0
votes
1answer
26 views

How to find the address of the contract owner?

I'm under the impression that the owner of the contract is simply referred to as accounts[0] in Truffle's testing environment, but I'm getting the error by the modifier that the caller of a certain ...
1
vote
0answers
25 views

Contract not returning error to React Interface

I have a contract which I've tested with Mocha and Remix and is working just fine. The problem is when I'm running it with my React Interface. When I call a function in my solidity contract that ...
-1
votes
0answers
7 views

Metamask padLeft padding incorrectly/ different from web3js expected?

To Reproduce: With metamask just install it and on the web console run commands below. With web3js library used in browser --> &lt script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3....
0
votes
1answer
15 views

Reference Smart Contract Address in Smart Contract

Is there a way to know the address of the smart contract you are writing before deploying it? Or somehow reference the smart contract address in the smart contract?
0
votes
0answers
6 views

How to list sub calls of conctract methods transferring money?

Assuming I have a contract method which conducts several money transfers, e.g. function payalot(address payable p1, address payable p2, address payable p3) public { p1.transfer(42); p2....
1
vote
1answer
28 views

Sending transaction from different addresses in truffle test case

I am having an admin in my contract who can do certain things. Here is the contract function changeAdmin(address admin_) public { if (msg.sender != admin) revert(); potentialAdmin = admin_; }...
3
votes
2answers
25 views

How to infer token price from ethereum blockchain UniSwap data?

I would like (if possible) to infer a token price from the blockchain using UniSwap data. After reading the following article, I understood that it is feasible: https://blocklytics.org/blog/uniswap-...
0
votes
1answer
12 views

Storing and retrieving data from a transaction

I have a private blockchain using PoA and would like to store data in the data field of a transaction. To my understanding, the data field has a 32-byte limit and needs to be hex encoded. Is this ...
0
votes
0answers
19 views

How to deploy huge contracts using web3?

I have a huge contract (which exceeds the default contract code size set in Quorum). I have increased the Code size and Transaction size in the Genesis file to 128Mb. The contract works well when ...
0
votes
0answers
12 views

loadScript returns undefined

I am using Ubuntu 20.04 for creating a private ethereum blockchain using geth. I am required to load the "Simple.abi" script present inside home/contract. But when I give the file-path in the ...
0
votes
1answer
28 views

How do we access a contract that was deployed by another contract in Truffle?

I am trying to figure out how do we access Contract2's instance in Truffle's test if it was deployed by Contract1 in Truffle Develop? Can't seem to find a question that described my issue exactly so ...
1
vote
0answers
12 views

Why doesn't the ENS public resolver support IP address resolution?

I wondered if there are any well-considered reasons behind the decision to not support a standardized record for IP addresses (e.g. A/AAAA records by IETF) through the public resolver and the offical ...
0
votes
1answer
15 views

Enforcing a limit on ERC721 tokens held by an account

We are providing a Gnosis multisig wallets to our users and a market place where users can purchase/sell/transfer ERC721 tokens with other users. The ERC721 contract will also have a Blacklist ...
4
votes
1answer
112 views

Underhanded Solidity: Exploiting multiple inheritance

In an article by Steve Marx (on Medium.com), the author argues against using inheritance in solidity not only because of harder readability of a Smart Contract, but also because it can be exploited in ...
0
votes
0answers
31 views

How do I inject Web3 into Remix IDE?

when going on to the remix IDE, i get the error No injected Web3 provider found. Make sure your provider (e.g. MetaMask) is active and running (when recently activated you may have to reload the page)...
1
vote
1answer
11 views

Why does using {value: 1} in a test results in an exception with no text?

I'm completely new to smart contracts in Etherum. Using Remix I created a small contract that does nothing except require msg.value == 1: pragma solidity >=0.4.22 <0.7.0; contract Danny { ...
1
vote
0answers
28 views

go-ethereum: Return data from contract function

I have a smart contract written in solidity. I deployed the contract to my Ganache network and I can interact with it via go-ethereum using stubs generated by abigen. My function returns a uint256, ...
0
votes
0answers
21 views

Kovan transaction never being mined

I have setup an Infura account to send transactions on the kovan network. This is the code I want to use to send ether to another account (current one has 1 ether from a faucet): var Web3 = require('...
0
votes
2answers
22 views

How to create a contract address to automatically send tokens to ETH address [closed]

How to create a contract address to automatically send tokens to ETH address and also how can I also be able to get the ETH from the contract address to my ETH wallet (I am the contract creator) ...
0
votes
1answer
28 views

problem help me gas * price + value

I've seen many topics, but I've yet not solved my problem. Please, help me! var EthereumTx=require('ethereumjs-tx').Transaction const Web3=require('web3') const web3 = new Web3('https://rinkeby....
3
votes
0answers
34 views

Unit testing a Solidity Library function with a struct memory argument

I am trying to unit test a Solidity Library contract function using truffle and web3. My simplified Library contract looks like this: pragma solidity >=0.5.16; pragma experimental ABIEncoderV2; ...
1
vote
1answer
17 views

transfer hash verification on contract side

I want to verify if message-hash has a particular contract method. Like below web3 code generates a rawTransaction having,messageHash,v, r, s, rawTransaction let rawTransaction = { 'from': ...
1
vote
1answer
31 views

Drizzle cacheSend outputs “cacheSend is not a function” error, but the tx works when using send

I'm using Drizzle and react-hooks in my new open source project, but cacheSend outputs always "cacheSend is not a function" This line of code with send works as expected const stackId = contract....
1
vote
0answers
12 views

Are transactions with too high nonce propagated to other nodes from local pool by parity?

I want to understand what happens with tx when I create tx with too high nonce. It's saved in a local queue, but do other nodes get the information about this tx? I don't know, can I remove tx from ...
2
votes
1answer
26 views

Destroy smart contract and collect its funds

I'm quite new at smart contracts/Solidity, which I'm learning for a postgraduate course. In one of the assignments, we have to implement a short example of dutch auction (wiki link). Now my question ...
0
votes
0answers
4 views

org.web3j 4.5.18 ethGetBalance get stuck

I'm using the following simple code in order to obtain the wallet balance: Credentials credentials = Credentials.create(privateKey); web3.ethGetBalance(credentials.getAddress(), ...
0
votes
1answer
20 views

why is there no software downloadable wallet for ETH?

There is bitcoin core wallet..which you download on your computer and you have 100% full ownership of your bitcoin BUT etheruem NEVER has anything like this..most of the wallets are either on a ...
0
votes
1answer
14 views

Smart contract function not returning expected output

I'm quite new at this and I'm learning both Solidity, Javascript and React to play around with smart contracts. My contract ran well in Remix and in a local test net. I ran a bunch of tests using ...
1
vote
1answer
18 views

How to deploy smart contract so that average user can interact with its public functions?

I sucesfully wrote and deployed smart contract using Remix and Metask to generate hashes used as keys. This contract has few payable public functions that set or get some numbers. After deploying ...
0
votes
0answers
14 views

How to make my contract balance as private in Ethereum?

Suppose there are two contracts, A and B. Obviously, balance of A is public and B can read it with address_of_A.balance. Is there a way to make balance of A as a private data and B can't read it with ...
1
vote
0answers
7 views

Where does the line blur between a task and a script in Buidler?

This is a question about Buidler, the task runner that facilitates building on Ethereum. From Writing scripts with Buidler: You can write your custom scripts that can use all of Buidler's ...
0
votes
0answers
11 views

Remix IDE not showing return value

Using the following code as an example: // SPDX-License-Identifier: MIT pragma solidity ^0.5.0; contract SimpleStorage { event StorageSet(string _message); uint256 public storedData; ...
0
votes
1answer
6 views

Calling payable function from contract with parameters

How do I call this function from my contract and send ether to it? abstract contract MainAcceptedOffers { function accept(uint _acceptance, address payable _casher) public payable virtual; } ...
-1
votes
0answers
7 views

Can't find my Weth?

So recently i had a look on ETHplorer just for fun, and noticed I have about 0.8 Weth in my wallet address however whenever i try to find/retrieve it, i keep coming up on a dead end.. I checked the ...
0
votes
1answer
19 views

How to initialize address[] array with values

Is there any shorter way to do the following? address[] memory myArray = new address[](2); myArray[0] = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; myArray[1] = ...
-1
votes
1answer
13 views

Trying to compile running: 'node compile.js', but get error: “assert.js:399 throw err;” [Udemy 'Complete Developers Guide' Course]

This is my hands on contract with this Udemy Course - Ethereum-and-solidity-the-complete-developers-guide This is the contract file, which contains two contracts - Campaign and FactoryCampaign. I ...
0
votes
1answer
14 views

How to run slashing detectors in Ethereum 2.0?

"A validator client will likely store tens or hundreds of MB of historical votes to prevent slashings." (Source) Do beacon nodes or validator clients automatically run slashing detectors? If not, ...
0
votes
1answer
29 views

Getting undefined for the length of the dynamic array

I'm getting undefined for the length of multiSig dynimic array, or votes in testing, no matter how many items are pushed into the array. FlightSuretyData.sol address[] multiSig = new address[](0);...
-3
votes
0answers
10 views

How to create SELF eth transactions [duplicate]

I'M ABDUR RAHMAN Can you help me! HOW to create a SELF Ethereum transactions. This address you can see it here https://etherscan.io/address/0xbbF3316f2Fa21d9e0A8a07F5047F37A467f01a5B
1
vote
0answers
18 views

Are there well-solved patterns and practices for handling errors in Solidity?

The approach I'm taking with this question is similar to Are there well-solved and simple storage patterns for Solidity?. Are there any known, battle-tested practices for how to deal with errors in ...
0
votes
0answers
14 views

Data location must be “calldata” for parameter in external function,

I'm getting the following error: Data location must be "calldata" for parameter in external function, but "memory" was given. for the following function: function _registerAirline(address ...
0
votes
0answers
10 views

importing a big standard contract

I am following a tutorial to use oracle from Provable, so I have to import "https://github.com/provable-things/ethereum-api/blob/master/provableAPI_0.6.sol". I notice that the contract is very big but ...
1
vote
0answers
28 views

What is the maximum size of ABI in real world contracts?

To monitor my contracts during development and test in a private blockchain I’ve written an event explorer that encodes beside other parameter the ABI in an URL parameter. The ABI will be compressed ...
0
votes
0answers
9 views

Transaction to contract from web3 not working but working from metamask

I have a method in contract to increase totalSupply and only owner can call it. function addTokenToTotalSupply(uint _value) onlyOwner public { require(_value > 0); balances[owner] = ...
0
votes
0answers
10 views

can sign derived wallet transactions with main's wallet private key of seed phrase?

I would like to sign a transaction from a wallet which is derived from a seed, and sign it, with it's parent first address and private key derived from the seed, can I sign any tx of any derived ...
0
votes
1answer
17 views

How to delete an element of array in efficient manner?

pragma solidity ^0.4.24; contract test{ uint[] public array = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; function removewithgap(uint index) returns(uint[]) { if (index >= array.length) ...
0
votes
1answer
13 views

How to reverse byte order in uint256 or bytes32?

Need to convert BigEndian to LittleEndian or vice versa.

15 30 50 per page