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.

0
votes
1answer
7 views

TypeError: Return argument type bytes32 is not implicitly convertible to expected type (type of first return variable)

I have one issue while deploying the below contract.could anyone help me to find the issue as unable to find issue. pragma solidity >=0.4.22 <0.6.0; contract Lottery{ address payable[] ...
0
votes
0answers
16 views

Working with 0.4.4 version of solidity, still got error, “Member 'transfer' not found or not visible after argument-dependent lookup in address.”

According to some resources, this well known error occur because of versions 0.4.X to 0.5.X change. Previously I compiled contract with ^0.5.1, to solve this error currently I'm using 0.4.4. But ...
0
votes
1answer
220 views

address.transfer(value) is throwing error in solidity contract.

I am building an approval contract in Remix and have been stuck on this issue. When I try to transfer wei using address.transfer(value), it throws an error. I have marked it in the code below. ...
2
votes
3answers
43 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 ...
0
votes
1answer
6 views

Remix IDE : Passing array of address and array of uint

Working on the remix IDE, i cant seem to pass an array of addresses along with an array of uint as parameter to a function. It runs just fine on ethfiddle though and behaves exactly how i expected it ...
1
vote
1answer
449 views

Member “length” not found or not visible after argument-dependent lookup in string memory

I am currently trying to build a simple Process in Solidity, but somehow I get : Error: Member "length" not found or not visible after argument-dependent lookup in string memory for the function ...
0
votes
2answers
14 views

Optimization Exception Remix Editor

I am trying to compile my solidity code in remix editor. I keep getting this error "Optimization exception during compilation". I was using solidity version 0.5.2 till day before yesterday. Now, It is ...
1
vote
3answers
36 views

Warning: Using contract member “balance” inherited from the address type is deprecated. Convert the contract to “address” type to access the member

I have looked at the other posts with similar warning but I do not see how they apply to my context. This is the exact line that is causing the error: players[index].transfer(this.balance); which ...
6
votes
2answers
526 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 ...
1
vote
3answers
199 views

Repetitive validation through Modifier or function

What is the benefits from writing repetitive validation as functions instead of modifiers? The documentation clearly recommendations to use modifiers yet 'best practice' open source parties such as ...
1
vote
1answer
30 views

Return a mapping in a getAll function

pragma solidity ^0.4.24; contract User { mapping(uint=>address) addresses; uint addressRegistryCount; function set(address userAddress) public { addresses[...
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 ...
0
votes
0answers
38 views

How to use mapping with array, struct to store seller's and buyer's data in array? [on hold]

contract Seller { address payable owner; address [] sellerArray; struct Sellers { address sellerAddress; uint parcelId; uint parcelPrice; } contract Buyer is ...
0
votes
1answer
215 views

infinite gas required of simple external function call

I have minimized the following solidity code generated in remix to demonstrate the issue. This code warns the test001.regester function requires infinite gas which obviously by the code cannot be. ...
1
vote
1answer
30 views

In the Remix Web3 Provider IDE, how do you call a function in an ERC20 token contract from another contract without getting an estimateGas error?

I am building a very basic smart contract, 'CheckAllowance', on top of the 'FiatTokenV1' ERC20 token in the Remix Web3 Provider IDE. When I try to check an address's allowance in the 'FiatTokenV1' ...
0
votes
2answers
162 views

Remixd fails to run, cannot find web3-requestmanager

I have installed remixd using NPM. If I run it, it gives me the following error: Error: Cannot find module 'web3-requestManager' at Function.Module._resolveFilename (module.js:555:15) at ...
0
votes
0answers
13 views

Array Compare function returns opcode error [on hold]

VMerror:invalid opcode Solidity code pragma solidity ^0.4.25; contract addition{ uint consensus=0; uint[] x; uint[] y; uint sum =0; uint sum1; uint sum2; uint length1; ...
2
votes
1answer
22 views

Burn the rest of the token after airdrop is complete

I have started to develop blockchain and learn solidity. I tried making a smart contract with the 200M supply, the creator only held 50M of the total supply and the rest was in the smart contract for ...
0
votes
1answer
198 views

using block.blockhash instead of block.timestamp for 30 minutes

I would like to check if the time has passed 30 minutes before executing a function in my contract. I know how it is done using block.timstamp .. But I want to use block.clockhash as it is more secure....
0
votes
1answer
14 views

approve() and sendFrom()

Im trying to run the code below in a smart contract to use as an escrow. calling approve first and calling send from later does nothing to get the tokens into the smart contract, what am I missing ...
0
votes
1answer
166 views

Loading truffle library in remix browser IDE

Besides writing smart contracts in the browser, I would also like to write my test in this IDE. Any suggestions how to load the truffle files in http://remix.ethereum.org? I appreciate your help!
1
vote
1answer
208 views

Remix is compiling the smart contract but not solc command

I am able to successfully compile a smart contract in remix IDE. However when I try to do the same with solc npm command, it shows a JSON error when compiling. Voting.sol pragma solidity ^0.4.25; ...
0
votes
2answers
370 views

Send Transaction failed : invalid address

Trying to execute a transaction on Remix IDE which is connected to the Ethereum blockchain via Metamask.io Google Chrome extension. Send transaction failed: invalid address . if you use an injected ...
4
votes
2answers
101 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 ...
0
votes
1answer
194 views

Stuck at emitting an event in Solidity

I am stuck at Step-6 of Bitdegree's Solidity tutorial. Question is to Emit an event ScoreChanged with two arguments: int amount (equal to the value that was sent) and bool direction (true for up ...
1
vote
2answers
26 views

Solidity code Error

# Solidity Transaction code Error Solidity Code pragma solidity >=0.4.4 <0.6.0; contract PetSharing { //마스터(러브펫) 지갑 struct LovePet { address lovepet; uint ...
0
votes
1answer
18 views

Why does the Warning about Solidity come up?

# Why does the Warning come up? struct Owner { address owner; string ownerName; string petName; uint ownerprice; string petInfo; string petselltext; ...
1
vote
2answers
194 views

My Ethereum Solidity automatically connects to parity, how do I switch it to Metamask?

I want to run on a test network using metamask but Solidity IDE auto connects to my real parity wallet. How can I switch that?
0
votes
1answer
217 views

Is there a way to dynamically create a contract that points to a previous contract?

I would like to implement a tracking system .. where i track events between two parties who deliver an item between them .. then the receiver would deliver it to another person and so on... I would ...
0
votes
1answer
40 views

Transaction fails during smart contract deployment from Remix IDE, while i confirm the transaction from MetaMask

I am able to connect to private ethereum network and able to do the transactions from Metamask, but while deployment of smart contract from remix IDE, it launches MetaMask and i get below error while ...
1
vote
2answers
225 views

Remix always throws the error: exceeds block gas limit

Dear Ethereum developers. I started to learn Solidity this week and am trying to deploy a contract via Remix, but this doesn't really work. Running environment is set as Web3 Provider. (Because the ...
0
votes
2answers
19 views

i am trying to send ether to a list of addresses from backend

Below are few lines from the contract in which I am basically trying to send some ether to an array of addresses. Now, when can run this code in remix solidity by replacing "value" to "msg.value". But ...
0
votes
0answers
20 views

How can I pass struct from one contract to another?

I have two contracts and I'm trying to pass the struct data from one to another, I can do this by creating a mapping and having a uint input associated with that struct but I'd like to get the struct ...
0
votes
1answer
218 views

Simple function triggering infinite gas warning?

When I compile this in Remix (0.4.21+commit.dfe3193c.Emscripten.clang): uint256 public rewardAmount = 40; function adjustReward (uint256 reward) onlyOwner public { rewardAmount = reward; }...
0
votes
1answer
10 views

Struct and Mapping input value error of Invalid Opcode while calling setSeller() to store multiple seller's addresses

What dose the -1 means? Or why we should use -1 while pushing one element in array. What should I enter in sellerAccounts: field as input? pragma solidity ^0.5.1; contract Seller{ struct ...
3
votes
1answer
530 views

Error: Send transaction failed: Invalid address. if you use injected provider, please check it is properly unlocked

I have written my first sample contract. It compiled successfully but when I am trying to run this, it is giving me an error as: Send transaction failed: Invalid address. if you use injected ...
0
votes
1answer
30 views

How to return the struct data

How to return the struct data struct Transaction { address from; address payable to; uint amount; } I am returning like this function transactionDetails() external view returns(...
0
votes
1answer
20 views

How to make transaction of some ether in Buyer Seller type of contract?

In this I have set modifier (msg.sender == sellerAddress) which is not valid. But in this scenario, I want to allow only and only sellerAddress to take ether from my contract. How can I allow only ...
0
votes
2answers
355 views

Getting Invalid sender error while creating contract from remix

I am getting Invalid sender error while creating contact in private network. Though i have kept chainId and networkId are same.
1
vote
1answer
30 views

Remix error :-The constructor should be payable if you send value

Below is the code of the solidity contract :- pragma solidity ^0.4.24; contract Auction { address public owner; uint public startBlock; uint public endBlock; string public ipfsHash; ...
0
votes
0answers
130 views

How to get multiple values in single Oraclize query? without JSON Parsing

I am developing a smart contract. I already made my own Token. so I wanna transfer my Tokens to my friends. But I wanna handle it easily, so I made XML what can be loaded on Internet to use ...
1
vote
1answer
420 views

ParserError: Expected identifier, got 'LParen' function (transfer)(address _to, uint256 _value, bytes _

Any help determining where I'm failing here would be helpful. I believe it has everything to do with my syntax, but am fairly new to DAPP development, but I believe the problem is in this line below. ...
0
votes
1answer
15 views

Whats the best way to find the execution cost of a function

I am interested to analyze the execution cost of the function by considering the best practice to adopt, because of that I used bytes32 rather than String which decrease the execution cost of the ...
7
votes
3answers
3k 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 ...
0
votes
1answer
34 views

Oraclize a restfullAPI using a specific number represented by the variable z for a custom token (remix)

is it possible to pass an integer (in this case 141) represented by the variable z from a certain restfullAPI into the custom token function: balances[msg.sender]? So in the end I want to have my own ...
-1
votes
0answers
47 views

ERC20 Token not appear on approveAndCall function

When I use the function approveAndCall on my Token contract (ropsten) and Metamask is triggered, my token name and value do not appear, only the gas calculation. I have added a custom token to ...
1
vote
1answer
219 views

why does it not work if I don't handle the return value of call/callcode/delegatecall?

This is my Contract code : pragma solidity ^0.4.15; contract D { uint public n; address public sender; event CallStatus(bool); function callSetN(address _e, uint _n) { if (!_e.call.gas(...
6
votes
2answers
1k 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....
0
votes
3answers
32 views

Dynamically create smart contract structure based on user input

I would like to create a smart contract based on user input. User would provide some information/data from the UI, and based on the information provided my smart contract logic would get defined, and ...
2
votes
1answer
426 views

How to get multiple values from one function contract to another

I have two contract and in first contract it contains a function which is responsible for returning two values, one of string and one of integer. function getUserData(address userAddress) public ...