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
11 views

How to decode InputValue of ethereum using java web3j

**I'm trying to decode the inputValue of an transaction using web3j without using any contract abi and wrapper class,Im loading the contract using its contract address ,is there any way/inbuilt ...
0
votes
0answers
6 views

Difference between “decoded input” and “input” in Remix?

What is the difference between "decoded input" and "input" in the remix output? If these functions were to be called in an actual blockchain, would the "decoded input" be saved in a block, and thus ...
0
votes
1answer
18 views

How to store data on ethereum blockchain WITHOUT IPFS

Hi guys ^^ i want to store PDF file on ethereum blockchain without use of IPFS. I want to do it because i have my own private network where this data will be only stored. That's why i want to store it ...
0
votes
0answers
9 views

nested calls fail on geth --dev but pass ganache-cli

I have the following solidity contracts defined. I want to test nested calls using the lowlevel api where C->D->E. However, running this code passes on ganache-cli but fails on geth --dev node. Im ...
1
vote
1answer
47 views

Vyper fundraising smart contract: 'Attribute' object has no attribute 'func'

[SOLVED]: See below. I am taking a blockchain and security class and we are working with vyper. We have been tasked with rewriting a fundraising smart contract. However, the compilers do not seem to ...
1
vote
0answers
19 views

Is there a way to view the private key of test account in Remix (javascript VM)

Seeing how the keys are random and those "100 ethers" aren't real I can't think of why this is not obvious functionality, I'll need this for many reasons.
0
votes
1answer
11 views

browser/demo01.sol:8:33: ParserError: Expected '{' but got 'return' function age() private view return (unit) ^----^

pragma solidity ^0.4.24; //properties functions request contract AttrFnDemo{ uint private _age; string internal _name; int public _num; function age() private view return (unit) {...
0
votes
0answers
14 views

Solidity's address.transfer() function throwing exceeds gas limit error

I am learning Solidity in order to make a simple user interface in which users can purchase items and have ether sent from the purchaser to the Store. First, I have created one contract, one for the ...
0
votes
0answers
33 views

Gas estimation errored with the following message (see below). The transaction execution will likely fail

When I try to excute the deposit function it shows Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution ...
0
votes
1answer
15 views

what is declaration error in remix ide and how to solve it

What is declaration error here! I can't figure it out and the error is shown as an unidentified declaration error. Please help me out
1
vote
1answer
26 views

mapping Struct to bytes32 can't read from map

I am saving under byte32 key some struct, it is saved, but I really trust it is saved at all. When try to read, I get 0x0 in all fields. mapping (bytes32 => Document) documents; bytes32[] public ...
0
votes
1answer
15 views

Get contract data if all I have is a contract address

I have the address of a smart contract and I need to get the data residing in that address. I seem to have been struck at this for a while now and I want all this inside a smart contract. pragma ...
0
votes
1answer
17 views

REMIX debugger invalid opcode before JUMP

I am testing simple ERC20 token creation with the following in remix: pragma solidity ^0.5.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.4.0/contracts/token/ERC20/ERC20....
0
votes
0answers
26 views

Error with the function

pragma solidity ^0.4.24; contract XXXX{ address owner; constructor()public { owner=msg.sender;//To store address of contract deployer } struct Project//struct to ...
0
votes
0answers
12 views

TypeError: “send” and “transfer” are only available for objects of type “address payable”, not “address”. owner.transfer(msg.value); ^------------^ [duplicate]

pragma solidity ^0.5.0; /** * The Hotel contract does this and that... */ contract Hotel { struct Room { uint id; string name; string hotel_name; uint price; ...
2
votes
2answers
41 views

Calling function on ERC20 contract through staticcall gives wrong result

I've made two functions to interact with a local ERC20 token. Here they are: pragma solidity ^0.5.0; contract GardenTestContract { function getBalanceOf(address _address) public view returns (...
1
vote
0answers
10 views

Chain ID of Remix Javascript VM

I am attempting to test out a simplemultisig contract (https://github.com/christianlundkvist/simple-multisig) but it requires the chain id. I have been testing using ganache but wanted to switch to ...
1
vote
1answer
21 views

Remix compile error: Expected primary expression

function Renting() public { checkUser[owner] = true; struct govt = Person(owner, 'Owner', 'Owner', 0, 'None', new uint[](0), new uint[](0)); addressToPerson[owner] = govt; } When I try ...
0
votes
2answers
22 views

Getiing error in remix while using oraclize

Getting this error" called function should be payable if you send value and the value you send should be less than your current balance" even when i set value
1
vote
1answer
12 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
21 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
42 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
23 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
100 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
30 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
18 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
4answers
157 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
17 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
21 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
39 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 [closed]

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
28 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
51 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
10 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
62 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
23 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
37 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
33 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
34 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
13 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
18 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
116 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
48 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
23 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
33 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
17 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 ...