Stack Exchange Network

Stack Exchange network consists of 175 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
0answers
19 views

How to accept tokens coming to my contract address and withdraw it on my Owner address in ERC223 token standard smart contract?

I want to withdraw tokens which are coming from different contract addresses, on my Owner address. I am working on ERC223 token standard and solidity version 0.5.1;
0
votes
1answer
33 views

Remix vs Truffle project in VSCode [closed]

I do this post to ask your methodologies and customs when developing smart contracts. Between Remix + Ganache and Truffle Project + Ganache. What is more comfortable for you? Why is one better than ...
1
vote
1answer
78 views

How to import files into remix (ERC721 contract)?

I get this error - Unable to import "undefined": Not Found And this flashes onto the screen - Loading https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/introspection/...
0
votes
0answers
44 views

Running out of Gas while deploying contract via web3.js

// contract is storing ABI var instance = contract.new( "0x12", // bytes32 "0x12", // bytes32 [], // array of addresses 11, // uint 11, // uint "...
0
votes
1answer
35 views

I want to withdraw amount from Receiver Contract's tokenFallback() function in ERC223 how to implement this scenario?

I am using ERC223 standard token transfer contract and receiver contract which includes tokenFallback(). I've transferred tokens from my ERC223 contract to receiver's contract address, now I want to ...
0
votes
1answer
27 views

Who is “from” in case of inheritance in solidity?

I have the following code: // Test.sol pragma solidity ^0.5.2; import "./TestBase.sol"; contract Test is TestBase{ string[] name ; constructor() public payable { name.push("sheep"); ...
1
vote
2answers
79 views

Solidity public variable getter call doesn't return

I have deployed a very basic solidity contract (pragma solidity^0.4.0) to Rinkeby. When I call the getters on my state variables, nothing is returned and I do not understand why. To compile the ...
0
votes
1answer
15 views

Remix IDE: How can I open a file from GitHub repository ID

I want to compile and use a smart contract located in a GitHub repository on a specific branch or compile ID. I did it the same thing in the past but I've always used a URL which prompted the Git ID ...
0
votes
1answer
52 views

Get value by calling a function from External Smart contract

There are 2 smart contract contract A { function abc(string _a) public returns (address) { return new B(_a); } } contract B { function xyz(string _a) { A a = A(contact address); // ...
2
votes
1answer
161 views

What does the assert() indicate here?

Here is code snippet, function transfer(address _to, uint _value, bytes memory _data, string memory _custom_fallback) public returns (bool success) { if(isContract(_to)) { if (balanceOf(...
0
votes
1answer
24 views

How to pass arguments to token smart contract generator?

I'm trying to build a 'token generator' smart contract that accepts 3 arguments to then deploy a new token smart contract with those inputs ('strings' for symbol, name, 'address' for owner). I am a ...
1
vote
4answers
115 views

Is there a way to use constructor function as a fallback, example: "function Mycontract public payable () {}

In other words if I have a contract called "mycontract" and then simply add the same function with the same name "mycontract" as public and payable, will this mean that others can call it? Since I ...
0
votes
1answer
23 views

Remix uploading the wrong contract?

I have a contract called bridgeStacked that uses a library called BytesLib. When I have both loaded into Remix, I compile and deploy bridgeStacked from in Remix. First, I notice that in the log it ...
0
votes
1answer
23 views

Can we pass some verification values from web to solidity contract?

Is there a way we can pass some value checks from web to solidity contract Just for example if we want to make sure, the person who is calling contract function is present on our website and not suing ...
1
vote
0answers
11 views

Error while compiling a function [duplicate]

Below function is showing error while compilation that "stack is too deep, try removing local variables mapping (address => mapping (uint => Exam)) public exams; function getExamQuestion( ...
0
votes
1answer
7 views

Function inside constructor is called from which address?

interface token { function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);} contract CampaignFactory{ token public token_instance; constructor()...
1
vote
0answers
21 views

Solidity v0.5: Data location in return values of function

I am aware that we need to specify data location for returned values in function as of Solidity v0.5. Is this the case for all variable types (I have come across sources that mention it is only for ...
0
votes
1answer
22 views

Deleting a value from address to address mapping in solidity?

mapping(address => address) public userpatient; I want to delete a the key value pair from above map,when the patient is discharged.How can i do it.I saw similar question here but it mentioned '...
0
votes
2answers
41 views

Set and Get of a large amount of data

I created a contract that insert one number (uint) in blockchain with set function but how can i retrieve all numbers inserted? This is my html, i put 1 number in a blockchain and i will see just the ...
0
votes
1answer
24 views

Store different numbers in Blockchain

pragma solidity ^0.4.24; contract Count { uint256 storeddata; function set(uint256 x) public { storeddata = x; } function get() public view returns(uint256) { return ...
0
votes
2answers
30 views

Returning all struct data of msg.sender in solidity

here is my code: contract Notes { struct notes { string id; string content; address owner; bool isCreated; bool isDeleted; uint256 timestamp; } ...
0
votes
1answer
54 views

How to use local reference type storage variable in Solidity 0.5.0

I'm trying to understand value type and reference type concept in Solidity as per new changes. I'm trying understand local reference types with following example. pragma solidity ^0.5.0; contract ...
0
votes
1answer
46 views

Remix error: “Expected token LBrace got 'View' function get() public view returns (uint)”

I have this error during the compiling of the code below on Remix. Someone could help me ? pragma solidity 0.4.4; contract SimpleStorage{ uint storeddata; function set(uint x) ...
1
vote
1answer
112 views

Issue in type conversion : Explicit type conversion not allowed from unit256 to bytes1

I am trying to convert the unit to string using the method. I have the "TypeError" in the line. Please check the screen shot below for the error message. function uint2str(uint i) internal pure ...
0
votes
1answer
82 views

Remix IDE getting VM error invalid opcode

I am attempting to deploy a test contract on javascriptVM using Remix IDE in chrome. However when I try to execute the contract I receive this message in the status section. "transact to Notes....
0
votes
1answer
39 views

Can we add conditiond in constructor?

I want to know, can we add conditional parameters in constructor. Just for example, in constructor if we have UINT for numberOfTimesAllowed = 1; EDIT I am trying to get balance of user msg.sender ...
0
votes
2answers
39 views

Soldity: += not compatible with int type

Trying to run the following code in solidity 0.5.3 with similar compiler in Remix: function deposit() public payable { Maker storage depM = addressToMaker[msg.sender]; depM....
2
votes
1answer
34 views

How to use enums for conditions on constructor?

I am learning to code with solidity. need help to solve this I have a membership system where users can have basic, gold, diamond membership types. Users can use coupons every 5 minutes and for basic ...
0
votes
3answers
32 views

How to check tokenBalance of some other contract in my contract

I am looking to check token balance of some other contract into my own contract to see how many tokens of that contract are owned by my user. Is this possible? If yes how to achieve it? I tried this ...
1
vote
1answer
20 views

How to implemet condition for constructor?

Looking to learn solidity so need your support for this I have made a constructor in my contract where maxAvailableNumber = 1; What I want to do is if the balance of user is more than certail limit ...
1
vote
1answer
28 views

Compile Error in Solidity unable to compile in remix

I am getting the following error. Could you please help me in solving by looking into the code. /////ParserError: Expected pragma, import directive or contract/interface/library definition. function ...
0
votes
1answer
22 views

Getting error on sending ether/wei in payable function

error: transact to CampaignFactory.createCampaign errored: VM error: revert. revert The transaction has been reverted to the initial state. Note: The constructor should be payable if you send value. ...
0
votes
1answer
41 views

How to call a function from deployed contract to another contract?

I created a basic ERC20 token contract and deployed in rinkeby testnet and I got the contract address now I want to call transfer() function from this deployed contract to another contract without ...
-2
votes
1answer
44 views

ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){

browser/Logistics.sol:60:14: ParserError: Expected '(' but got identifier function OrderItem(uint _itemid, string _itemname) public returns(address){ ^-------^ pragma solidity ^0.4....
0
votes
1answer
17 views

Import a contract hosted on a testnet from it's address

I have a smart contract that imports another, and I'm wondering how to deploy them to a testnet. Right now, one contract imports the other locally; import "./firstContract.sol" contract ...
0
votes
1answer
55 views

Getting TypeError: Operator == not compatible with types int_const 1000000000000000000 and address payable

I am trying to use external modifier however I getting error as below code. { require(block.timestamp < start + buyPeriod); require(1 ether == msg.sender);<--- error got here ...
0
votes
0answers
24 views

Remix Gas Error in ERC20 Token Contract

I successfully deployed to ROPSTEN a very simple ERC20 Token Contract - the code for which I copy-pasted from OpenZeppelin's GitHub repo. -I used remix to do this (see screengrab below) -I'm 99.9% ...
0
votes
1answer
16 views

Why this function doesnt need Gas for execution?

pragma solidity ^0.4.17; contract Lottery{ address public manager; address[] public players; function Lottery() public { manager = msg.sender; } function enter() ...
1
vote
1answer
107 views

ParserError: Expected pragma, import directive or contract/interface/library definition

I'm getting this error when trying to compile my code: ParserError: Expected pragma, import directive or contract/interface/library definition. The error is on line 96. pragma solidity >=0.4.22 ...
0
votes
1answer
47 views

DeclarationError: Undeclared identifier. “_value” is not (or not yet) visible at this point

I'm creating an ETH based crypto in Remix and I keep getting the error on line 60: DeclarationError: Undeclared identifier. "_value" is not (or not yet) visible at this point. I'm new to this type ...
1
vote
1answer
57 views

ERC20 Bytecode for Main net

I'm trying to Deploy my ERC20 contract in Ethereum main net, but I'm not sure about the bytecode. I have seen a lot of tutorials but nobody tell something about uploading on main net and bytecode ...
0
votes
1answer
48 views

Getting error : Error encoding arguments: SyntaxError: Unexpected number in JSON at position 47

While developing a Smart Contract with Solidity on Remix, after creating the contract I'm trying to calling function setGrantAddress: mapping (address => uint256) public balanceOf; but when I call ...
0
votes
2answers
86 views

solidity code compilation error?

pragma solidity ^0.5.0; contract Ballot { struct Voter { uint weight; bool voted; uint8 vote; // address delegate; } //modifer modifier onlyOwner () {...
0
votes
3answers
41 views

ABIs and Solidity programming

This is a practical question. I am developing an application in Solidity with Remix. One thing that takes a lot of time is that when I make changes in the code, I then have to compile it in Remix and ...
0
votes
1answer
40 views

Unable to input address[] parameter in remix

I need help for deploy below smart contract on remix IDE. I have facing a problem as I need to input to 'setgrantaddress' as address[], How to input data in it? There is two file name owned.sol and ...
1
vote
1answer
105 views

Remix - Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails). What can be done?

I get the following error when deploying my contract in Remix: Contract creation initialization returns data with length of more than 24576 bytes. The deployment will likely fails. More info: eip-...
0
votes
1answer
38 views

ERC20 Contract - OpenZeppelin - total confusion

Trying to launch a simple ERC20 Token. I'm finding OpenZeppelin's extensive library - where every Contract seems to import about 4 other Contracts - to be both wonderfully well organized - but also ...
0
votes
1answer
34 views

Warning: Unreachable code in for loop in solidity version 0.5.3

As soon as I upgraded the code from solidity version 0.5.2 to 0.5.3, it showing warning in my for loop. Warning: Unreachable code. for(uint256 i=0; i < totalHoldTransactions; i++ ){ ...
4
votes
3answers
56 views

Can a “forward” smart contract forward the received ether to another “forward” smart contract which forwards it to an address?

I am pretty new to solidity. I am trying to create a smart contract which deploys another smart contract and transfers ether to the newly created contract when a payment greater than 0.01 ether is ...