Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
1k views

Invalid asm.js: Invalid member of stdlib when loading Remix IDE

When I try to load the remix ide on browser I'm getting the following on the console of the browser Loading https://solc-bin.ethereum.org/bin/soljson-v0.4.21+commit.dfe3193c.js without worker ...
2
votes
1answer
799 views

Event Log in Solidity

I noticed the following behaviour of event Log and wanted to confirm if that was the way it is supposed to work. Code below. Function create requires two fields. I put "require" in place to check ...
2
votes
2answers
3k views

Error Encoding Argument (remix)

We have a contract as follows: pragma solidity 0.4.23; contract RFID { struct StateStruct { bytes32 description; mapping(bytes32 => bytes32) sub_state; ...
2
votes
1answer
751 views

Use MEW for testing smart contract

Before the question, I want to show my development environment configuration: I am using Remix online solidity IDE for coding My contract is running on local PC with RPC (web3 provider option in ...
2
votes
2answers
284 views

Solidity Math: What's wrong with the function

What is wrong with the math logic in the function? It shorts the supply of tokens and it distributes much less than expected. if the contract owns 1000 tokens and the total ether fund size is 30 ...
2
votes
3answers
1k 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 ...
2
votes
1answer
500 views

Why is bytes[] a nested array?

Using bytes[] foo as a function argument contract b { function c(bytes[] foo) { } } in https://remix.ethereum.org gives error UnimplementedFeatureError: Nested arrays not yet implemented. Why?
1
vote
1answer
37 views

How to install solc of a specific version?

I want to install solc 0.4.24 but the commands given below installs the new version. sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc Or sudo snap install ...
1
vote
1answer
157 views

Why Remix IDE asks for CallData and what value we have to give? [duplicate]

In my several programs which I ran through remix IDE, I got a CallData text box. I don't know what value I have to give to this Calldata text box. I tried the following: from: address : "...
1
vote
1answer
53 views

can anyone explain why call, delegateCall, staticCall functions in solidity are called low level functions?

As i have read at many resources, that these functions are low level functions. I want to know, should i use these methods to interact with already deployed contracts or not ?
1
vote
2answers
389 views

Using “.value(…)” is deprecated. Use “{value: …}” instead

This works fine in Remix but when trying to work in VSCode (for compiling purposes; DApp course, trying to build .json through compile.js ) it throws the error Using ".value(....
1
vote
1answer
377 views

How can I build a smart Oracle of my own for a smart contract? [closed]

I need my smart contract to access data from some source. I want to build a smart Oracle in order to achieve this.
1
vote
1answer
927 views

Remix & Metamask: displaying more than one account

I'd like to test a contract on Remix and since it uses Oraclize, I can't use the javascript VM. So I'm connecting to Ropsten by selecting Injected web3 as environment on Remix. The problem is that I ...
1
vote
1answer
512 views

Remix IDE - transact to ___ errored: VM Exception while processing transaction: out of gas

pragma solidity ^0.4.18; contract Testing { address public owner; function Testing() public { owner = msg.sender; } function() public payable { } function withdrawAll() public { ...
1
vote
0answers
232 views

Cannot call contract's function in Remix

I have successfully deployed the following contract on ropsten (in order to understand reverts better): ``` contract Test { bool test1; bool test2; function Test() public { test1 = false; ...
1
vote
1answer
554 views

Remix IDE nolonger loads old solidity compilers. Error: "mock compiler: source not found|

The Ethereum solidity Remix IDE doesn't work for some reason. It doesn't seem to load the various compiler versions and renders the error: mock compiler: source not found I've tried to install ...
1
vote
2answers
2k views

Metamask, Remix IDE: Cannot create an account: Error: Internal JSON-RPC error

I am trying to deploy a contract using Remix IDE and Metamask. But whenever I try to create to deploy the contract I get the error Cannot create an account: Error: Internal JSON-RPC error. I am ...
1
vote
1answer
845 views

Pushing address to another contract's array returns TypeError: Member “push” not found or not visible after argument-dependent lookup in function

Contract User.sol has a function requestValidation which interacts with another contract. Its purpose is to push the address of the User.sol's contract owner into array pendingRequests, stored at the ...
1
vote
1answer
377 views

Deleting element from mapping exceeds gas limit

Deleting element from mapping exceeds block gas limit. I tried to increase gas limit to 10 millions, but there is no results There is mapping: mapping(address => bool) isSomebody; There is ...
1
vote
1answer
411 views

How does one require a specific amount of ether to execute a contract?

The following code requires 1 ether but works by accepting greater amounts and returns the change. How could one modify this code to require exactly one ether be paid in the first place and thereby ...
1
vote
1answer
118 views

Issue creating Token Contract

I am having an issue creating a contract on the Ethereum test net. I am getting the following warning statement: sol:21:5: Warning: Defining constructors as functions with the same name as the ...
1
vote
1answer
865 views

url not parseable error in Remix Compiler

This is a continuation of an earlier problem - I am trying to create a scenario whereby a user can create a child token from the main contract (and then later on a (grand[?])child coin from that ...
1
vote
2answers
401 views

Setting the address for a contract - within another contract

so I'm working with two contracts in one remix file and I'm slightly confused. I know this works (I've seen it used before) NonFungibleToken public nft; function setNFTAddress(address addr) ...
1
vote
0answers
91 views

Remix testing timeout with JavaScript VM when calling a large array

I'm trying to test a contract getter method that returns a large array. I am using Remix and deploying using JavaScript VM. My contract deploys alright, but trying to call the getArray() method causes ...
1
vote
2answers
2k views

Deposit and withdraw from multiple accounts

I have a scenario of deposit the amount on a particular address and keep the record of the total amount deposited at this address. The same way one can also withdraw the amount from this address and ...
1
vote
1answer
180 views

Solidity: How can a contract B, burn from contract A, generate another contract?

As we know if we want contract A, in the future, creates another contract: contract B, when we're deploying contract A, we also put the code of contract B in the transaction. So we send the following ...
1
vote
0answers
456 views

Reading require() error reason in web3.js client [duplicate]

Solidity version 0.4.22 introduced error reasons for require and revert (https://github.com/ethereum/solidity/releases/tag/v0.4.22). I tried using them, but it looks like they only work when I'm ...
0
votes
1answer
154 views

create ERC-20 token from a contract function

I would like to do a function create contract with ERC-20 interface. But I have a few problems. If anyone help me I’ll be appreciated. Here’s the code : pragma solidity ^0.5.0; import 'https://...
0
votes
0answers
232 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
1answer
456 views

How to call a function from deployed contract to another contract? [duplicate]

I created a basic ERC20 token contract and deployed in rinkeby testnet and I got the contract address now I want to call transfer() function from this deployed contract to another contract without ...
0
votes
0answers
19 views

Error: exceeds block gas limit undefined (2)

I am using geth 1.9.12. When I try to deploy any contract (below the code), using the console, I get the error: Error: exceeds block gas limit undefined What exactly is this error? Thanks in advance. ...
0
votes
1answer
180 views

Why I do not get returned value of function of my smart contract using testRPC and a Graphical User Interface?

I have a smart contract that is tested with remix and it works well. Its code is as follows : contract Weechain: pragma solidity ^0.4.15; // --------------------------------------------------------...
0
votes
1answer
757 views

Is it possible to deploy smart contract source code using remix? [duplicate]

I use remix ide. I want the source code of my contact to be published and visible in Etherscan. I do next things: Write some sample Smart Contract Open "Compile" tab, check that there are no errors ...
0
votes
1answer
206 views

Best way to do USD math in Solidity?

Pardon the n00b question! I am trying to do some simple math in solidity using USD values. For example, say the start price of a token offering is $0.50 USD and the contribution is $10.00 USD, then ...
0
votes
1answer
42 views

Contract Data Retrival

Whenever I do modification in a contract and deploy the contract again, the data in the existing contract is completely lost as the new contract is deployed in a new address. For instance, I have a ...
0
votes
1answer
28 views

Problem with understanding contract containing array of structure

I got the following code for a contract from a Solidity tutorial website: pragma solidity 0.5.1; contract MyContractPersonStruct { Person[] public people; uint256 public peopleCount; ...
0
votes
1answer
500 views

Solidity Debugging in Remix

I am working Remix Browser for the following simple Contract. I had a couple of questions. I could not find the right answers. During Contract Creation: It gives the following error. What is ...
0
votes
1answer
28 views

Read List of Posts using struct

I tried to read a list of posts using the code below struct posts { bytes32 postTag; string post; address[] acceptedBy; uint8[] voteCount; } mapping(address => posts) totaluserPosts; ...
0
votes
1answer
98 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
224 views

Unable to input address[] parameter in remix

I need help for deploy below smart contract on remix IDE. I have facing a problem as I need to input to 'setgrantaddress' as address[], How to input data in it? There is two file name owned.sol and ...
0
votes
1answer
2k views

Contract Not sending ether to other account

I have created a contract which store the address of the users and i want to send 1 ether all the users stored in array. Here is my code contract project{ address public user; bytes32[10] ...
0
votes
0answers
531 views

“callback contain no result Error: Error: base fee exceeds gas limit” when call selfdestruct function (using Remix IDE)

I'm testing this simple contract. All the functions works well, but when I call the kill() function I'm getting this error: callback contain no result Error: Error: base fee exceeds gas limit I'm ...
0
votes
1answer
362 views

Getting TypeError: Operator == not compatible with types int_const 1000000000000000000 and address payable

I am trying to use external modifier however I getting error as below code. { require(block.timestamp < start + buyPeriod); require(1 ether == msg.sender);<--- error got here ...
0
votes
2answers
2k views

Returning dynamic array not works

I'm trying to build a function that, when called, returns a mapping as two different array. The problem that I have a mapping (address => uint) content2view and I have to get this value outside ...
0
votes
2answers
193 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
313 views

Problem of deploying contract with “testRPC” and “remix” : “creation of contract pending …”

When I try to deploy a contract using testRPC and remix, I receive: creation of contract pending ... I tried even the default contract of http://remix.ethereum.org. Steps: First I open cmd. Then ...
0
votes
0answers
52 views

Why incorrect number of tokens are sent according to the current rate to the contributor.?

Token Contract https://ropsten.etherscan.io/address/0x6f5c43f62b4b18aa8ed37b42f2804f7049cbe0e9#code CrowdSale Contract https://ropsten.etherscan.io/address/0x9b94e1894abe2051e6e96bf1b57fe5d3adbbc5aa#...

1 2
3