Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
23 views

Pass hexadecimal literal to contract using web3js

I have a hex literal that I need to pass into a contract using web3, and I'm not sure how to go about formatting it. In solidity, its formatted like so: hex'...
0
votes
1answer
22 views

Adding the delta to a token transfer

Let's say I have 5 contributors to a pool of a smart contract. They all contributed 1 ether. The smart contract lost 2 ether, and now I want to transfer back the remaining 3 ether to the 5 ...
0
votes
1answer
20 views

Expected identifier but got reserved keyword 'reference' Product public reference; ^-------^ [closed]

hello guys I am a beginner. I would like to make a function for create a contract. I found a example on the internet but gives me an error so I dont know what should I do. Anyone can help me ? ...
0
votes
3answers
58 views

Error transferring balance. Runs out of gas

This is probably a simple problem to fix, but it is very frustrating. I am developing in Solidity using Remix 0.5.10. I have a loan contract that collects funds from borrowers. I now want to ...
1
vote
2answers
26 views

Error: gas required exceeds allowance or always failing transaction in Remix using Ropsten network

I am facing this error , My Contract is quite simple pragma solidity ^0.5.0; contract sendEther { address payable sender; function showReceiver() public view returns (address payable) { ...
1
vote
1answer
51 views

Remix - another transaction execution failed

I am trying to reproduce the results on Remix with the smart-contract as written here: https://etherscan.io/address/0xb6ed7644c69416d67b522e20bc294a9a9b405b31#code (for remix, go to http://remix....
0
votes
3answers
25 views

Why are contacts from Remix editor and explorer different after deploying?

I try to deploy my ERC20 token. My steps are: 1) I created a contact with Remix (by some manual) https://gist.github.com/pistol88/a934da7fcaa93a92f4c4de60df56a0cf contract TestToken is ERC20Standard ...
1
vote
2answers
61 views

ecrecover() always returns 0x0000000000000000000000000000000000000000

I'm aware of these posts How do you sign an verify a message in javascript proving you own an Ethereum address? How does one properly use ecrecover to verify Ethereum signatures? I'd like to sign a ...
0
votes
1answer
25 views

Initialising Empty Arrays & Structs In Struct-based Storage Graph Structures?

How do I initialise empty arrays and structs in nested structs data structures? contract NewBook { struct ReviewerData { string name, uint industryXP // ...
1
vote
1answer
38 views

Updating an instance of an already stored struct?

How can I update/change the values of a stored struct instance? as an example: Let's say I've already deployed a chapter with the content written in a particular color. Later it turns out that I ...
0
votes
1answer
17 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
20 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
37 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
44 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
65 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
79 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
19 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
58 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
45 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
32 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
20 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
34 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
24 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
26 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
47 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
32 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
88 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
41 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
26 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
18 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
33 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
24 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
44 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
34 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
11 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
58 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 ...
0
votes
1answer
29 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
32 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
19 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
15 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
19 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
29 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
47 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
19 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
28 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
61 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
47 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
17 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
36 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 (...