Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
24 views

Returning an array of inner structs of a struct

How can I return an array of child structs of a parent struct? as an example: After pushing multiple chapters into the parent struct, how can I retrieve all the child structs as an array (or ...
0
votes
0answers
21 views

Block-chain data retrieval

I'm using a testrpc to test my sensor contract, where many account get to submit data to the block-chain whether using an html client side application or using the smart contract is self. How can I ...
0
votes
1answer
171 views

Cannot install remix-ide locally

How to install remix-ide npm module? I follow the instructions, but it does not install. npm install remix-ide -g ... make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] ...
1
vote
1answer
64 views

No matching declaration found after argument-dependent lookup in remix IDE

I'm getting this error in remix: "TypeError: No matching declaration found after argument-dependent lookup. require(_spender.call.value(msg.value)(_data)); ^-----^ " function approveAndCall(...
1
vote
2answers
116 views

Remix: 0x0 Transaction mined but execution failed due to construction

I have the following example smart contract, where I cannot deploy using remix into my private network using environment Web3 provider. The error I am getting is Transaction mined but execution failed ...
0
votes
3answers
151 views

How to deploy Library contract separate from the main contract and link it

For deployment I am using remix. When I deploy Hello.sol the compiler typically merges SafeMath.sol as a part of the main contract (Hello.sol) and deploys. This adds up library and main contract's ...
0
votes
0answers
25 views

How does remix decode a contract response without the ABI?

Remix seems to be able to decode the output of a contract to a block of JSON without having the ABI (say I just specify the contract address). How is this achieved - I'm interested in doing something ...
0
votes
2answers
70 views

Calling function with one parameter in Solidity

I am trying to call a function with one parameter I have used these methods all didn't work: //z=addmul(total); //this.addmul(total); This is the function created: function addmul(uint256 a, uint256 ...
2
votes
1answer
63 views

Cannot deploy contract in new Remix layout

I cannot get a contract to deploy in the new layout but when I go back to the old format it works fine. The deployment parameters are as follows: and here is the error that I get: However, when I go ...
0
votes
1answer
52 views

Solidity returns “ParserError: Expected primary expression” on my code below, can anyone help?

pragma solidity ^0.5.8; //Change the contract name to your token name contract JONJonnywon { // Name your custom token string public constant name = "JONNYWON"; // Name your custom token ...
1
vote
1answer
28 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
0
votes
1answer
22 views

error in ico token and ico contract

function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); Blockquote fallback typos error ...
1
vote
1answer
36 views

How can I send ether [duplicate]

Hey guys I am a beginer on Solidity. I write a function and try to send ether on remix accounts and check balances this accounts. But I can't connect accounts I think because when I check balance of ...
0
votes
1answer
33 views

CRUD storage pattern Infinite gas error when trying to implement in Remix

I'm trying to implement @robhitchens CRUD storage pattern in solidity, and I'm getting infinate gas costs when I import the library. Not sure where to go from here. one of them: Gas requirement of ...
0
votes
2answers
33 views

Solidity code sequence for owner

How can I make my code sequential, meaning I'd like functions to be performed in a certain order. Can I make a function not run able till another is run. An example would be great help.
0
votes
2answers
143 views

Unused function parameter. Remove or comment out the variable name to silence this warning

I have a smart contact which have 2 owner address and 3 functions. my set functions is set a users with msg.sender and my getUser functions is returns name,surname and age and I want to add a admin ...
0
votes
1answer
118 views

Member “name” not found or not visible after argument-dependent lookup in string storage ref

I have code like this and I want to set my name, surname and age in my struct so I want to set them and get them using with my functions here's my code : pragma solidity >=0.4.0 <0.7.0; ...
0
votes
3answers
226 views

ParserError: Expected ',' but got identifier

pragma solidity >=0.4.0 <0.7.0; contract NewHello{ struct kullanicilar{ string name; string surname; uint age; } event infoChanged( string name, ...
1
vote
1answer
103 views

How to pass struct params in remix ide?

I have this smart contract: pragma solidity 0.5; pragma experimental ABIEncoderV2; contract TestStruct { struct User { string name; uint256 age; } mapping (bytes32 =&...
1
vote
0answers
31 views

Gas usage difference between Remix and Ganache/public networks

I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use. Remix ("Enable Optimization" checked): 90,410 ...
1
vote
0answers
19 views

Remix online editor - set tab width

The tab width on remix https://remix.ethereum.org defaults to 4 spaces. I have looked everywhere but I cannot see how to change it to 2 spaces, or 3 or whatever. Is it possible? nb: don't care what ...
2
votes
1answer
84 views

How to format the code in Remix IDE?

Is there a way to format/beautify the code in the Remix IDE?
0
votes
1answer
46 views

Using uint array as an argument in Solidity function

I am trying to compile following on Remix IDE: pragma solidity ^0.5.1; contract testArray{ address addr; function testA(uint _addr, uint[] emp) public{ addr = _addr; for(uint ...
0
votes
1answer
84 views

Getting Error:VM Exception while processing transaction: revert', 'code': -32000. when deploying to Ganache using Web3.py

I get the following error message: Getting Error:VM Exception while processing transaction: revert', 'code': -32000 I am connected to Ganache. Here is my code: import json from web3 import Web3 ...
0
votes
1answer
60 views

My Withdraw function doesnt work

I'm writing my first contract and my withdraw function doesnt work. Eth doesnt move to my _withdrawAddr. Also can somebody explain why my function getBalanceThis returns 0 instead of amount I send to ...
0
votes
1answer
14 views

Contracts interaction issue

I got stuck in making two contracts interact. The code for two contracts is as follows: Test1.sol pragma solidity ^0.5.8; contract Test1 { struct Car { string carCreationDate; ...
0
votes
1answer
118 views

Parity POA Smart Contract Method Always Fails

I have set up a private POA Network according to the tutorial from the parity homepage. I have two nodes running on localhost:8540 and localhost:8541. I have connected MetaMask to my first node and am ...
1
vote
1answer
35 views

Gas requirement of function “testCompile.showString() high: infinite”

I have written simple function in remix. pragma solidity ^0.5.0; contract testCompile{ string myString = "Hello World"; function showString() public view returns (string memory){...
0
votes
2answers
34 views

Save all customers who buy an item online [closed]

I am writing a contract where I am trying to save the account addresses of customers who buy an item online. I tried it with arrays but it did not work. Can anyone please suggest a way of doing this?
0
votes
1answer
22 views

Function to transfer tokens to a second address with fixed percentage

I'm trying to code a transfer function that automatically sends tokens to a second address taking a specific percentage from the original sent value. What I wrote: address public _ExtAddress; ...
0
votes
0answers
33 views

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

A simple contract for addition, an error is reported when calling the function add in Web3 provider mode: "Gas estimation errored with the following message (see below). The transaction execution ...
0
votes
1answer
21 views

Problem understanding the owner assignment

Suppose I have 3 contracts, namely Owner, B and C: contract Owned { address public owner; constructor() public { owner = msg.sender; } modifier onlyOwner { require(...
0
votes
2answers
38 views

use the caller of the wrapper function to call the inner function

Suppose, I have 2 contracts A and B: contract A{ function someMethod() public{ // Something happens here } } And contract B containing its instance and its wrapper function ...
0
votes
1answer
49 views

what does external means ? how can i call the test2() inside my class

pragma solidity ^0.5.7; contract Test { function test() public view returns (uint){ return 10*10; } function test2() external view returns (uint){ ...
1
vote
0answers
21 views

Why after managing to deploy contract to POA Ethereum blockchain I can't interact with it? [duplicate]

We are using a private ETH proof of authority blockchain. In order to deploy a contract I'm using 0 gas price and it deployed immediately. Then, Tried to deploy many types of contracts with ...
1
vote
2answers
37 views

Is it possible to connect to public Ethereum like blockchain with Remix to deploy and view contracts?

I've tried to do so by specifying the web3 provider and the 8584 port but it gets stuck on every try. Is this possible? if so, is there another solution for that need?
1
vote
1answer
112 views

web3 - Contract deployment has been reverted by the EVM

I want to deploy a contract but my transaction gets reverted. This only happens with Web3, while it works fine with Remix.I can assure the ABI and Bytecode are correct because I pasted them from Remix,...
1
vote
1answer
69 views

Newbie. Getting cannot read property 'abi' of undefined when trying to deploy on Ubuntu

let abi = compiled.contracts.example.PartyTime.abi; This is the line of code that is causing the error. I copied the abi code from Remix into an abi.json file. But it doesn't seem to be reading it ...
1
vote
1answer
19 views

Error in Declaring a Sized Array: Generating no gas Exception

I have created a fixed size array: pragma solidity ^0.5.1; contract Underflow1 { uint8 arr[256]; uint8 i= 0; function testf2() public returns (uint8){ for(i=0; i<arr.length; ++i);...
3
votes
1answer
89 views

Compilation error using SafeMath

I am trying to do subtraction operation using the SafeMath library. The following is my code: pragma solidity ^0.5.1; library SafeMath { function sub(uint256 a, uint256 b) internal pure returns (...
0
votes
1answer
77 views

Deploy contract to Parity dev chain using Remix

I'm trying to deploy a contract via remix to my local development chain. However, the transaction never gets mined and is pending forever. When I use a node script it works (at least I receive the ...
1
vote
0answers
66 views

delegatecall (assembly) didn't change state variable in Remix with Web3 Provider

I am trying to test proxy pattern in Remix, which connected to my private chain with Web3 Provider. By the way, miner is working all the time. After invoking add function of Proxy contract, the state ...
1
vote
1answer
97 views

How to measure size of stored data in the blockchain?

I know that remix can measure the execution cost and transaction cost. I want to measure the storage overhead ( Size of data in Bytes) on creating a contract on the etherum blockchain or calling a ...
0
votes
1answer
37 views

Compilation Error: Error: Expected identifier but got '(' msg.sender.transfer(uint(amount));

I am compiling the following code on solc & remix ide: pragma solidity ^0.5.1; contract Signed1 { uint val= 0; function withdrawOnce(int amount) public returns (uint){ ...
0
votes
3answers
80 views

condition check of struct mapping in solidity?

struct User { string username; string password; address userid; bool isAdmin; } mapping (uint => User) users; function checkIfUserExists(address userid) public ...
0
votes
1answer
37 views

What is the meaning of “0”: “uint8 255”?

In the console, I am getting: Decoded output { “0”: “uint8: 255” } and in the return value I am getting: 0: 0x00000000000000000000000000000000000000000000000000000000000000ff What the above ...
0
votes
1answer
37 views

Remix Compiler Not Displaying Underflow

I can't see underflow happening in latest Remix compiler. I have used the following code: pragma solidity ^0.5.1; contract test { event testV(uint indexed value1); uint val= 0; ...
0
votes
1answer
35 views

Gas estimation failed when using web3 provider testrpc

Gas estimation failed error while invoking a simple function pragma solidity ^0.5.9; contract sample{ uint number; function setNumber(uint _number) public{ number = _number; } ...
0
votes
2answers
74 views

how to write backend for contract if you use infura ropsten metamask and remix

i'm using metamask with ropsten. deployed my contract on ropsten using remix. for the backend i used infura to create instance of web3. ew Web3(new Web3.providers.HttpProvider('https://ropsten.infura....
1
vote
1answer
75 views

ERC721: Interface ID Registration

Why we need to register Interface ID in ERC721 token. I was just going through the openzeppelin-solidity erc721 code and curious to know that why we need to use this. That interface id register code ...