Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

create ERC-20 token from a contract function

I would like to do a function create contract with ERC-20 interface. But I have a few problems. If anyone help me I’ll be appreciated. Here’s the code : pragma solidity ^0.5.0; library SafeMath {...
0
votes
1answer
17 views

create contract from function / contract

**Hey guys ! I just try to make a contract for create a contract. It supposed to be ERC-20 interface so my first contract for this. But I don’t know how can I do _mint and createContract functions ...
1
vote
1answer
16 views

Assert.equals() weird behavior does not recognize (apparently) equal strings

I'm facing problems related to string comparison using Assert.equals() provided by remix_tests.sol. I made a toy contract and a related test to show what the problem is: https://gist.github.com/...
0
votes
0answers
12 views

address.call(abi.encodeWithSignature(“func(<param>)”, _params) doesnot work

contract C1 { uint public num; address public sender; function callSetNum(address c2, uint256 _num) public { (bool res,) = c2.call(abi.encodeWithSignature("setNum(uint256)",_num)); ...
0
votes
1answer
41 views

Why is my calculation broken?

I have a smart contract that holds a token balance, let's call it Token A, users may send this smart contract Token B to receive Token A, they do so by specifying the amount of Token A they would like ...
1
vote
0answers
20 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
21 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
18 views

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

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
2answers
41 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 ...
0
votes
1answer
19 views

Data Structure Design Choice [on hold]

What data structure design should I use in following scenario: I want to be able to add soccer players to a registry/list along with their goals count. Now, I should be able to: 1) increase their ...
1
vote
2answers
19 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
36 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
23 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
34 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
23 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
33 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
18 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
0answers
25 views

solidity-Please help me understand this Smart Contract. Transferring money between adresses in solidity [closed]

Hi guys so I have found this code online of a goods and service type contract, where f.e. a digital asset is created and each time that asset is used by someone, beneficiers involved in the "creation" ...
0
votes
1answer
18 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
40 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
59 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
67 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
13 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
47 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
30 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
29 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
17 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
20 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
29 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
25 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
35 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
20 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
73 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
26 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
25 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
25 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
19 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
36 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
28 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
10 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
31 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
28 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
18 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 ...