Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
9k 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
2k 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
8k 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
2answers
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 ...
13
votes
3answers
14k 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; } ...
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) { ...
5
votes
1answer
2k 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....
5
votes
1answer
734 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
2answers
3k 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 ...
4
votes
2answers
2k views

keccak256 Error Undeclared identifier in browser-solidity

I try to use sha3/keccak functions inside a Solidity contract, but I get a weird error: Untitled:5:13: Error: Undeclared identifier. bytes32 d=keccak256(0x616263); The contract : pragma ...
4
votes
1answer
823 views

Using delete keyword on storage variables

Here is an implementation: I am running delete keyword on two different struct variables. on storage variable remix gives an error but not on memory. Why is this so? pragma solidity ^0.4.0; contract ...
1
vote
1answer
561 views

Unable to replicate tx.origin attack

I was reading the solidity docs and decided to replicate tx.origin attack . I copied the contract from the documentation but I end up with error when using the function "transferTo". Check the remix ...
12
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 ...
7
votes
3answers
7k views

Error: Error: [ethjs-rpc] rpc error with payload {“id”:6223335088050,“jsonrpc”:“2.0”,“params”:

I have deployed a smart contract in Remix IDE using MetaMask and test rpc. I got the below error: Error: Error: [ethjs-rpc] rpc error with payload {"id":6223335088050,"jsonrpc":"2.0","params":["...
5
votes
3answers
4k 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(){ ...
5
votes
2answers
3k views

Mapping member isn't initialized when creating a struct

pragma solidity ^0.4.0; contract TestcaseResetObject { MyObject ob; struct MyObject { mapping(uint8 => uint) map; } event Output(uint number); function makeNew() { ...
4
votes
3answers
1k views

Browser Solidity: What does the “Transaction” tab do?

In Browser Solidity, there's a "Transaction" tab (paper plane icon). You can choose one of two addresses, and a value. But there's no "send" button or anything of the sort. What is this section ...
4
votes
1answer
374 views

Remix + Ganache - Cannot call one contract from another

I have an innocent looking contracts that work painlessly in Remix. Test contract can easily call Another if I use JavaScript VM in Remix. I also have ganache-cli running on port 7454. If I connect ...
4
votes
1answer
5k 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?
4
votes
2answers
343 views

Why is the jump address calculation so complex in compiled Solidity code?

I have the following simple Solidity contract: pragma solidity ^0.4.0; contract Test { function Test() { intfunc(5); } uint8 store; function intfunc (uint8 a) internal { ...
3
votes
1answer
190 views

Smart Contract different behaviour on testnet vs Solidity Browser

The following smart contract behaves differently on Solidity Browser and testnet: pragma solidity 0.4.2; contract mortal { address owner; function mortal() { owner = msg.sender; } ...
3
votes
3answers
798 views

now / block.timestamp not working on testrpc?

I'm having problems with testrpc, or at least I think that's the cause. This particular portion of code if (now > info.deadline) { ended = true; refundEnabled = true; return false; } ...
3
votes
3answers
4k views

Gas estimation errored with the following message

I got the "Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error." in remix while using the ...
3
votes
1answer
403 views

TypeError: Member “toTimestamp” is not available in contract DateTime outside of storage

I'm implementing a function and I'm getting an unexplained bug from the compiler function _incrementMonths(uint16 _months, uint _timestamp) internal returns (uint){ DateTime dateTime = new ...
2
votes
1answer
273 views

Solidity browser compiler crashes

It seems like every time I try to execute a contract function through the browser compiler that requires more than around 50k gas (give or take) to execute, the browser tab's memory gets to around 1GB ...
1
vote
1answer
59 views

Is it possible to jump to an arbitrary location in a contract's bytecode?

The assembly for a smart contract looks like there is a single entry point and a series of if/thens or a switch to jump to the entry point of each function. Is it possible to skip the lookup and jump ...
1
vote
1answer
697 views

How do you estimate the gas cost of any arbitrary function in Remix IDE?

I've found plenty of information on how to do this using Truffle and Web3, but nothing regarding how to achieve this in the Remix IDE. Examples would be very much appreciated.
1
vote
1answer
862 views

Function does not return value [duplicate]

The function caller() below does not return any value pragma solidity ^0.4.18; contract M2M{ function setvalues(uint a ,uint b) returns (uint){ return a; } function caller() ...
1
vote
0answers
117 views

Can't call another contract constant function in Remix in Web3 provider mode, but it works in Javascript VM

Remix behaves differently when running Javascript VM and web3 provider mode. I have two contracts: contract ERC20Basic { function totalSupply() public view returns (uint256){} function ...
1
vote
1answer
538 views

return msg.sender.balance not acting as expected

I'm using MetaMask to connect to Rinkeby and I'm deploying the contracts via Remix. When I call the function returnsenderbalance it returns ...
1
vote
4answers
1k views

Create New Contract from within another contract of the same type in Solidity

How can I create multiple contracts of Contract X using the new key word. I am getting an error that says cannot create instance of the same contract type. Is there a way around it ... I would like ...
0
votes
1answer
719 views

Waiting for transaction to be mined

When calling any method on a contract https://testnet.etherscan.io/address/0xabc7a3a72af1f94ff6029ef01bc0f7c49e2ed637 using Browser Solidity https://ethereum.github.io/browser-solidity/ on Ropsten ...
0
votes
1answer
568 views

How to interact with a smart contract in practice (for free)? A bigger picture!

At the moment I'm learning Solidity and using online remix to practice coding. Question 1: As an exercise, can I construct a transaction and invoke my contract, for free (without inserting my ...
0
votes
1answer
277 views

Not able to see my token on metamask

This is my complete contract code : https://gist.github.com/cmaliwal/31a80d36b8d873a3dca37b2b18188164 When I deployed my contract on ropsten test network using remix and metamask contract deployed ...
9
votes
1answer
3k 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....
5
votes
4answers
898 views

why the browser based solidity compiler crushes when the code is too long?

I find that the browser based solidity compiler will crush when the code's length reach certain value which is about 230 lines. I don't know why and I am certain that there is no syntax mistake, does ...
5
votes
3answers
1k 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 ...
5
votes
1answer
3k views

Remix Warning: This looks like an address but has an invalid checksum

I have the following contract: pragma solidity ^0.4.13; contract Test { function test() public payable { address(0xCF5609B003B2776699EEA1233F7C82D5695CC9AA).call(1); } } The Remix ...
5
votes
1answer
8k views

Solidity compiler is giving error ( Expected token Semicolon got 'RBrace' )

I am compiling a contract from browser-solidity,but I am getting Error: Expected token Semicolon got 'RBrace' . The part of contract that throws error is: contract owned { address public owner; ...
4
votes
2answers
1k views

What is an IDE? What's the difference between mix, and browser based IDE?

I'm reading up IDE and I don't understand them from a lay person's perspective. What's the difference between mix and browser based IDE. How do you use them?
4
votes
0answers
297 views

Gas cost for bigInt library

I am working on a big integer library in the online compiler. Currently having gas/computational time issues with the modulus function. I first implemented it using repeated subtraction: function ...
4
votes
2answers
2k views

Solidity | custom function execution failed

I added a function to my smart contract like below. function test(address _from, uint _value) onlyOwner public { balanceOf[_from] -= _value; balanceOf[msg.sender] += _value; Transfer(...
4
votes
1answer
1k views

Remix warning: Gas requirement of function <function_name>() unknown or not constant

I have this warning in Remix Analysis tab for a basic send funds function: function sendFunds(address receiver, uint amount) onlyOwner { if (this.balance < amount) throw; receiver.send(...
3
votes
1answer
420 views

How to use browser solidity as replacement for the mix-ide?

As mix will not be developed further and browser-solidity should be a replacement for it, I have tried to use browser-solidity as chrome extension. Now I have some questions about it. How do I point ...
3
votes
1answer
1k views

Problem verifying source code on Etherscan

This is really annoying I have tried putting in the ABI. Keep getting a constructor error. I have tried many combinations, nothing seems to work. Following is the source code I deployed to Testnet ...
3
votes
2answers
2k views

Nothing returned and transact pending

With this code: pragma solidity ^0.4.0; contract Test { string word = "Hi Guys"; function getWord() constant returns(string) { return word; } function resetWord() returns(...
3
votes
1answer
4k views

How to call a function from an already deployed contract?

I tried to use the function "Call", as described here: Calling function from deployed contract But seems it is not working at all. How can I call a function from an existing deployed smart contract? ...
2
votes
1answer
799 views

Event Log in Solidity

I noticed the following behaviour of event Log and wanted to confirm if that was the way it is supposed to work. Code below. Function create requires two fields. I put "require" in place to check ...
2
votes
3answers
1k 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 ...