Stack Exchange Network

Stack Exchange network consists of 174 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

Transferring funds from a contract to an account using adresses

I had been trying for a long to transfer the complete fund with one of my contracts to a specific account. But nothing seems to be working. pragma solidity >= 0.4.22; contract reg{ address ...
0
votes
1answer
12 views

TypeError: Return argument type bytes32 is not implicitly convertible to expected type (type of first return variable)

I have one issue while deploying the below contract.could anyone help me to find the issue as unable to find issue. pragma solidity >=0.4.22 <0.6.0; contract Lottery { address payable[] ...
0
votes
0answers
17 views

Working with 0.4.4 version of solidity, still got error, “Member 'transfer' not found or not visible after argument-dependent lookup in address.”

According to some resources, this well known error occur because of versions 0.4.X to 0.5.X change. Previously I compiled contract with ^0.5.1, to solve this error currently I'm using 0.4.4. But ...
0
votes
1answer
6 views

Remix IDE : Passing array of address and array of uint

Working on the remix IDE, i cant seem to pass an array of addresses along with an array of uint as parameter to a function. It runs just fine on ethfiddle though and behaves exactly how i expected it ...
2
votes
3answers
45 views

accepting ether in a smart contract

I want to create a simple smart contract for registration of users to a competition where when users can pay to contract and 2 ethers will deduct from his account. But when I'm trying to do so on my ...
0
votes
2answers
14 views

Optimization Exception Remix Editor

I am trying to compile my solidity code in remix editor. I keep getting this error "Optimization exception during compilation". I was using solidity version 0.5.2 till day before yesterday. Now, It is ...
1
vote
1answer
30 views

Return a mapping in a getAll function

pragma solidity ^0.4.24; contract User { mapping(uint=>address) addresses; uint addressRegistryCount; function set(address userAddress) public { addresses[...
1
vote
1answer
30 views

In the Remix Web3 Provider IDE, how do you call a function in an ERC20 token contract from another contract without getting an estimateGas error?

I am building a very basic smart contract, 'CheckAllowance', on top of the 'FiatTokenV1' ERC20 token in the Remix Web3 Provider IDE. When I try to check an address's allowance in the 'FiatTokenV1' ...
0
votes
0answers
13 views

Array Compare function returns opcode error [on hold]

VMerror:invalid opcode Solidity code pragma solidity ^0.4.25; contract addition{ uint consensus=0; uint[] x; uint[] y; uint sum =0; uint sum1; uint sum2; uint length1; ...
2
votes
1answer
22 views

Burn the rest of the token after airdrop is complete

I have started to develop blockchain and learn solidity. I tried making a smart contract with the 200M supply, the creator only held 50M of the total supply and the rest was in the smart contract for ...
0
votes
1answer
15 views

approve() and sendFrom()

Im trying to run the code below in a smart contract to use as an escrow. calling approve first and calling send from later does nothing to get the tokens into the smart contract, what am I missing ...
0
votes
1answer
18 views

Why does the Warning about Solidity come up?

# Why does the Warning come up? struct Owner { address owner; string ownerName; string petName; uint ownerprice; string petInfo; string petselltext; ...
1
vote
2answers
27 views

Solidity code Error

# Solidity Transaction code Error Solidity Code pragma solidity >=0.4.4 <0.6.0; contract PetSharing { //마스터(러브펫) 지갑 struct LovePet { address lovepet; uint ...
0
votes
0answers
38 views

How to use mapping with array, struct to store seller's and buyer's data in array? [on hold]

contract Seller { address payable owner; address [] sellerArray; struct Sellers { address sellerAddress; uint parcelId; uint parcelPrice; } contract Buyer is ...
0
votes
0answers
21 views

How can I pass struct from one contract to another?

I have two contracts and I'm trying to pass the struct data from one to another, I can do this by creating a mapping and having a uint input associated with that struct but I'd like to get the struct ...
0
votes
1answer
40 views

Transaction fails during smart contract deployment from Remix IDE, while i confirm the transaction from MetaMask

I am able to connect to private ethereum network and able to do the transactions from Metamask, but while deployment of smart contract from remix IDE, it launches MetaMask and i get below error while ...
0
votes
1answer
11 views

Struct and Mapping input value error of Invalid Opcode while calling setSeller() to store multiple seller's addresses

What dose the -1 means? Or why we should use -1 while pushing one element in array. What should I enter in sellerAccounts: field as input? pragma solidity ^0.5.1; contract Seller{ struct ...
0
votes
1answer
30 views

How to return the struct data

How to return the struct data struct Transaction { address from; address payable to; uint amount; } I am returning like this function transactionDetails() external view returns(...
0
votes
2answers
19 views

i am trying to send ether to a list of addresses from backend

Below are few lines from the contract in which I am basically trying to send some ether to an array of addresses. Now, when can run this code in remix solidity by replacing "value" to "msg.value". But ...
0
votes
1answer
20 views

How to make transaction of some ether in Buyer Seller type of contract?

In this I have set modifier (msg.sender == sellerAddress) which is not valid. But in this scenario, I want to allow only and only sellerAddress to take ether from my contract. How can I allow only ...
1
vote
1answer
32 views

Remix error :-The constructor should be payable if you send value

Below is the code of the solidity contract :- pragma solidity ^0.4.24; contract Auction { address public owner; uint public startBlock; uint public endBlock; string public ipfsHash; ...
0
votes
1answer
16 views

Whats the best way to find the execution cost of a function

I am interested to analyze the execution cost of the function by considering the best practice to adopt, because of that I used bytes32 rather than String which decrease the execution cost of the ...
0
votes
1answer
34 views

Oraclize a restfullAPI using a specific number represented by the variable z for a custom token (remix)

is it possible to pass an integer (in this case 141) represented by the variable z from a certain restfullAPI into the custom token function: balances[msg.sender]? So in the end I want to have my own ...
-1
votes
0answers
49 views

ERC20 Token not appear on approveAndCall function

When I use the function approveAndCall on my Token contract (ropsten) and Metamask is triggered, my token name and value do not appear, only the gas calculation. I have added a custom token to ...
0
votes
0answers
9 views

How to run the sample contract Blind Auction?

There is an contract example called Blind Auction, and I try to run this in the Remix compiler. Without any edition, I can deploy it. But every time I tried to run the bid function, error always ...
0
votes
3answers
32 views

Dynamically create smart contract structure based on user input

I would like to create a smart contract based on user input. User would provide some information/data from the UI, and based on the information provided my smart contract logic would get defined, and ...
3
votes
3answers
29 views

Function that returns address if is passed or msg.sender

I'm implementing an ERC721 contract and I want to execute the following logic. This is what I want: If the user pass to a method an address, return that address, if not, return the user's address. I ...
0
votes
1answer
16 views

Gas Estimatation

I am little confuse in the concept of Gas Estimation and price. When i add new user i get popup through metamask for the transaction amount and gas used which is totally fine. I checked my code in ...
-1
votes
1answer
25 views

Problem with the compilation in the truffle framework

I made a smart contract in Remix-Solidity IDE, when I compiled it I had no errors and I was able to remove the contract but when I tried to use the truffle for my Dapp and compiled it it showed me ...
0
votes
2answers
29 views

i am sending to an array of addresses but it is showing error on transfer function

pragma solidity ^0.4.16; contract init { address[] public userAddresses; function addStudent(address _user) public { userAddresses.push(_user); } function sendToken(uint ...
0
votes
1answer
41 views

Why is the totalSupply of this token statically initialized to 5500000000?

contract UnixERC20 is StandardToken { function() { throw; } string public name; uint8 public decimals; string public symbol; string public version = 'H1.0'; ...
0
votes
1answer
22 views

Single Entrance Restriction

Please suggest that how two restric subscriber for single entry means no one can join twice. function selectionW1(address subscribersW1, uint subscriberWheelW1) public { require (...
1
vote
1answer
22 views

Pass arguments to constructor

I got a constructor like this: contract Test{ constructor(uint256 _num) public { num = _num ;} } Now I want to use this contract in another contract. Like this: contract Call{ Test test;...
0
votes
0answers
28 views

Zero balance and double entrance

I am unable to set balance to zero to all of the subscriber except the winner so that winners gets the complete pool prize and other gets zero balance. Also how can I prevent a subcriber for a double ...
0
votes
1answer
25 views

Error while deploying smart contract- This contract does not implement all functions and thus cannot be created

I have written and complied a smart contract written in Solidity for token and crowdsale. Compilation was successful with no errors in Remix IDE. Here is my smart contract pragma solidity ^0.4.25; ...
1
vote
0answers
28 views

What can be the difference between Remix VM, Ganache win, ropsten?

I cannot share the code, but in short something based on a payable fallback in a complicated multi contract application has this behavior: 1) tested in remix using VM: perfect 2) tested in remix on ...
3
votes
1answer
36 views

How to make an array of functions, and how to call it

this: mapping(uint => function()) funcMap; doesn't give any error in Remix. But I don't know how to call it: pragma solidity ^0.5.2; contract b { mapping(uint => function()) funcMap; ...
1
vote
1answer
36 views

Couldn't understand the error message: ParserError: Expected ';' but got '(' Constructor Survey (address _owner) payable public

pragma solidity 0.5.0+; contract Survey { /* Events */ event SurveyInitialized(address indexed owner, uint indexed surveyReward); /* Contract State */ address public owner; ...
1
vote
1answer
28 views

Remix-ide: how to set “runs” for optimizer at a value different from the default 200?

As you may know, the default solc optimizer “runs” value is 200. Apparently remix does not permit to change this value. Has someone any idea of how to change it?
-3
votes
0answers
28 views

Airdrop doesn't deducted from msg.sender. This contracts has bugs, how to fix it?

Total amount supply limit to 10Billions but suddenly the airdrop sending 1E+59 (I Think is over one hundred thousand trillion ) to a airdrop participant. ---Code from comment follows--- contract **...
0
votes
0answers
23 views

How to generate sign to pass to transferPreSigned(), contract is not asking for sign while transfer()

I'm creating ERC865 token so that users can send tokens without having ether. I followed 1 and 2. As per 1, sender will sign transaction object while calling transfer() but I'm unable to see any "...
0
votes
0answers
37 views

Save data of variable of smart contract in js

can anyone let me know how to save data of a variable of my smart contract in javascript variable. for example if i have a function in my smart contract and that function returns some value now how do ...
0
votes
0answers
15 views

Saving data from blockchain in javascript variable [duplicate]

Can anyone please let me know how to save a data from my solidity contract in my javascript variable. For example i have a function in my contract that returns a number now how do i save that ...
1
vote
1answer
31 views

Why am I getting “Trying to create an instance of an abstract contract.” error when I use factory contract pattern?

I have 2 contracts : Registry, Factory. Registry contract is compatible with ERC721 contract like this: pragma solidity ^0.4.24; import "../openzeppelin-solidity/contracts/token/ERC721/...
1
vote
1answer
8 views

Token Transferring issue to the respective winner

My code has a function which randomly select a subscriber from the list and all of the sum of the tokens should transfer to the winner account address. but unfortunately it is not working for me. ...
0
votes
2answers
39 views

Trying to send balance to owner of contract

Code is: pragma solidity ^0.4.16; contract init { address owner; function init() { owner = msg.sender; } function send() public payable{ ...
1
vote
1answer
61 views

Issue in comparing token contract address and address(0) in Solidity 0.5.0

I am trying to compare the token contract address with the address(0). This was working fine in older version of truffle and solidity compiler (0.4.24). When I upgraded truffle and started using the ...
1
vote
1answer
67 views

Call a payable contract's function from another contract via an interface

I have two contracts, they are connected via an interface. When user calls contract1 function, it uses an interface to call contract2 function which updates it's storage. My problem is that I can ...
4
votes
2answers
104 views

Truffle v5 runs out of gas but Truffle v4 deploys the contract

Truffle v4 used to deploy the contract successfully, but Truffle v5 truffle migrate command fails. My process to deploy: 1) delete buidl/ folder 2) truffle compile 3) truffle migrate Truffle v5 ...
0
votes
0answers
12 views

how to get return type of function of a deployed contract in another contract

I have 2 contracts - user and property. A person who is registered on the website through function registeruser in contract user, can only buy or sell a property in contract property. I have a ...