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

Fail with call function in solidity by remix

When I try to call function rtu() in remix with 0 wei, it occurs error below If I call it with value (10wei), it shows error below I debug the code, but there is no local vaule in rtu() changed. ...
1
vote
2answers
29 views

“Gas estimation failed” on Ropsten with Invalid RPC JSON

I'm running into an issue going through a basic example in "Mastering Ethereum"... I have a Faucet contract (on Ropsten) per the book that looks like... pragma solidity ^0.5.1; //mastering ethereum ...
0
votes
1answer
2k views

Airdropping ERC20 Tokens to multiple addresses in a single transaction

done , wrong question. better to use this contract ERC20 { function transfer(address _recipient, uint256 _value) public returns (bool success); } contract Airdrop { function drop(ERC20 token, ...
1
vote
2answers
2k views

Out of gas when executing contract via web3 js

I am having a trouble invoking contract via web 3 js in browser. I am using truffle develop and have migrated and run tests successfully. I am also getting the info when I console.log the contract....
0
votes
0answers
107 views

Solidity and Web3js codes are not working inside the private Ethereum(geth) network but same codes are working in public ethereum

geth version : 1.9.0-stable-52f24617, node version : v10.16.3, npm version : 6.9.0, web3 version : -- web3@1.0.0-beta.36. genesis.json: { "config": { "chainId": 966308076, "homesteadBlock": 0, "...
0
votes
0answers
47 views

can I change the network id in ganache GUI? is it work for calling the functions in solidity?

1.can I change the network id in ganache GUI? is it work for calling the functions in solidity? I am running the private network using ganache Gui in localhost and I checked by changing network id ...
0
votes
1answer
15 views

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

In an attempt to compile my ABI and verify my contract, I am getting the following warning: "ParserError: Expected pragma, import directive or contract /interface/library definition" on the first line ...
0
votes
1answer
299 views

How to add account in rinkeby test network?

I have a problem on creating a wallet account. I have downloaded mist. I have downloaded ethereum wallet. I have no idea on anything of this. I am new to this. I have choosen Develop->Network->...
0
votes
1answer
19 views

# issue: Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

issue: 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 or always failing ...
0
votes
0answers
33 views

Transactions go to an older contract address rather than the present deployed one

Though I have deployed a new contract but the transactions go to a previously deployed contract in my application. I'm attaching the screenshot of my Remix-ide code and the code for the front end ...
4
votes
2answers
70 views

Remix now force to use https, how can i continue to use http://remix.ethereum.org?

Recently I was able to both use http://remix.ethereum.org or https://remix.ethereum.org, but today I was not able to direct by browser to the unsecure version of remix. The reason I need to do so is ...
0
votes
1answer
33 views

Web3 - Assign nonce to smarct contract transact

I have a smart contract. I want to execute one of its state modifying functions. This is the code: const result = await smartContractObject.methods .addSomething(_valueToAdd) .send( { gas: '...
0
votes
1answer
21 views

What I need to verify contract with open-source license?

i m deployed contract in etherscan mainnet. i m verify it with open-source license like (MIT, GNU). now the problem were i don't know were to define license in etherscan ?? and etherscan will validate ...
0
votes
1answer
22 views

error in ico token and ico contract

function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); Blockquote fallback typos error ...
0
votes
3answers
54 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 ...
1
vote
2answers
28 views

Is it possible to connect to public Ethereum like blockchain with Remix to deploy and view contracts?

I've tried to do so by specifying the web3 provider and the 8584 port but it gets stuck on every try. Is this possible? if so, is there another solution for that need?
0
votes
1answer
23 views

Web3 - Access return value of events

I want to get the value that my smart contract returns in javascript. Here is the contract. (version 0.4.25 - web3 version 1.2) pragma solidity ^0.4.25; contract SimpleStorage { uint public ...
0
votes
1answer
66 views

problem calling balanceOf from another contract

I try to learn solidity and i have a problem. I've created a base token and i want to call the balanceof method from this token in another contract. In Solidity Remix i get : call to BaseTokenBet....
0
votes
2answers
60 views

Smart Contract Withdrawal Function Not Working Properly

For some reason my function keeps throwing at 2nd line, where I'm declaring an uint256 named depositedContribution, I have no idea why and I've tried to debug it for hours with no results, what could ...
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
1answer
45 views

Remix - Solidity IDE - Gas requirements high

Compiled an "Auction contract" and got a warning regarding high gas requirements. Means: cannot run it. Below the lines with comments and that lines I included (//Part 1 Task n Line n). // CANNOT BE ...
3
votes
2answers
1k views

Error: gas required exceeds allowance or always failing transaction upon function execution

Problem The transaction fails because the transaction ran out of gas instead of it failing because the require condition was not met. It works fine before the solidity update to version 0.4.24. It ...
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
0answers
27 views

Error: Operator << not compatible with types bytes1 and int_const 1 return b10 << 1;

I don't know how to correct the code of function 4 & 5. pragma solidity ^0.4.4; contract C { bytes1 b10 = 0x6c;// l-> 0110 1100 6c转换为10进制-》12*16^0+6*16^1=108 bytes1 b11 = 0x69; ...
1
vote
1answer
20 views

Using contract to create Child contracts (web3j Java wrapper)

I have a simple Parent contract that creates child contracts and stores their address. contract Parent { address[] public registry; function createChild () public { address newChild =...
0
votes
1answer
35 views

i want to get data from the transaction hash i tried many codes at last i am getting boxes in the output

1) First, I got the input console.log(web3.eth.getTransaction('0x725fc75264726f409793164e336e7d5ed35df8d2be469a0cc1a3a8cc4756b9b9').then((i) => console.log(i) )); 2) I manually pasted the input ...
0
votes
1answer
20 views

Error when checking the value in a mapping

I am trying to keep track of the number of bidders in my contract. function bid() public payable an_ongoing_auction returns (bool){ uint oldval = bids[msg.sender]; require(msg.value+oldval &...
1
vote
1answer
25 views

Solidity - Return value of Smart Contract Transact

Why do Solidity transact functions not return any value? Here is an easy example. I tested it in remix and web3. pragma solidity ^0.4.25; contract SimpleStorage { uint public storedData; ...
0
votes
1answer
18 views

Call to other contract method return false when two parameters are passed

Caller Contract Called.call(abi.encodeWithSignature("test(address, address)"),empAddress, empContAddress) Called Contract event ad(address); function test(address e, address f)public{ ...
0
votes
1answer
18 views

This code is only displaying 0 output on the input of either 15 or any number why is that so? Is there something wrong with the code?

pragma solidity ^0.4.24; contract sec { uint age= 15; uint agePer; modifier onlyPer (){ if(age==agePer) { _; } } function getage(uint agep) ...
0
votes
1answer
25 views

How to distinct between value types in transfer

How does one distinct between sending different value types? E.g. between a transfer of ETH and a transfer of ERC20 token. Extending the question, is it strictly necessary for an external contract ...
0
votes
0answers
34 views

Error: Member “transfer” not found or not visible after argument-dependent lookup in address 0.4.4 [duplicate]

pragma solidity ^0.4.4; contract PayableWorld { function deposite () payable{ address dyw2 = 0x1De57DD112092D60F45c9e2045424003e6B2C75a; dyw2.transfer(msg.value); } how can i change the ...
0
votes
1answer
21 views

Parser Error On Remix Solidity ERC20 Smart Contract Token

This Is My First ERC20 Smart Contract Token. I Am Trying To Compile It Using Solidity 0.5.0. Plz Need Your Help Guys. pragma solidity ^0.5.0; contract TusharCoin { uint256 public totalSupply; ...
0
votes
1answer
27 views

How can I store multiple strings mapped to an address in Smart Contract (solidity)?

I want to save multiple files in Ipfs and store its hashes mapped to an user address. I thought of having an array mapped to address and pushing to it, but does not seem to be the right approach. ...
1
vote
1answer
979 views

Adding Multiple Accounts To Remix?

Hi I have MetaMask installed and Im working with the Remix IDE. I've looked everywhere but can't seem to work out how to add multiple accounts to here: so that I can test transactions using a ...
0
votes
3answers
271 views

CrowdSale basic contract sample showing Gas limit error

Hello I have copied Basic contract from official website https://ethereum.org/crowdsale I'm beginner in Solidity and Ethereum development It was successfully compiled by Remix but when I click "...
0
votes
1answer
21 views

Getting information from contract address?

pragma solidity ^0.5.0; import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol'; contract SubToken{ using SafeMath for uint; struct token{ ...
0
votes
1answer
45 views

How can I read the entire Solidity warning in the Remix browser?

When I get a Solidity warning in the Remix browser, I can usually just hover over the warning symbol to the left of the editor and read the error message. But, this time the end of the error message ...
0
votes
1answer
20 views

ERC20 - Approve & TransferFrom not working

The getTokenBalance function seems to retrieve data from the ERC20 contract just fine so I don't think there is an issue with how I'm using the interface. Additionally, I also tested out separating ...
0
votes
1answer
100 views

How to set default gas limit for my custom private network?

I've connected to my custom private ethereum network in remix with web3 provider. Everything was fine, account balance, and address was retrieved successfully. But I don't know why, but I could not ...
0
votes
0answers
26 views

Solidity Contract cost calcuation

How can I calculate the cost of running my contract and running each function? I've noticed in Ethereum when a transaction is successful we have a transaction cost and a execution cost, what the ...
0
votes
0answers
29 views

Is it possible to insert some custom data in the DATA field of an Ethereum Transaction?

i am working on trying to get some data encoded/inserted into an ethereum transaction. Let me describe my environment first, i am using Web3py, Ganache and Remix IDE. I am able to successfully ...
0
votes
0answers
8 views

DigixDAO smart contract functionality/pattern

Can someone explain the usage of initialisation functionality and _resolver arguments in the various constructors of digixdao? i.e. following contract What is a resolver and isn't the job of a ...
0
votes
2answers
285 views

Remix warning - Is constant but potentially should not be.

I am getting the warning on the code shown below. Could you please assist me know to resolve this warning ? warning message - "Is constant but potentially should not be"
2
votes
3answers
299 views

Basic Crowdsale Contract

I am learning to develop smart contract using Solidity. Currently, I am working and test the feature of following crowdsale contract. https://github.com/OpenZeppelin/openzeppelin-solidity/blob/v1.8.0/...
-3
votes
2answers
38 views

Trying to create an instance of an abstract contract

pragma solidity ^0.5.0; import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/SafeMath.sol'; contract SubToken{ mapping(address => uint) balances; ...
0
votes
1answer
12 views

interface function declarations to be used internally

Is it possible to use externally declared interface functions internally in a smart contract? i.e. say contract A inherits interface A, would contract A be able to implement the functions from ...
0
votes
1answer
22 views

Inheritance and contract creation

If I modularise a contract into two contracts, and inherit one of them instead using a monolithic approach, will the deployment costs be larger with two contracts or is the cost the same as with the ...
0
votes
2answers
281 views

Stuck at emitting an event in Solidity

I am stuck at Step-6 of Bitdegree's Solidity tutorial. Question is to Emit an event ScoreChanged with two arguments: int amount (equal to the value that was sent) and bool direction (true for up ...
0
votes
0answers
11 views

Contract Design Patterns | Should I use some sort of factory pattern?

I have 3 structs which are nested into each other i.e. struct A <- struct B <-- struct C All 3 structs belong to their own contracts (contract A, contract B, contract C) and each contract has ...