Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [remix]

Questions about Remix, an online browser compiler for Solidity, formerly called Browser Solidity.

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

TypeError: Function overload clash during conversion to external types for arguments

Why do I get following error "TypeError: Function overload clash during conversion to external types for arguments." when using compiler version ^0.5.0; but when I choose 0.5.2; and later releases ...
0
votes
0answers
31 views

Deploying contract using web3js but failed

I am a beginner for solidity 👶 My question about deploy using with web3js. I have two smart contract and in main contract I have a createContract function which is create a new subtoken contract ...
0
votes
1answer
25 views

Web3.js is taking lot of time to return a promise

Web3 is taking time near about 5 minutes even after the transaction got 3 confirmations to return a promise from a smart contract which is deployed on kovan testnet. Please give some suggestion how to ...
0
votes
0answers
28 views

Undefined Contract

I am finally able to come up with a compilable code. As I attempt to verify the contract, the Remix - Ethereum output is "undefined". Someone advice me on what to do. My ABI is as follows: [ { "...
1
vote
2answers
51 views

Cannot install web3 on nodejs

When I try to install web3 using 'npm install ethereum/web3.js --save' command, I get the following error messages- npm ERR! path git npm ERR! code ENOENT npm ERR! errno ENOENT npm ERR! syscall ...
0
votes
1answer
17 views

Get array of structs by giving address as parameter

Here's my code: contract company { struct contractDetails { string contractId; string companyA; string companyB; address A; address B; uint256 ...
0
votes
1answer
76 views

I would like to 3 mappings

I am a beginner. I would like to 3 mappings I know 2 mapping looks like this: mapping (address => mapping (address => uint256)) public allowed; and my question is: is 3 mappings look like ...
1
vote
0answers
29 views

I am newbie here,I need some help in retrieving one particular use using a userid, how do we do that as per below code?

struct Rider{ //address riderAddr; uint rider_Id; bytes32 Rname; bool set; } mapping(address => Rider) public riders; function registerRider(address _riderAddr, uint _riderId, ...
0
votes
2answers
33 views

ParserError: Expected pragma

Hi guys. I have got one big problem. When i try to compile my code i'm getting some kind of unusuall error. I think everything is ok but when i try to "node compile.js" my main file ("inbox.sol") ...
0
votes
1answer
34 views

Function should return all objects stored in the mapping array

Here's my solidity code. And I want all the objects to be returned stored in mapping array contracts in the getContract method by giving address as a parameter to the getContract function. pragma ...
0
votes
2answers
85 views

Remix Deploy Error encoding arguments

I'm building a simple fund raising smart contract and having problems deploying this through Remix. I'm wanting to set the "goal" and "minimum contribution" values (in wei) during the contract ...
0
votes
2answers
44 views

ParserError: Expected pragma, import directive or contract /interface/library definition

In an attempt to compile my ABI and verify my contract, I am getting the following warning: "ParserError: Expected pragma, import directive or contract /interface/library definition" on the first line ...
0
votes
0answers
40 views

Transactions go to an older contract address rather than the present deployed one

Though I have deployed a new contract but the transactions go to a previously deployed contract in my application. I'm attaching the screenshot of my Remix-ide code and the code for the front end ...
0
votes
1answer
33 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 ...
4
votes
3answers
154 views

Remix now force to use https, how can i continue to use http://remix.ethereum.org?

Recently I was able to both use http://remix.ethereum.org or https://remix.ethereum.org, but today I was not able to direct by browser to the unsecure version of remix. The reason I need to do so is ...
0
votes
1answer
47 views

What I need to verify contract with open-source license?

i m deployed contract in etherscan mainnet. i m verify it with open-source license like (MIT, GNU). now the problem were i don't know were to define license in etherscan ?? and etherscan will validate ...
1
vote
1answer
54 views

Web3 - Assign nonce to smart contract transact

I have a smart contract. I want to execute one of its state modifying functions. This is the code: const result = await smartContractObject.methods .addSomething(_valueToAdd) .send( { gas: '...
1
vote
2answers
43 views

“Gas estimation failed” on Ropsten with Invalid RPC JSON

I'm running into an issue going through a basic example in "Mastering Ethereum"... I have a Faucet contract (on Ropsten) per the book that looks like... pragma solidity ^0.5.1; //mastering ethereum ...
2
votes
2answers
49 views

Web3 - Access return value of events

I want to get the value that my smart contract returns in javascript. Here is the contract. (version 0.4.25 - web3 version 1.2) pragma solidity ^0.4.25; contract SimpleStorage { uint public ...
1
vote
0answers
38 views

Error: Operator << not compatible with types bytes1 and int_const 1 return b10 << 1;

I don't know how to correct the code of function 4 & 5. pragma solidity ^0.4.4; contract C { bytes1 b10 = 0x6c;// l-> 0110 1100 6c转换为10进制-》12*16^0+6*16^1=108 bytes1 b11 = 0x69; ...
0
votes
1answer
22 views

Call to other contract method return false when two parameters are passed

Caller Contract Called.call(abi.encodeWithSignature("test(address, address)"),empAddress, empContAddress) Called Contract event ad(address); function test(address e, address f)public{ ...
0
votes
0answers
36 views

Error: Member “transfer” not found or not visible after argument-dependent lookup in address 0.4.4 [duplicate]

pragma solidity ^0.4.4; contract PayableWorld { function deposite () payable{ address dyw2 = 0x1De57DD112092D60F45c9e2045424003e6B2C75a; dyw2.transfer(msg.value); } how can i change the ...
0
votes
1answer
33 views

Parser Error On Remix Solidity ERC20 Smart Contract Token

This Is My First ERC20 Smart Contract Token. I Am Trying To Compile It Using Solidity 0.5.0. Plz Need Your Help Guys. pragma solidity ^0.5.0; contract TusharCoin { uint256 public totalSupply; ...
0
votes
1answer
41 views

How can I store multiple strings mapped to an address in Smart Contract (solidity)?

I want to save multiple files in Ipfs and store its hashes mapped to an user address. I thought of having an array mapped to address and pushing to it, but does not seem to be the right approach. ...
0
votes
1answer
63 views

ERC20 - Approve & TransferFrom not working

The getTokenBalance function seems to retrieve data from the ERC20 contract just fine so I don't think there is an issue with how I'm using the interface. Additionally, I also tested out separating ...
0
votes
0answers
35 views

Solidity Contract cost calcuation

How can I calculate the cost of running my contract and running each function? I've noticed in Ethereum when a transaction is successful we have a transaction cost and a execution cost, what the ...
0
votes
0answers
9 views

DigixDAO smart contract functionality/pattern

Can someone explain the usage of initialisation functionality and _resolver arguments in the various constructors of digixdao? i.e. following contract What is a resolver and isn't the job of a ...
0
votes
1answer
29 views

Getting information from contract address?

pragma solidity ^0.5.0; import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol'; contract SubToken{ using SafeMath for uint; struct token{ ...
0
votes
1answer
12 views

interface function declarations to be used internally

Is it possible to use externally declared interface functions internally in a smart contract? i.e. say contract A inherits interface A, would contract A be able to implement the functions from ...
0
votes
1answer
98 views

Is it possible to insert some custom data in the DATA field of an Ethereum Transaction?

i am working on trying to get some data encoded/inserted into an ethereum transaction. Let me describe my environment first, i am using Web3py, Ganache and Remix IDE. I am able to successfully ...
-3
votes
2answers
52 views

Trying to create an instance of an abstract contract

pragma solidity ^0.5.0; import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol'; contract SubToken{ mapping(address => uint) balances; ...
0
votes
1answer
31 views

Inheritance and contract creation

If I modularise a contract into two contracts, and inherit one of them instead using a monolithic approach, will the deployment costs be larger with two contracts or is the cost the same as with the ...
0
votes
0answers
22 views

Contract Design Patterns | Should I use some sort of factory pattern?

I have 3 structs which are nested into each other i.e. struct A <- struct B <-- struct C All 3 structs belong to their own contracts (contract A, contract B, contract C) and each contract has ...
0
votes
0answers
10 views

when to create a library contract

when should one consider creating library instead of a contract? Would it make sense to create a library if all it does is calculations or reporting read values?
0
votes
1answer
34 views

Solidity Events

I'm using Solidity events to interact with my html page, once a change is done in the contract or page the watch function from html reflects back to the contract. My question here is, while checking ...
0
votes
0answers
31 views

Best Practices Of Building A DAO Contract Structure Tree

When building a DAO of interconnected smart contracts on Ethereum, what is the best way to organise the contract structure? More specifically, are there any particular design pattern(s) like MVC in ...
3
votes
1answer
56 views

approve-transferfrom pattern between contracts

What is the general process-flow of approving contract a to spend tokens on behalf of contract b and how would a sufficient function implementation look like which successfully achieves this? For ...
3
votes
2answers
74 views

Setting Remix default Compiler Version

Is it possible to set the default Compiler version in Remix? Each time I open Remix, the compiler defaults to version 0.5.0+commit.1d4f565a. However, there is currently up to version 0.5.10 available ...
4
votes
1answer
31 views

Invalid implicit conversion from bytes calldata to bytes storage pointer requested

The code below produces an error: code: function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external { _safeTransferFrom(...
1
vote
1answer
163 views

Solidity and Web3js codes are not working inside the private Ethereum(geth) network but same codes are working in public ethereum

geth version : 1.9.0-stable-52f24617, node version : v10.16.3, npm version : 6.9.0, web3 version : -- web3@1.0.0-beta.36. genesis.json: { "config": { "chainId": 9663080, "homesteadBlock": 0, "...
3
votes
1answer
41 views

Why solidity's keccak returns different value from online generators?

I try to implement my own little modifited commit&reveal voting. I have problem with revael phase. Reveal metod signature look like: function reveal(bytes32[] memory _reveals, bytes32[] memory ...
0
votes
0answers
22 views

Interface restrictions

Why are interfaces restricted to enums, events, structs and functions? Why are they restricted from containing state variable declarations if they can contain structs?
0
votes
0answers
13 views

when to use byte32 -> string conversion in events, functions etc

When is it a good practice to use string conversion from bytes32? i.e. in events, functions and similar. What does doing so bring in terms of cons to gas costs?
2
votes
0answers
33 views

deploying Solidity contract in Remix

I am trying to deploy Solidity contract in Remix for my study purpose. However, I failed to deploy SmartMesh contract in Remix (below, I attach the link for the code): https://etherscan.io/address/...
2
votes
0answers
21 views

Name Styling Best Practices Internal/External variables/functions etc

The solidity docs clearly specify how to style function order, types etc. However, are there an appropriate way to also separate between internal/external variables, functions etc. I see some people ...
0
votes
2answers
26 views

Fetching stored values for use in function logic

Are there any benefits from fetching stored data into other functions by calling a function to call a private variable, instead of calling the private variable directly? What is best practices? ...
0
votes
1answer
17 views

DeclarationError: Identifier already declared. when writing in solidity

DeclarationError: Identifier already declared near function pragma solidity ^0.5.1; contract Timestamp{ uint start; uint end; function start() public{ start = block.timestamp; } ...
0
votes
0answers
27 views

Create lots of hashes with ID

I have this code to create hash. function getUniqueHash(address _hashunique) public view returns (address) { bytes20 b = bytes20(keccak256(msg.sender, block.timestamp)); uint ...
0
votes
1answer
40 views

I can't execute transaction from Dapp: Nounce too low

I'am trying to use go-ethereum on my local network: I have configured a 5-node quorum network on my local machine and I'am building Dapp. I created smart contract and generated go bindings. When I ...
0
votes
1answer
45 views

create ERC-20 token from a contract function

I would like to do a function create contract with ERC-20 interface. But I have a few problems. If anyone help me I’ll be appreciated. Here’s the code : pragma solidity ^0.5.0; import 'https://...