Stack Exchange Network

Stack Exchange network consists of 174 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.

34
votes
8answers
17k 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 ...
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 ...
19
votes
2answers
14k 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 ...
33
votes
6answers
27k 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 ...
18
votes
2answers
9k 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 ...
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 ...
6
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 ...
23
votes
3answers
4k views

What is the difference between transaction cost and execution cost in browser solidity?

What is the difference between transaction cost and execution cost as seen after contract instantiation in browser solidity? I don't think it matters, but here is my contract: contract ...
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, ...
5
votes
1answer
318 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 ...
0
votes
2answers
341 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 ...
6
votes
1answer
1k 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 ...
12
votes
1answer
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 ...
6
votes
3answers
3k 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 ...
6
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 ...
5
votes
5answers
3k 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' ...
3
votes
3answers
3k views

Where solidity files are stored in Remix IDE

No need to elaborate too much. I'm working with some contracts on the browser IDE and I want to make sure they are properly stored. I can access them every time I connect with my laptop but I wonder ...
3
votes
1answer
998 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(...
8
votes
1answer
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.
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
527 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 ...
1
vote
1answer
382 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 ...
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 ...
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
4answers
3k 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 ...
2
votes
0answers
628 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 ...
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 ...
1
vote
2answers
427 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
71 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
2k 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
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 ...
1
vote
1answer
398 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 ...
0
votes
0answers
46 views

Withdraw funds if is Not funding Goal Reached?

Will it be possible to Withdraw funds if is NOT fundingGoalReached a using this code ? function ownerSafeWithdrawal() external onlyOwner { uint balanceToSend = address(this).balance; ...
0
votes
1answer
221 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
0answers
37 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
959 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
1answer
1k 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'...
26
votes
2answers
18k 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; ...
9
votes
1answer
2k 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, ...
3
votes
1answer
4k views

“Hello, World” smart contract using browser solidity

Can any one provide end to end example "Hello, World" smart contract using browser solidity
5
votes
2answers
5k 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

Is it possible to interact with a deployed contract (not mine) with Remix Solidity IDE?

I know that I can call methods or send transactions with web3.js. But, is it possible to interact with a deployed contract (not mine), like golem, status, etc.. with Remix Solidity IDE?
9
votes
3answers
8k 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
1answer
1k 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) { ...
5
votes
1answer
599 views

Compile contracts that call each other

I have two contracts, one is a Admin, other is subject. To keep things simple I am just including the functions that are invoked in the contracts relating to each other. contract Subject { uint ...
5
votes
1answer
6k 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?
5
votes
1answer
1k views

How to get the bytecode of a transaction using the solidity-browser?

I want to get the bytecode to put in the "MyEtherWallet/Send-Ether" when I want to make some transaction, sending some ether to some contract, to call some function in the contract. I need to use the "...
5
votes
1answer
3k views

Solidity/Web3.js Cannot send value to non-payable constructor

I have a simple contract that I built a small webapplication with. The contract is as follows: contract MyContract { address public creator; function MyContract() { creator = msg....