Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
54 votes
8 answers
31k 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?
eth's user avatar
  • 85.4k
4 votes
2 answers
4k 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 ...
Curt's user avatar
  • 307
44 votes
3 answers
15k 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 { ...
Raine Revere's user avatar
  • 3,600
75 votes
7 answers
122k 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 ...
Thomas Jay Rush's user avatar
14 votes
5 answers
6k 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 ...
Moisés Briseño Estrello's user avatar
28 votes
2 answers
28k views

How to pass arbitrary bytes to a function in Remix (2017)

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 ...
floyd's user avatar
  • 589
23 votes
5 answers
28k 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 ...
Imroz's user avatar
  • 871
12 votes
1 answer
8k 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 ...
30mb1's user avatar
  • 369
12 votes
5 answers
18k 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 ...
Toshi's user avatar
  • 2,357
13 votes
2 answers
9k views

Using ".value(...)" is deprecated. Use "{value: ...}" instead

This works fine in Remix but when trying to work in VSCode (for compiling purposes; DApp course, trying to build .json through compile.js ) it throws the error Using ".value(....
utsav pandey's user avatar
9 votes
1 answer
2k 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 ...
lash's user avatar
  • 685
4 votes
1 answer
2k views

Transfer only available for objects of type "address payable", not "address"

I am reading the book Mastering Blockchain Programming With Solidity by Jitendra Chittoda published by Packt Publishing. On page 129 it has a sample contract to deploy using the Remix IDE and MetaMask....
rsrobbins's user avatar
  • 143
10 votes
2 answers
26k views

How can i transfer ERC20 tokens from a contract to an user account?

I have deployed an ERC20 token (contract A) and the tokens are being used for a service in my other contract (Contract B). I can easily transfer tokens from an user owned account(EOA) to Contract B ...
tushalien's user avatar
  • 123
8 votes
1 answer
19k 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 ...
e.k's user avatar
  • 417
7 votes
3 answers
13k 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(){ ...
Ahsan Jamal's user avatar
6 votes
2 answers
11k views

calling one contract to another contract method

I want to call the method getdata() and retrieve the returns value to use in another contract. But the call only returns bool on success or failure. How do I get the return value from ...
Gopal ojha's user avatar
  • 2,259
2 votes
1 answer
3k views

Got scammed using bad code to create front running bot [duplicate]

I got scammed by bad code on a front running bot. I used the code in Remix, deployed it, and then sent money to it. (Put another way, I don't code, had no idea what I was doing, but decided to try it ...
Mighty Mike's user avatar
2 votes
1 answer
3k 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, ...
user avatar
0 votes
2 answers
444 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 ...
Alex G.P.'s user avatar
  • 1,274
33 votes
3 answers
40k 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 ...
CryptoScroller's user avatar
33 votes
3 answers
30k 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; ...
Rahul Sharma's user avatar
  • 1,303
26 votes
4 answers
26k 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....
Alex Zhukovskiy's user avatar
18 votes
3 answers
10k 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 ...
Travis Jacobs's user avatar
17 votes
4 answers
24k views

What is the maximum value an int and uint can store

I need to understand a couple of things: What is the maximum value an int and uint can store? Are the maximum values stored in int and uint the same?
iappmaker's user avatar
  • 813
7 votes
1 answer
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 ...
alper's user avatar
  • 8,375
2 votes
3 answers
5k 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 ...
user153465's user avatar
1 vote
1 answer
1k views

Remix: Invalid parameters: must provide an Ethereum address

I have a contract ready for deployment on REMIX and also have 3 Rinkeby Metamask accounts. Only 1 of these accounts is able to deploy the contract for some reason. When i try the other 2 accounts i ...
kd12345's user avatar
  • 111
28 votes
7 answers
43k 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 ...
Lonwabo Zaula's user avatar
26 votes
6 answers
36k views

What is address(this) in solidity?

As per my understanding contract`s own address is the address which we assign to owner of contract using msg.sender. But I saw this question on SE where it was described that a contract can access its ...
Anam Nizami's user avatar
13 votes
3 answers
24k 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.
Jose Victor's user avatar
12 votes
1 answer
4k views

Gas consumption of a view public function

In my contract I have a view public function that returns an array of bytes32 elements. In remix it produces a warning saying it might run out of block gas limit if I use this function. As I had read ...
kathi's user avatar
  • 189
9 votes
1 answer
15k 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?
anand011090's user avatar
8 votes
3 answers
5k 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 ...
Sivich's user avatar
  • 83
7 votes
2 answers
14k views

TypeError: This type is only supported in the new experimental ABI encoder

I am practicing my Solidity skills and while I did expect to get an error, I did not expect this error TypeError: This type is only supported in the new experimental ABI encoder. Use "pragma ...
Daniel's user avatar
  • 491
6 votes
1 answer
367 views

Public variable getter shows as transaction in Remix

As of Solidity 0.6.0+ compiler, my remix shows getter functions, built by public variables, as transactions and, therefore, do not return the value. I searched the solidity 0.6.0 breaking changes but ...
João Quintanilha's user avatar
6 votes
1 answer
671 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(...
Rob Hitchens's user avatar
6 votes
2 answers
4k 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(...
e.k's user avatar
  • 417
6 votes
3 answers
3k 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 ...
lfrickel's user avatar
5 votes
2 answers
11k 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 ...
Stepan Yakovenko's user avatar
5 votes
3 answers
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 ...
Rahul Sharma's user avatar
  • 1,303
5 votes
1 answer
4k views

Remix IDE: What is the purpose of Calldata and Transact Tab

I am trying to execute the following code on Remix IDE. pragma solidity ^0.5.4; contract GuessTheNumberChallenge { constructor() public payable { require(msg.value == 1 ether); } ...
zak100's user avatar
  • 1,406
5 votes
1 answer
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 ...
manidos's user avatar
  • 4,278
5 votes
1 answer
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 ...
sfrj's user avatar
  • 782
5 votes
4 answers
4k views

Truffle v5 runs out of gas but Truffle v4 deploys the contract

Truffle v4 used to deploy the contract successfully, but Truffle v5 truffle migrate command fails. My process to deploy: 1) delete buidl/ folder 2) truffle compile 3) truffle migrate Truffle v5 ...
Dziugas's user avatar
  • 141
5 votes
2 answers
7k 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'...
Samuel Hawksby-Robinson's user avatar
5 votes
5 answers
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' ...
feihcsim's user avatar
  • 157
4 votes
1 answer
2k views

can anyone explain why call, delegateCall, staticCall functions in solidity are called low level functions?

As i have read at many resources, that these functions are low level functions. I want to know, should i use these methods to interact with already deployed contracts or not ?
Pardeep Thakur's user avatar
4 votes
2 answers
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/...
jlansey's user avatar
  • 163
4 votes
3 answers
5k views

accepting ether in a smart contract

I want to create a simple smart contract for registration of users to a competition where when users can pay to contract and 2 ethers will deduct from his account. But when I'm trying to do so on my ...
Hrishabh's user avatar
3 votes
2 answers
2k 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(...
upracha's user avatar
  • 59

1
2 3 4 5