Questions tagged [remix]
Questions about Remix, an online browser compiler for Solidity, formerly called Browser Solidity.
1,916
questions
0
votes
1answer
10 views
Get value from multi mapping in solidity
I have this code:
struct VotesInfo {
string name;
uint256 voteCount;
bool enabled;
uint256 check;
}
mapping(address => mapping(uint256 => VotesInfo)) private _votelist;
How can ...
0
votes
0answers
11 views
Contract Created successfully but I don't receive tokens ? Bscscan testnet
I'm really sorry for the basic question. I've made some basic contracts from youtube videos, now I've tried to take contracts from BSCscan and put them through Remix on Testnet to try them, but I ...
0
votes
1answer
13 views
How to import and compile contracts of different versions solidity
How to import and compile contracts of different versions using solidity in remix?
When I import a contract I get this error:
ParserError: Source file requires different compiler version (current
...
0
votes
0answers
10 views
Remix crash (Error code: Out of Memory)
We're having issues with remix. It crashes on third iteration in for loop. When we try to run verify method, it successfully runs 2 iterations of for loop. However, in third iteration remix crashes. ...
1
vote
2answers
26 views
What is a nightly build in solidity? [closed]
I have received an error that says so:
ParserError: Source file requires different compiler version (current
compiler is 0.8.3+commit.8d00100c.Emscripten.clang) - note that
nightly builds are ...
0
votes
1answer
7 views
How to Properly use “Memory” After Function Parameters
I have a question about writing functions in Solidity - I am trying to create an array of dog structs but I can't seem to get the function declaration correctly:
pragma solidity ^0.5.1;
contract ...
0
votes
0answers
12 views
Is Remix compiler broken? [duplicate]
I was able to use remix, an online compiler for solidity. However, I can't anymore. When I go to the website, I cant even see the files under "file explorer", it is just empty.
When I click &...
0
votes
0answers
11 views
Is there any method to generate new public private key pair in solidity?
I want to generate a new ethereum account in solidity(if possible in online Ide remix) & sign transactions with the private key.
In other words, I want more ethereum account apart from the default ...
0
votes
1answer
17 views
TypeError: Type String Memory is not implicitly convertable to expected type adress
I see the following error:
TypeError: Type String Memory is not implicitly convertable to
expected type adress while trying to execute
with the following code:
pragma solidity >=0.4.18 <0.5.13;...
0
votes
0answers
10 views
Simple Web3 installation and calling contracts
I have been trying to inject metamask into my site using web3. I have called web3 in my site as below and started the site using local server(VS Code extension which gives me port:5500)
window....
0
votes
0answers
5 views
what is the difference between .json files and .metadata.json files in the artifacts folder in remix?
From here, I have read that:
artifacts saves the ABI, binary of contract and other info related to
the contract.
In Remix when I open the artifacts folder I see a .json and a .metadata.json file. ...
0
votes
0answers
27 views
How to sign a smart contract deployment transaction?
I have a question related to smart contract deployment and wallets. Since I am new to the Ethereum blockchain world, I want to get an insight on how it actually works and write down what a developer ...
0
votes
1answer
16 views
Problem with smart contract's constructor instantiating another smart contract
I have the following two smart contracts in the same ".sol" file: Credentials and Proposals.
Every Proposals smart contract should refer to a single Credentials smart contract, in order to ...
1
vote
1answer
81 views
Correctly compiled contract on remix returns empty ABI
I have two questions. My contract has compiled and deployed successfully both using remix and truffle. However:
q1) remix returns an empty array of ABI.
Also, after I hit compile the contract at the ...
0
votes
1answer
22 views
I AM Trying to connect my Website with Remix Ethereum IDE and getting Error { (index):85 Uncaught TypeError: CoursetroContract.at is not a function}
'''
Document
<link rel="stylesheet" type="text/css" href="main.css">
<script src="https://unpkg.com/web3@latest/dist/web3.min.js"&...
0
votes
0answers
16 views
How to deploy a Vyper smart contract? Remix fails to compile
I have been trying all the solutions and tutorials I found on the Internet, with no success. Remix fails to compile vyper smart contracts in local and remote. How to make it work?
1
vote
1answer
15 views
setting value using address.call() doesn't works
I am trying to run a setter function (testCallBar) in Caller contract which should run setVal() of Receiver contract using call method. But it does not works. testCallFoo() works as expected but ...
0
votes
2answers
32 views
Call state modifying function in view function
Is it somehow possible to do something like this?
contract Test {
function test (bool isTransaction) public view {
if (isTransaction) {
foo();
}
...
}
...
1
vote
1answer
24 views
Reading out single elements from a struct of an other contract
here a shortcut from my both contracts. Is it possible to read out and change single elements(from contract B) of the struct (Contract A) ? e.g. from contract B like p.submission(_id).studentaddress ? ...
0
votes
0answers
18 views
Debugging mainnet contract [duplicate]
I'm hoping to be able to debug a main net transaction without needing to pay the gas fees to have it fail. Metamask tells me that it is going to cost 1.8 eth to run the transaction so I cant exactly ...
2
votes
1answer
46 views
Remix IDE File Explorers is missing
I have no idea what happened, but all of a sudden, the file explorers in remix ide is gone. I tried all I can to recover it, including restarting it, switching back and forth between new and old ...
0
votes
1answer
13 views
DeclarationError: Undeclared identifier issue
Can't figure out this error. Please help!
"DeclarationError: Undeclared identifier. (bool success, ) = recipient.call; value; amount ;(""); ^---^"
function sendValue(address ...
0
votes
0answers
10 views
what will be the auction end time value? [duplicate]
what should be the auction end time value like I entered bidding time value? I had never entered anything over there if manually I have to do then how should I do it?
0
votes
0answers
15 views
How to change deposit eligible token to other token?
I forked a smart contract from Github. Check it here.
The contract mints "WETH" after a user deposits "ETH" and vice-versa.
But I am unable to change the "ETH" to any ...
2
votes
2answers
160 views
invalid arrayify value while using bytes32 array
Since we cannot pass string arrays as parameters in solidity I used a byte32 array in a function. The code gives no error at compile time. But when I give input to the drawCard function as below in ...
0
votes
0answers
6 views
Why would Web3 return an empty array after calling the solidity function
So I want to interact with my Smart Contract from remix with python library called Web3.
The problem is when I try to call the function from the smart contract it runs successfully but it only returns ...
1
vote
1answer
21 views
Structs giving error while creating nft on ropsten
I am trying to create 10 random nfts with different supplies using solidity version 6 and remix ide. However I keep getting the following errors:
contracts/bullrun_cards.sol:29:16: TypeError: Type ...
0
votes
0answers
18 views
Remix IDE Waring for “Required Compiler Version”
I am well versed with solidity and often use Remix IDE. Quite recently, despite adding a compiler version in my code. I am still getting this warning
Warning: Source file does not specify required ...
0
votes
1answer
22 views
Funding contract with LINK tokens revert error
When I try creating a Chainlink contract from "master contract" and fund it with LINK, I keep getting the error:
"VM error: revert. revert The transaction has been reverted to the ...
0
votes
0answers
11 views
ERC-1155 safeTransferFrom() issue: contract doesn't have permission to send tokens from itself
I have a function in an ERC1155 contract that looks like this:
function foo(uint _id, uint _amm) external{
safeTransferFrom(address(this), msg.sender, _id, _amm, "");
}
Assume the ...
0
votes
1answer
18 views
Can not verify source code on Etherscan (ERC721 contract)?
pragma solidity ^0.7.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/...
1
vote
1answer
28 views
Compilation Error while using ChainLink
I am using Remix IDE for my smart contract development. I am using the following import line
import "https://github.com/smartcontractkit/chainlink/blob/develop/evm-contracts/src/v0.6/...
0
votes
0answers
8 views
Require messages on Remix or a similar tool
Our team is using Remix for a long time for the first exploratory tests or to call administrative methods (that we do not have specific UI).
I remember that some time ago I saw the messages that we ...
0
votes
0answers
21 views
Calling function does not work
So this is for avax network and there is pangolin dex it's the same as uniswap and I just want to call a function to get pair.
pragma solidity 0.7.1;
interface IPangolinFactory {
event PairCreated(...
0
votes
0answers
22 views
How do i use pangolin dex intefaces [closed]
Im trying to execute functions from pangolin dex smart contracts but how do I do it here are Factory address: 0xefa94DE7a4656D787667C749f7E1223D71E9FD88
Router address: ...
0
votes
0answers
27 views
How do I access data in another contract/node?
I have two contracts - Data.sol and Buy.sol. Data.sol contains information on products, etc.
I want to use Buy.sol to get and update data in Data.sol, somewhat like having a database. I know this can ...
0
votes
1answer
10 views
Remix IDE: Problem with Executing set method
I have created a contract and trying to run the contract on the Remix IDE. Following is the code of my contract:
pragma solidity 0.5.9;
contract MyContract{
uint256 peopleCount;
struct ...
1
vote
1answer
18 views
Derived contract not selected by defaut on remix
I have two simple contracts, a base one (BaseClass.sol):
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
abstract contract BaseContract {
address private immutable wallet;
...
1
vote
1answer
20 views
compile contract success but some function don't work once it's deployed
I tried to modify someone works that I found in stackexchange for learning reference. I was going to make shoppinglist contract, it could be compiled but when I deployed the contract, getitemcount, ...
0
votes
1answer
19 views
Solidity Undeclared identifier. s not (or not yet) visible at this point. but it is
I'm making if else function and if price == stopOrder it should do executeOrder but it's giving me error
function sellLogic() public {
require(StopOrder != 0 || LimitOrder != 0, "stop ...
2
votes
2answers
30 views
How can I multiply a fixed decimal var by a uint in solidity?
In base to this example:
Dealing with multiplying fractions in solidity
I am adding th DSMath correctly.
I can operate and compile with integers but if I try to compile a contract with any decimal ...
0
votes
1answer
15 views
Solidity if else 2 things how to
So I got an if-else statement if the price of eth is the same as stop order sell will be = to true, but I also want to do if the price is same or bigger then limit also sell = true. If price under ...
1
vote
1answer
11 views
“{” error in remix ide [closed]
Please help. I don't get what the following error means:
"browser/DGC1.sol:102:1: ParserError: Expected pragma, import directive or contract/interface/library/struct/enum definition. {contract ...
0
votes
1answer
22 views
Is it possible to display numbers as hex in Remix?
I'm using a fixed-point math library that works with binary numbers, so values like 0x10000000000000000 are assumed to be 1.
I implemented a function that raises a given number to a given power. ...
0
votes
0answers
12 views
How to assign an event output to a variable in SO?
So I got this function that gets latest eth price and I want it to put in a var like output = price.
Thanks in advance.
// For ETH-USD on ropsten, input the address:
// ...
1
vote
0answers
7 views
Remix Unit Testing: Fail message is giving wrong name of the test file
I am trying to do unit testing using Remix using the tutorial at Simple Contract at Medium, but it is giving me a FAIL message with “browser/tests/4_Ballot_test.sol) file highlighted with blue ...
1
vote
1answer
24 views
Minting NFTs failed
I'm new to solidity and smart contract development. I'm using openzeppelin's ERC721 contract and trying to generate an NFT. I want to require 0.1ETH for the minting of the token.
function mint_dts(...
1
vote
0answers
16 views
Remix: Add to “Deployed Contracts” list programmatically (!) via JavaScript
In Remix, when deploying contracts manually in the "Deploy and run transactions" tab, they show up in the "Deployed Contracts" list.
Remix also comes with the deploy_web3.js script ...
0
votes
1answer
15 views
How can I log text (and see the logs)
I'm writing a contract using remix, and I'm hitting an error but I can't debug it. When I enter the transaction hash in remix it tells me the json is empty ("").
I'm testing on the ropsten ...
1
vote
0answers
15 views
Question about Remix warnings: gas cost and same name of variable
When I try to compile the following contract on Remix:
pragma solidity ^0.5.9;
contract good{
mapping (address =>uint) public balances;
function withdraw () public {
uint balance = ...