Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
39
votes
8answers
20k 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?
4
votes
2answers
3k views

Remix Warning - No visibility specified, Violate Checks-Effects-Interaction pattern, Function state mutability can be restricted to pure - Can ignore?

Two months ago, I wrote a smart contract with Remix.ethereum.org. Line 1 of my code has: pragma solidity ^0.4.11; It compiled fine with no errors and nor warnings. I tested every function in ...
11
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 ...
19
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 ...
21
votes
2answers
12k 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 ...
38
votes
6answers
34k 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 ...
11
votes
5answers
14k 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 ...
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 ...
8
votes
1answer
423 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 ...
28
votes
3answers
6k 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 { ...
0
votes
1answer
2k views

Airdropping ERC20 Tokens to multiple addresses in a single transaction

done , wrong question. better to use this contract ERC20 { function transfer(address _recipient, uint256 _value) public returns (bool success); } contract Airdrop { function drop(ERC20 token, ...
0
votes
2answers
361 views

Why transfer funds breaks contract?

My deployed contract called successfully only by "function invocation" through web3 or Remix. But it always failed when I sending funds to the contract. I thought that only requirement that contract ...
28
votes
2answers
22k 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; ...
11
votes
2answers
9k 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 ...
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 ...
2
votes
2answers
837 views

Issue with New version of Metamask: Remix cannot detect the Metamask address

I have just installed Metamask version: 6.3.1 Now in Remix, the address of my account in metamask is not detected. The account box in remix remains always blank now (see picture below). Note that I ...
8
votes
6answers
16k 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 ...
15
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 ...
5
votes
1answer
2k views

Solidity function gas requirement is infinite

struct userData{ uint val; bool isvalue; string name; } mapping(uint => address) internal users; mapping(address => userData) internal bidirectionalUsers; function addMember(...
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
3answers
4k views

How to execute Smart contracts on a private Blockchain network

I have created a private Blockchain network on my Windows system with one node. I have created accounts and was able to transfer ethers across them. Now I want to deploy smart contracts on this ...
5
votes
1answer
2k views

Solidity Browser Compiler — Error: Assertion failed

Here's the code: contract C { function a(uint x){} } I try to call C.a(1000000000000000000); and get an error: Error encoding arguments: Error: Assertion failed while C.a(100000000); is ...
5
votes
1answer
4k views

How to deploy contract into local running node using solidity browser?

I am running a local ethereum node and I did unlock an account. Now I want to use the solidity browser to deploy that contract, but when I switch to the web3 provider deploy option and I press the ...
8
votes
2answers
5k 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.
6
votes
1answer
516 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(...
4
votes
2answers
4k views

why does new emit event syntax give compiler error

This example returns syntax errors when the emit keyword is used. emit AuctionEnded(highestBidder, highestBid); This is the doc where the example code is. http://solidity.readthedocs.io/en/develop/...
3
votes
1answer
631 views

How to get byte32 similar data and return same index as ethereum wallet in web3.js?

Solidity byte32 return different value in web3, remix browser compiler and ethereum wallet In the contract, I have just added byte32 values and return it but in the web3 api, remix browser compiler ...
2
votes
1answer
725 views

Contract final touches. Problem with CappedCrowdsale

I am finalizing this basic but clean Crowdsale code. However, there is ParserError with "contract Cappedcrowdsale". Why? It does refer to Crowdsale though. Please check if this is a legit Smart ...
2
votes
2answers
2k views

No matching declaration found after argument-dependent lookup

Currently I'm trying to find a solution for this problem TypeError: Member "toTimestamp" is not available in contract DateTime outside of storage , and I decided to take another approach. I'...
1
vote
1answer
542 views

SyntaxError: Source file requires different compiler version

I am trying to compile the following contract on Remix IDE (online): pragma solidity ^0.4.24; contract ProofofExistence{ event ProofCreated( uint256 indexed id, bytes32 documentHash);/...
1
vote
2answers
1k views

Fallback function uses too much gas?

I wrote this contract but Remix complains that it uses too much gas. What am I doing wrong? "Fallback function of contract browser/SplitBalance.sol:SplitBalance requires too much gas (40612). If the ...
7
votes
3answers
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 ...
5
votes
3answers
2k views

A problem with filters and events (web3j/TestRPC). SOS! ;)

Help me, please, with this little simple task! I cannot solve this problem for several days. SOS! ;) I'm trying to write a program for filtering events via web3j. I copied to start (for the test) from ...
4
votes
1answer
2k views

How to load contract from address- remix?

Hi I just found that remix added "Load contract from address" option. So I tried to load contract from address "0x67601d7a7cbbD77368785122c508503f168B1dAa" . You can see this contract is in function ...
2
votes
1answer
1k views

“Error: base fee exceeds gas limit” when using the withdrawal pattern

When I am testing the withdraw() method from "WithdrawalContract" from http://solidity.readthedocs.io/en/develop/common-patterns.html using Remix and testrpc, it reported the following error. Testrpc ...
2
votes
0answers
693 views

What can I do about an “Invalid sender” contract deployment error?

When deploying a smart contract, I get this message: "Error: invalid sender undefined." See details below. Why is this happening? What do I need to do differently? I wrote the smart contract below ...
1
vote
1answer
3k views

storage and memory error

I am trying to execute the following example listed in the documentation using solidity 0.4 pragma solidity ^0.4.0; contract C { uint[] data1; uint[] data2; function appendOne() { ...
1
vote
1answer
1k views

Truffle contract deployment either exceeds block gas limit or out of gas

I've been having the same issue when I was trying to deploy a contract using truffle develop console. The contract is not extremely big but does initiate two other contracts when called a certain ...
1
vote
2answers
645 views

How to communicate with smart contract using python?

I have developed a smart contract on remix IDE and now I want to communicate with it using python. What python libraries can I use ?
1
vote
2answers
237 views

Warning: “throw” is deprecated in favour of “revert()”, “require()” and “assert()”. throw;

my question is if "THROW" is deprecated then what i have to put instead throw in the following solidity code ? // This function creates Tokens function createTokens() payable { if(...
1
vote
1answer
432 views

Metamask address not detected on remix-ide

My Metamask address wont show up on remix-ide either run on localhost and remix.ethereum.org I also have tried it on brave and chrome, none of them show the address. please help me :(
0
votes
0answers
116 views

Save data of variable of smart contract in js

can anyone let me know how to save data of a variable of my smart contract in javascript variable. for example if i have a function in my smart contract and that function returns some value now how do ...
0
votes
1answer
300 views

How do I get the “create” button to display?

I am new to programming in general and solidity in particular. I wish to create a contract on the remix IDE, but can't locate the create button, rather it shows deploy. Here is a screen of the basic ...
0
votes
1answer
1k views

Problem connecting testrpc to remix [duplicate]

Whenever I try to use a Web3 Provider on Remix it says Not possible to connect to the Web3 provider. Make sure the provider is running and a connection is open (via IPC or RPC). I have testrpc ...
0
votes
3answers
1k views

HOW TO AIRDROP TOKENS SUCCESSFULLY

Hi guys quick and simple question.... i have the script for airdropping tokens, all i need is to know what and how to input these value on the drop section of remix script:token,recipient,values. ...
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, ...
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
2answers
998 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 ...
5
votes
2answers
6k views

How to connect remix ide to geth running on localhost?

Previously, according to tutorials, remix IDE had cube icon to connect to geth on localhost. Now the icon is gone and its not clear if the function is still there. Is it possible? How? I take remix ...
2
votes
1answer
2k views

Web3j: “Intrinsic gas too low” error when deploying contract in Ethereum from Java

I am a new to Ethereum and Blockchain, I have been trying execution of Contracts using Metamask and Remix using Chrome browser for sometime. I am trying to deploy the same contract from Java using ...