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
25 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
2answers
28 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
30 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
36 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
19 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
37 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
40 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 ...
0
votes
1answer
38 views

Remix - Pass bytesX to function

Using Remix, I can't pass a set of bytes ["0xee", "0xff", "0xgg", "0xhh", "0xii"] to my function function foo(bytes5 input) { // Do something } I've already tried all these formats: ["0xee", "...
0
votes
1answer
21 views

Load another deployed contract's public values

pragma solidity ^0.4.24; I'm trying to call another contract's functions to return values. I have the below which successfully returns a true/false _childAddress.call(bytes4(keccak256("...
0
votes
3answers
24 views

how to send ether from contract to Ethereum account

I have 100 ether in my smart contract now I want to transfer the ether from contract to account automatically
0
votes
1answer
18 views

“new” Solidity keyword deploying the “Factory” contract again instead of “MyContract”

I have been trying to develop a parent contract that will deploy other contracts on request with different parameters. I came across the "new" keyword which seemed like a perfect choice. But when I ...
0
votes
1answer
25 views

How to display the value of a variable using remix debugger and emit

pragma solidity ^0.5.1; contract test { event test_value(uint256 indexed value1); uint256 value_test; function test_f() public { //value_test processing emit test_value(...
0
votes
2answers
59 views

Public key validation through private key

What is a good way to validate that the public key claimed to belong to a particular user really belongs to him without revealing the associated private key? Can this be done with zero-knowledge ...
0
votes
1answer
19 views

return array is not showing pushed value

This must be silly question but as a new learner i am trying to understand array in solidity and run this code in remix, compiled and deployed the contract on ropsten platform. I want to see the array ...
2
votes
1answer
53 views

how to transfer ether from one account to multiple account

I have 3 account 1st account 1000 ether 2nd account 20 ether 3rd account 30 ether now I want to transfer 100 ether from 1st account to both 2nd and 3rd account
0
votes
1answer
101 views

Transfer all msg.sender.balance to contract, without requiring user to input the msg.value?

Is there a way to drain all the user.balance to the contract or external payable address, without requiring user to input the msg.value? The most intuitive version I had looks a bit like this on ...
0
votes
0answers
39 views

vm exception while processing transaction invalid opcode

I have been running this code in remix but getting error. pragma solidity ^0.5.8; // import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; import "github.com/oraclize/ethereum-api/oraclizeAPI....
1
vote
2answers
47 views

Why do I need to have exact same code to load contract from address in Remix IDE?

I tried to interact with the deployed contract and i don't have its code. so i found out the contract address and tried to load contract from address in Remix IDE! isn't this possible? WHY?
1
vote
0answers
22 views

DeclarationError:Identifier not found or not unique

pragma solidity >=0.4.22 < 0.6.0; pragma experimental ABIEncoderV2; contract BloodDonationProcess { struct LongTermInformation { bool allergies; bool diabetes; bool ...
0
votes
0answers
20 views

DeclarationError: Undeclared Identifier. Did you mean “_data”? data = _data ^__^. All i want is to create a cryptocurrency

pragma solidity ^0.5.1; contract owner { address public owner; function owned() public { owner = msg.sender; } function set( string memory _data) public { data = ...
0
votes
1answer
27 views

3 level ether transfer

contract foster{ vulnerable v = new vulnerable(); attacker a = new attacker(address(v)); constructor() public payable{ // a.deposit(address(v)); // transferring 3 ethers to ...
0
votes
1answer
17 views

Sending the bool to ```function() payable``` in another contract

I am trying to create a pair of contracts, let's say C1 and C2. I want to add an if...else in payable function function() public payable{} of C2, which works on the bool value returned by contract C1, ...
0
votes
1answer
22 views

How to view or transfer initial ethereum smart contract balance?

I created a new smart contract token with initial supply and deployed it via MetaMask. Then I added this token into MetaMask but token balance is Zero. Now, My question is when we create a new ...
0
votes
1answer
38 views

error message ParserError: Expected ',' but got 'memory'

I have this error but I do not know what is wrong? browser/arry.sol:6:58: ParserError: Expected ',' but got 'memory' function addScore(unit24 s) public returens(unit24 []memory){ ...
4
votes
0answers
32 views

String Input of three numbers (comma seperated) doesn't work in Remix

So when I try to put in three numbers as a String in a usual setter-method, it doesn't work. Does anybody know why? function test(string memory x) public view returns(string memory){ return x; }...
0
votes
2answers
35 views

How to handle JSON in a smart contract?

I want to store JSON input in my Smart Contract. Like { "name":"John" } First I thought i could just handle it like a String, but it is not working because of the double quotes. Remix says, that ...
0
votes
1answer
16 views

Parse Error, Expected Pragma on remix

I am new to remix and can't figure out what is wrong with this basic function. pragma solidity ^0.5.1; contract Pie { uint256 public p; } function pie () public returns (uint256) { ...
1
vote
1answer
43 views

How to pass a document as function argument(upload document)

I am working on a project in solidity where I want to generate a SHA256 hash value for the document. So which means when I pass a file to a function the function should return the hash value. can ...
1
vote
1answer
33 views

How to increase the number of test accounts?

I have encountered a problem where I need a large number of test accounts. How can I increase the number of test accounts from 10. Remix and ganache only give 10 accounts. I require more than that.
0
votes
2answers
30 views

Automating user data storage on a blockchain

I have a smart contract that contains a function to store data onto the blockchain. The function stores two integer variables to the blockchain. Now, I can manually store the values from the remix-ide ...
0
votes
2answers
50 views

Remix: This contract does not implement all functions and thus cannot be created

I'm new here and code with openzeppelin framework 2.2.0. There is no error occurred when compiling with solidity 0.5.8. But when I'm going to deploy the contract, I have no bytecode and cannot ...
0
votes
0answers
9 views

ecrecover function in solidity [duplicate]

how to extract sub-bytes r,s from bytes(signature). Is there any function to split the bytes into sub-bytes of desirable length starting from some fixed index?
0
votes
0answers
116 views

How to decode SHA256 hash value and retrieve data in Solidity

I am working on a project in solidity where i am encode a string to SHA256 hash value, and now i want to decode SHA256 hash value and retrieve the actual data. please help hoe to do it. Below is the ...
0
votes
0answers
71 views

Store data on ethereum blockchain from a text file

I have a simple smart contract running over a local Ethereum node. It has two functions: one for sending data and another for retrieving it back. I have a text file and want to send data from it to ...
0
votes
1answer
16 views

Getting error in Deposit function in smart contract : The constructor should be payable if you send value

I am getting the error while deposit the amount in remix. Following is my code pragma solidity ^0.4.19; contract Savings { address owner; uint256 deadline; modifier onlyOwner() { require(...
0
votes
0answers
83 views

How require() and assert() work in solidity?

I'm trying to validate a condition using require(). If the condition is false for the first time, the contract is stopped and reverted to its initial state. On the other hand, if the condition is true ...
0
votes
0answers
46 views

Cannot read property length of undefined in Remix / tried to increase gas not working

My contract was working just fine, but I don't know what happened, now when I try to interact with a new instance of my contract from Remix I get this error 'cannot read property "length" of undefined'...
0
votes
1answer
115 views

How to send struct data as function input on Remix or web3 call?

I've created a function which gets a struct which contains int+struct. Now when I want to test it, what data should I send for example on Remix: here's the code, got from another SO question on - ...
1
vote
1answer
105 views

How to check balance of a smart contract in Remix IDE Javascript VM?

I'm working on a smart contract that can hold some ETH. Currently, I'm unable to see what is its balance in the Remix IDE. I'm trying to use the console: I have access to web3 but how to check the ...
1
vote
0answers
68 views

Etherscan verification bytecodes don't match

Hi I'm trying to verify a token deployed at 0x87ab739464881af0011052d4ca0b0d657e8c3b48 in tx 0xbaa8f3fe86a35d2e0b7ed16b24782743e7dfb1eb21cfbb12253d0a50ef2ff365. (Mainnet) I compiled and deployed it ...
0
votes
1answer
61 views

Not able to connect metamask account with remix

Error: - Cannot get account list: Error: The method personal_listAccounts does not exist/is not available. Pop containing above message appears again and again. Privacy Mode in metamask is disabled....
0
votes
1answer
45 views

Is there an issue using event overloading and event logs that contain arrays?

My event fires, but the last parameter is never logged. It appears as if it doesn't even exist. Here is my solidity code: pragma solidity >=0.5.6; contract EventTest { event marketCreated(...
0
votes
1answer
30 views

Where to store data when creating a blockchain based solution?

I have a question regarding the storage of data when creating a Dapp. For example i create a real estate website on ethereum blockchain where people will buy or sell properties on the basis of tokens ...
0
votes
1answer
14 views

Gas estimation failed when calling the play function

I am trying to deploy this contract on the test network and am able to do so successfully but when i try to call the play function i get gas estimation error and can do nothing further. I am using ...
0
votes
1answer
30 views

Calling a function from another contract is not working. But calling the function from deployed contract is working

I have a problem with calling a function from another contract. I don't know why it is not working. Contract DateTime(https://github.com/pipermerriam/ethereum-datetime) is a util for converting ...
0
votes
2answers
55 views

Solidity event isn't fired

I'm trying to listen for an event I've created on remix IDE , from NodeJS. I call a smart contract method from where the event is triggered and I'm waiting for it in my console...but I don't receive ...
0
votes
1answer
32 views

Getter and Setter Functions in Solidity not showing any output

I have written a smart contract with the Getter and Setter functions but it is not showing any output in IDE-Remix. My code is ''' pragma solidity ^0.4.21; contract GetandSet{ string name; ...
0
votes
1answer
50 views

How do I compile using the nightly build of the Solidity compiler

Using the Remix IDE, I'd like to try out some of the new features of Solidity by using the nightly compiler build, but it's giving me a wrong compiler error. When I try pragma solidity 0.6.0; //......
0
votes
1answer
69 views

Unable to transfer 1 ether

I want to write a function let user deposit 1 eth to a specific address for registering purpose. pragma solidity ^0.5.0; contract Election { mapping(uint => UserRequest) public userRequest; ...
0
votes
0answers
31 views

Gas Limit exeeded (-3200 error) - verifier and Zokrates with Rinkeby

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? gas required exceeds allowance (6995524) or always failing ...