We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
10 views

Many-2-Many ERC721 Pattern?

I'm looking to build a smart contract with a function which is able to generate a unique and limited amount of ERC721 tokens based on an input string. I also want to be able to look up all the tokens ...
0
votes
0answers
15 views

How can I call selfdestruct when it is located in a constructor and not in the ABI of my contract?

I am reading some tutorials and while planning to deploy test contract on ropsten I have something like this: pragma solidity 0.5.1; contract destroy { constructor(address payable receiver) ...
1
vote
1answer
32 views

error in remix IDE

I am facing this type of Error in 'remix IDE' while connecting it to 'web3.js@0.20.2' Error: Failed to decode output: Error: insufficient data for uint256 type (arg="", coderType="uint256", value="...
0
votes
0answers
19 views

GasToken.io free transaction fails above certain 'threshold'

I've played around with the gastoken.io GST2 contract in remix (and on the mainnet) and immediately stumbled across the following problem: If I want to free previously minted token the execution of ...
1
vote
2answers
82 views

Array Costs in Solidity

Why is storing in an array the first time in solidity costs higher than the other times? The other times it has a constant cost which is less than the first time.
0
votes
2answers
20 views

Linking to Compound Smart Contract

I'm still new with the solidity and it seems to be a very basics question. What i'm trying to do is to call the link the compound smart contract with mine. And when i try to compile is complaining : "...
0
votes
1answer
13 views

How to substitute attributes instead of roles in access control coding for solidity?

Say, the role-based access control consists of two roles. But if I want to replace the roles to maybe location and time, how to go about it?
0
votes
3answers
56 views

Gas estimation failed - remix

I am trying to figure out what is wrong with the following code as it does deploy successfully on remix. pragma solidity ^0.5.11; contract MyContract { // Storage address contractOwner; ...
0
votes
1answer
13 views

Data location must be “calldata” for parameter in external function, but none was given

I'm trying to compile my code in Remix and I try to fix it but I keep getting the same error: Data location must be “calldata” for parameter in external function, but none was given". The problem ...
0
votes
2answers
17 views

How to find private keys on Remix ide

I want to sign a message on Remix and I can't find the pair of private/public key. For example - I going to Deploy & Run Transactions, then trying to "Sign a message using this account key" with ...
0
votes
1answer
36 views

Calling contract from contract not working

below are very simple setup of one contract calling another contract and I somehow can't get it to work. Contract C1 pragma solidity ^0.5.0; contract C1 { int public x = 1; function setX(...
0
votes
1answer
28 views

Desired Revert if Condition Is True [on hold]

What is the best way to revert inside a function if a particular condition is true? Sometimes safeguarding with require statements is not enough, i.e. uint256 constant public OFFER_LIMIT = 500 ...
0
votes
1answer
27 views

Memory Utilization Pattern Solidity?

I was wondering what is the most efficient way (and why), to use variables in memory for function calls with regards to A and B? A) Like this: function checkBalance() public view returns (uint256) ...
1
vote
1answer
42 views

Error encoding arguments: Error: invalid bytes32 value (arg=“”, coderType=“bytes32”, value=“0x6c”, version=4.0.37) >

pragma solidity ^0.4.20; contract TestBytes32ToString{ function bytes32ToString(bytes32 x) public pure returns(uint,uint,uint,string memory){ bytes memory bytesString = new bytes(32); ...
0
votes
0answers
9 views

Failed to decode output: Error: invalid utf8 byte sequence; unexpected continuation byte

pragma solidity ^0.4.20; contract TestBytes32ToString{ function bytes32ToString(bytes32 x) public pure returns(uint,uint,uint,string memory){ bytes memory bytesString = new bytes(32); ...
1
vote
1answer
43 views

Pass arrays to solidity's function from truffle

I am getting ALERT: Transaction Error. Exception thrown in contract code in metamask when calling addBet function from truffle. The function works without any errors when called from remix. The ...
0
votes
1answer
17 views

TypeError: Named argument does not match function declaration

I'm getting the following error while compiling this code: pragma solidity ^0.4.17; contract Campaign { struct Request { string description; uint value; address ...
0
votes
1answer
24 views

Can I write a smart contract to access a database and verify details of a student?

I have to write a smart contract to create a degree certificate of a student in the University. To generate the certificate, I have to clear all the dues in my University's library, Sport's department,...
0
votes
1answer
27 views

How to initialise a mapping variable of a struct?

I want to add elements in moneyLineData of a Bet instance. pragma solidity ^0.5.0; pragma experimental ABIEncoderV2; contract Betting { struct Bet{ uint betId; string question; ...
0
votes
0answers
33 views

Comparison of 2 child-contract-values in factory-contract

in my solidity code I create a tracking-contract and auction-contracts out of a factory-contract. The last function 'a4_Payment' of the auction-contract should be triggered out of the master-contract ...
0
votes
1answer
15 views

mistake about importing another contract into one contract in remix

I import another contract Hello.sol in contract test1.sol, but after deploying it, only contract Hello's function is displayed in the run interface, not contract test1's function???What is wrong?What ...
0
votes
1answer
12 views

How to set constructor parameters before deploying in remix?

I don’t understand how it works. I created a contract with a constructor with parameters. But I don’t understand where to pass these parameters to the constructor. Or I need to set params after ...
0
votes
0answers
17 views

Can a factory-contract access/read/modify variables in generated child-contracts?

at the moment I am experimenting with the factory/child-logic in solidity. With my factory contract I am able to create child contracts in which an auction is executed. Now I want to return a variable ...
0
votes
2answers
111 views

How to send ETH to address(0) from msg.sender address using multiple token's contracts, with Solidity 5.x?

I need the safest way for an user to send any amount of Ethereum to address(0). The amount is calculated by the contract, and there is no limit (assuming there is enough funds). All the code I could ...
0
votes
1answer
29 views

How to change push() method to simple code?

I have this code but it's static and I wanna change it dynamically. function addCandidates(){ if( own == 1 ){ candidate[0].candidate_ID[0] = 1; candidate[0].candidate_ID[1] = 2; ...
0
votes
0answers
30 views

How to connect Remix desktop to connect to MetaMask?

I downloaded the desktop version of Remix, and am trying to connect it to the main network. I can do this in the web version of Remix easily, opening up MetaMask on my browser. However, in the desktop ...
0
votes
1answer
22 views

Checking TokenBalance of other token contract

I try to simply check a users DAI token balance on Kovan testnet (ContractAddress: 0xC4375B7De8af5a38a93548eb8453a498222C4fF2) with the following code: pragma solidity ^0.4.16; contract ERC20 { ...
0
votes
1answer
32 views

Solidity - Creating child contract

Recent code: pragma solidity ^0.5.11; pragma experimental ABIEncoderV2; contract Master { address Pi_C_Owner; address payable public NewAuctionPayable; //Hilfsvariable um ...
0
votes
0answers
9 views

How to simulate 2 accounts on the same Ropsten network using MetaMask and Remix?

I was able to deploy to the contract and everything but I wanted to see another account interacting with the contract, but on Remix only one account at a time
0
votes
1answer
16 views

how to put struct “s1” values in another variable

how to put struct "s1" values in another variable. pragma solidity ^0.5.1; contract MyContract{ struct student{ int RollNo; string Name; } student public s1=student({...
0
votes
1answer
38 views

how can i count how many buyers made request to my smart contract and get earnedEther [closed]

I am using a factory contract for selling and buying goods. how can retrieve how many buyers bought and calculate how much ether earned by selling goods? here is my source code. I am new on smart ...
0
votes
0answers
11 views

Auction Contract with “Right to Bid”

I build a basic reverse auction you see here using Solidity and the ethereum remix IDE. In addition to the functionalities already implemented I would like to add a "SafetyLimit" amounting to half the ...
0
votes
0answers
18 views

Remix forced error

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. I got this error on my remix when I ...
0
votes
1answer
35 views

Cannot deploy new contracts with pending transactions (Ropsten)

I have a very strange and annoying problem. I am trying to deploy a new contract however it just keeps cycling. I have the same problem on the POA testnet and on Ropsten. Please see below: I have ...
0
votes
0answers
31 views

Is it possible to see the execution cost of a function before it is executed?

I would like to assert the cost of an execution within a Solidity (5.x) function before executing it. To the best of my knowledge, this sounds like an incomputable problem, but I would like to check ...
0
votes
1answer
44 views

Need a guide to access my ropsten test network contracts through my command line and not remix

I have written and published a contract on the ropsten test network using remix. Now I want to access the functions of the smart contract from my command line (My PC) and not the remix IDE. Is there a ...
0
votes
0answers
37 views

remix compiler just won't end compiling

I've just started my journy with etherium, so now I am trying to get my first script complied. I tried starting with this project https://github.com/san-lee-ai/simple_auction But I could not get the ...
1
vote
1answer
26 views

Invalid opcode when trying to pass address as parameter to contract

When I try to pass address as parameter to this addEmployee function it gives me this error: invalid opcode The execution might have thrown. Debug to get more information. modifier onlyOwner(...
0
votes
1answer
43 views

Sending entire contract balance to address

I am trying to establish a basic reversed auction in solidity using the Remix IDE. In the last function i want to pay back the whole contract balance to a certain address. My approach with .transfer(...
0
votes
1answer
29 views

Way to create an event?

As soon as a function is called this other function should also be called!! Example: As soon as ether is deposited it should transfer funds into employees wallet. I already have functions deposit() ...
0
votes
1answer
25 views

How to transfer ether to wallet addresses in an array?

address[] emp = [address1,address2]; amount = total/emp.length; for(uint256 i=0;i<employees.length;i++) { wallet = emp[i]; wallet.transfer(amount); } So This is the error I get. TypeError:...
1
vote
0answers
18 views

Error encoding arguments: SyntaxError: Unexpected Token A in JSON at position 3

I was able to successfully deploy my first smart contract. But I am getting the runtime error. I am trying to create a new product structure for each wallet and trying to initialize the structure. As ...
0
votes
1answer
28 views

Adding a payee to a donation contract. Error: Transaction reverted

Disclaimer: I'm a noob when it comes to programming altogether let alone smart contracts. I refactored this code that was written like three years ago so it could work with solidity 0.5.0. I deployed ...
0
votes
1answer
23 views

Passing more than 20 parameters in solidity

How to pass more than 20 parameters in solidity function? I have tried using array[] parameter that uses pragma ABIENCODERV2 experimental feature. But this feature cannot be used in production purpose....
0
votes
1answer
9 views

How can I debug a my Solidity smart contract with a GUI?

Is there any way to debug a Solidity smart contract with a GUI, like remix? How can I do it for both testnets and mainnet?
0
votes
1answer
15 views

function overriding is quite working when called with web3.js

function getDetails(address publicKey) public view returns (Organization memory) { return s.getOrg(publicKey); } function getDetails(string calldata orgID) external view returns (Organization ...
0
votes
0answers
39 views

Smart Contract is not working on Geth private network, while it does work on Ganache as well as Remix

I've only begun working with geth from last week and have faced the quite a challenge. I've written a smart contract and it works on remix (JavaScript VM) but somehow it does not work on my geth ...
0
votes
0answers
34 views

Smart contract function not returning value (decoded output) in Remix

I am completely new to Solidity and would appreciate any help. I have a supply chain smart contract and it contains a function that is supposed to be called by customers and after the call, the ...
0
votes
0answers
30 views

One Proxy delegate contract to ten another proxy contracts

I'm trying to figure out why this code reverts. I need to make 10 bottles. This is how I do this: deploy Logic contract deploy 10 Proxy contracts call "upgrade" at each Proxy and pass Logic address ...
0
votes
1answer
29 views

cannot be able to connect to private blockchain hosted at local VM

I want to use remix IDE and want to connect web3provider which needs to be connected to private blockchain running on VM locally. My system is running on Windows 10 and I am running the VM on my local ...