Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [remix]

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

36
votes
6answers
31k views

How do you get a json file (ABI) from a known contract address?

I want to watch a Solidity contract using the Mist browser. I know how to do that and it needs the address and the json. I have the address, but I don't have the json. I do have the source code. Can ...
34
votes
8answers
19k views

How to quickly test a Solidity function?

There are snippets and functions of Solidity code provided on this Ethereum Stack Exchange and other sites. What are ways to quickly test them, possibly debug a little, and play around?
28
votes
2answers
22k views

Remix warnings - state mutability and public visibility

I noticed the new Remix gave me two new warnings: browser/Untitled.sol:6:5: Warning: No visibility specified. Defaulting to "public". function setFee(uint _fee){ ^ Spanning multiple lines. ...
25
votes
3answers
5k views

What is the difference between transaction cost and execution cost in remix?

What is the difference between transaction cost and execution cost as seen after contract instantiation in remix? I don't think it matters, but here is my contract: contract DepositCounter { ...
25
votes
2answers
21k views

How does Mapping in solidity work?

I went through the Crowdfunding example in solidity where i encountered the following: contract Crowdfunding { struct CampaignData { address recipient; uint contributed; uint goal; ...
19
votes
2answers
11k views

How to pass arbitrary bytes to a function in Remix

According to this question I could write a simple contract like: contract SimpleStorage { bytes input; function setInput(bytes enterBytes){ input = enterBytes; } } Using "0x1234" as a ...
18
votes
2answers
15k views

How to estimate gas at contract creation/deployment to private ethereum blockchain

What I have done a) When I use web3.eth.estimateGas to estimate the cost of a contract creation constructor with no parameters, the estimate is correct. b) If the contract is already deployed then ...
15
votes
2answers
4k views

Should the constructor function be public?

In all the tutorials I'm watching nobody specifies public, but remix presents warnings that function visibility has not been specified, and public is assumed. Since I don't like warnings if possible,...
14
votes
2answers
2k views

Etherscan: How can I verify a contract with multiple imports deployed with Truffle?

When I deploy a contract with Truffle that has an import statement, and try to verify it on etherscan, my understanding is that I need to paste in the contents of the imported file. I get an error on ...
11
votes
5answers
13k views

Invalid JSON RPC response: “” In Browser-Solidity

I'd like to connect private geth node from browser-solidity, however it returned the error Invalid JSON RPC response: "". Please check the following picture for details. Could you tell me how to ...
11
votes
1answer
6k views

Is an Account in MetaMask the same as an Ethereum Account (EOA)?

First, my setup: I use the Azure Ethereum Consortium Template, which creates one transaction node and two mining nodes in my configuration. I use MetaMask Chrome plugin to accept transactions, which I ...
10
votes
3answers
5k views

Why do `throw` and `revert()` create different bytecodes?

throw and revert() are both compiling to the revert operation (opcode 0xfd). According to the docs: The throw keyword can also be used as an alternative to revert(). Why is it then that the ...
10
votes
4answers
4k views

How to Compile and Deploy a Smart Contract without running a full node?

I'm new to solidity and smart contract programming. I have already made and deploy smart contracts successfully, but always using Mist. Now I'm not able to do so, because I can't complete a node ...
10
votes
1answer
727 views

What determines transaction costs (Remix)?

I've reviewed several related SE questions on this topic and I haven't seen an answer. In Remix, I've created two separate .sol files. The files are names file1.sol and file2.sol. The code for the two ...
10
votes
2answers
2k views

Solidity Browser - Issue with every example => Error: Type “address” not supported for state variable

I am very new to blockchain and Ethereum. I want to get started with a BaaS cloud service and develop / execute some smart contracts. I successfully set up the Azure Ethereum template (https://github....
10
votes
4answers
10k views

Solidity/Remix Error : The constructor should be payable if you send value. How to solve this?

pragma solidity ^0.4.16; contract MyToken { // This creates an array with all balances mapping (address => uint256) public balanceOf; // Initializes contract with initial supply tokens to ...
9
votes
3answers
7k views

Solidity error when encoding arguments to query public mapping

While developing a Smart Contract with Solidity on Remix , after creating the contract I'm trying to query a public mapping: mapping (address => uint256) public balanceOf; but when I call ...
9
votes
1answer
3k views

How to whitelist up to 50k addresses in a single contract?

What is the best practice in whitelisting a large amount of addresses in a contract. For example, if I wanted to include 50k addresses into a mapping that will reflect true for only the 50k addresses, ...
9
votes
1answer
2k views

How to link libraries in browser-solidity? [duplicate]

How to link library in browser-solidity? While creating a contract using library, solidity compiler requires to link the contract with the library. But there is no options in the browser to provide it....
9
votes
5answers
5k views

This contract does not implement all functions and thus cannot be published

On Remix, when implementing the contract suggested here - https://www.youtube.com/watch?v=JHrQ3l2tT78 - I'm getting the error "This contract does not implement all functions and thus cannot be ...
9
votes
1answer
2k views

VM Exception: invalid JUMP when I call a second function

I'm experimenting with Solidity Browser Here is my contract code: contract Test { mapping (address => uint256) weismap; function bet(uint vote) payable returns (uint256 weis) { ...
8
votes
3answers
3k views

Warning: Using contract member “balance” inherited from the address type is deprecated

browser/ballot.sol:61:13: Warning: Using contract member "balance" inherited from the address type is deprecated. Convert the contract to "address" type to access the member. require(this.balance &...
8
votes
3answers
4k views

Is it possible to include all the openzeppelin library files on Remix?

I am trying out Remix as an IDE. However, I'm using the excellent open-zeppelin library for development. Is there any way to include all the files from open-zeppelin in the build path for Remix ...
8
votes
2answers
3k views

Where to find contract ABI in new version of online remix solidity compiler?

After the online remix solidity compiler recently changed design, I can't figure out where I can find the contract's ABI? Does anyone know where it can be found in the new version? Or any other way ...
8
votes
2answers
4k views

How to get the contract ABI in new Remix IDE?

Waked up today just to find out the remix browser interface changed to this what happened !!? I cannot find the contract details to get the json interface anymore.
8
votes
1answer
388 views

What is the cryptic part at the end of a solidity contract bytecode?

Given the following contract: pragma solidity ^0.4.11; contract Simple { bytes32 public v; function set(bytes32 _v) { v = _v; } } When disassembling, neither remix, solc or evm ...
8
votes
1answer
989 views

Using the “Publish” button of Solidity Online Compiler

I've been using browser-solidity to test out my contract online. Usually I click "create" and then I can call all of my functions to test them. However, I clicked the "publish" button, and I got a ...
7
votes
1answer
2k views

Is there any profit from using pure and view functions modifiers?

I have a function that does not read or modify contract's state: contract C { function add(uint a, uint b) public returns (uint) { uint res = a + b; return res; } } Does it ...
7
votes
1answer
7k views

TypeError: Data location must be “storage” or “memory” for parameter in function, but none was given

/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param ...
7
votes
1answer
1k views

How to debug contract in browser-solidity

contract users{ struct User{ uint id; string str; } User [] public adds; function del(){ delete adds; } function delElem(uint i){ delete adds[i]; } function add(uint id,string cc){ ...
7
votes
2answers
1k views

Why does solidity compiled bytecode not match data for creating transaction?

I'm trying to independently verify the source code of solidity contracts, and stumbled across a case where the compiled bytecode for the source code of the contract does not match the data of the ...
6
votes
5answers
12k views

TypeError: Data location must be “memory” for parameter in function, but none was given

I have created the contract below using the online IDE Remix. the smart contract was fine until late last night when i got the following error for all functions(targeting the string data types ...
6
votes
1answer
8k views

Debugging Ethereum Contract by printing the values

Is there a way that I can print the intermediate result on a console or some log file in order to debug my contract?
6
votes
1answer
1k views

Any reason not to use Browser Solidity's “Enable Optimization”?

I found that when I had "Enable optimization" activated while writing a very simple contract with browser Solidity, it reduced a total of two SSTORE opcodes to one. That resulted in 5000 gas saved. ...
6
votes
2answers
2k views

How to fill dynamic in-memory array

For some reason solidity doesn't allow to push values into memory array Member "push" is not available in bytes32[] memory outside of storage. Here is sample contract code: pragma solidity ^0.4....
6
votes
2answers
2k views

This contract does not implement all functions and thus cannot be created

I followed the tutorial found here: https://steemit.com/ethereum/@maxnachamkin/how-to-create-your-own-ethereum-token-in-an-hour-erc20-verified I tried to create this contract using Remix. I had to ...
6
votes
1answer
1k views

this.balance VS address(this).balance

What is the difference between this.balance VS address(this).balance in solidity contracts?
6
votes
3answers
7k views

Smart Contract Error: Returned values aren't valid, did it run Out of Gas?

Deployed a contract using Remix IDE to Rinkeby testnet. Etherscan contract address and code is here. contract SimpleCounter { int counter; constructor() public { counter = 0; } ...
6
votes
1answer
2k views

Sending value with transaction using Metamask and Browser-Solidity

Using browser-solidity in combination with metamask I am testing a new contract on testnet https://testnet.etherscan.io/address/0xc03db39c18b6056f8c3a3a5495a1e11f3ff8885a but when trying to call ...
6
votes
1answer
2k views

How can I deploy a contract with reference to a library contract without using a graphical user interface like Browser Solidity?

I am using Solidity Browser to deploy a contract due to from Library contract method failing #2831 issue. On this following answer https://ethereum.stackexchange.com/a/9181/4575 I have guided to use ...
6
votes
2answers
2k views

Returning structs in new version in Solidity

I have been reading about Solidity release version 0.4.17. https://github.com/ethereum/solidity/releases One of the following statements was really interesting: We also worked further on the new ...
6
votes
2answers
818 views

Getting error message from require()

I know that the latest Solidity supports error messages in require/revert (require(stuff, "problem")). Are there any clients that can get this message? Will I be able to see it if I execute the ...
6
votes
1answer
488 views

Compiler Issue or Improper State Variable declaration?

After seeing some unexpected compiler results, I've reduced the issue to this tiny example: The following compiles under 0.4.10 in Remix: contract StorageMapping { struct S { mapping(...
6
votes
1answer
539 views

Why is this a potential violation of Checks-Effects-Interaction pattern?

That's what Remix is telling me. Now when I look at the documentation as to what this means it seems to be talking about, as I understand it, recursively entering a control flow (if): Ether ...
6
votes
1answer
132 views

Contract Greeter - Windows - Browser solidity

I am currently trying my first contract on Ethereum but I never imagined that it would be so difficult... I followed the guide here : https://medium.com/ziggify/blockchain-stack-1-installing-...
6
votes
1answer
289 views

difference between button [publish] and [create] ? (Remix tool)

sorry,just ask a simple question... what is difference between button [publish] and [create] ? (on Remix Tool UI) thanks a lot~ hippo
6
votes
2answers
657 views

TestRPC and Metamask: hanging on pending transactions

I'm using Remix and connecting to Testrpc via Metamask. I can successfully launch contracts to testrpc, but then it hangs on the subsequent calls that Remix makes to the public methods (Remix says "9 ...
5
votes
2answers
2k views

Convert bytes32 to bytes

Is there a simple way to convert bytes32 to bytes in Solidity? I'm trying to get the length of the string passed in the bytes32 variable but everything gets returned 32 size which makes sense. But ...
5
votes
5answers
4k views

How can I use testrpc as the environment in Remix?

I've installed ethereumjs-testrpc and I'm running it with testrpc in my terminal, which I'm pretty sure is working because it outputs Listening on localhost:8545 after listing all the test accounts' ...
5
votes
2answers
3k views

Getting infinite gas estimates for simple functions

I am testing out solidity in remix ide using simple contracts. This is the contract that I wrote: contract mortal { address owner; function mortal() { owner = msg.sender; } function kill(){ ...