Questions tagged [remix]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
9 views

Iterating over a list of payable addresses throws error that "the value you send should be less than your current balance"

Stuck with this for a few days already, looking for some help. I write a contract that allows users to bet on a certain event and then once the result of the event is evaluated it should change their ...
user avatar
0 votes
2 answers
7 views

Why and when to user require(bool) on functions

I want to understand when (and why) it's necessary to use this statement : require(sent, "failed to send ether") i could just do somethink like this instead:
user avatar
0 votes
1 answer
16 views

How can i store each address that interact with my smart contract?

i am working on a crowdsale type of smart contract and i want to store everyone who sent ether to my contract .So i created a struture like this struct User { address participantsAddress; ...
user avatar
  • 3
0 votes
1 answer
23 views

from solidity: TypeError: Member "log" not found or not visible after argument-dependent lookup in type(library console)

from solidity: TypeError: Member "log" not found or not visible after argument-dependent lookup in type(library console). Im using hardhats lib "hardhat/console.sol"; I want to ...
user avatar
0 votes
0 answers
4 views

why is the transferFrom function not able to send ether? I keep receiving an error in remix ide

pragma solidity ^0.8.0; library Balances { function move(mapping(address => uint) storage balances, address from, address to, uint amount) internal { require(balances[from] >= amount); require(...
user avatar
  • 17
0 votes
0 answers
4 views

Can't find where .sol files are stored in the local storage of the browser

I lost all my workspaces in Remix (running on Brave). I opened the developer console to explore the indexeddb storage to try to find my files. But I found nothing. I tried to search in Local Storage ...
user avatar
0 votes
0 answers
14 views

"Error": "Failed to decode output: Error: data out-of-bounds

I've got this strange error in Solidity's Remix: "error": "Failed to decode output: Error: data out-of-bounds (length=36, offset=64, code=BUFFER_OVERRUN, version=abi/5.5.0)" It ...
user avatar
  • 101
0 votes
1 answer
8 views

How to reduce amount in Contract and not from Account

I have a fallback function like this. So I am able to send and increase the amount in "contract address". Assume I sent 2 transactions like 10 and 20, the sum is 30 is successfully shown. I ...
user avatar
  • 103
0 votes
0 answers
10 views

TypeError:member add not found or not visible after argument-dependent lookup in uint256

Smart contract code: pragma solidity ^0.8.0; import "https://github.com/kklau2013/HelloFlashLoan/blob/main/contracts/v1/aave/FlashLoanReceiverBaseV1.sol"; import "https://github.com/...
user avatar
0 votes
0 answers
6 views

Trouble deploying an ERC20 contract remix

Hi so some assistance would be greatly appreciated. I am able to successfully deploy my contract when my ether is set to 0. It will go through MM and everything looks solid. By the way I am using test ...
user avatar
  • 1
0 votes
0 answers
10 views

How can I transfer this ROI value inside RateOI function value to the contract itself and the contract Balance gets updated

contract RATE { function contractBalance() public returns(uint){ return address(this).balance ; // store = address(this).balance; // console.log(store); // store =...
user avatar
0 votes
1 answer
10 views

How to automate creating multiple bids for an auction smart contract?

I have created a simple auction smart contract in remix and now I have to do some experiments with it. In my model, it is possible to create the requests and then bid those requests with the Bid() ...
user avatar
0 votes
0 answers
65 views

I deployed an contract , have total supply but no token holder

// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; ...
user avatar
0 votes
2 answers
16 views

How to show Token Transfer details on mumbai polyscan?

I am developing a smart contract where I want to mint NFTs. NFTs are being minted and shown on IPFS. But I cannot see the Token Transfer details on mumbai polyscan. Anyone know what is the problem?? ...
user avatar
0 votes
0 answers
13 views

How To Write a Smart Contract and JS Script that gets Data About Transactions and displays it

I wrote a smart contract that stores, read, updates and deletes data from the blockchain for my Online Birth Registration system. I'd like to know how I can write a smart contract that gets and the ...
user avatar
1 vote
2 answers
16 views

How to show my own contract name in Token Tracker field of an ERC1155 Contract?

I am developing an NFT Drop site contract. I want my NFT Contract to be named from ERC1155 to provide a name in the constructor. I have watched and followed many tutorials. They all work the same and ...
user avatar
0 votes
2 answers
25 views

Why am I NOT able to interact with ALL of my smart contract functions via my HTML GUI?

I have noticed something very strange... I have a smart contract with two functions. I am able to interact with all of them (In Remix, Web3 Provider Environment, pragma solidity ^0.8.2) perfectly well....
user avatar
  • 107
0 votes
0 answers
14 views

Metamask Invalid Amount error

I'm developing a game. And I'm trying to transfer a sample token that I've created in Remix (ERC20) on the Rinkeby testnet. Once the transfer function executes a drawer opens in my Metamask app (iOS) ...
user avatar
  • 1
0 votes
0 answers
16 views

What is expected in setting up the following dutch auction?

This is quite possibly not a question within the scope of stackexchange but please help out. I am trying to do an solidity project in which a dutch auction is to be implemented and the auction logic ...
user avatar
0 votes
2 answers
23 views

What is the 'balance' keyword in Solidity?

contract Helper { function getBalance() returns (uint bal) { return this.balance; } } Is this(balance) also a keyword in solidity? Where can I find their description?
user avatar
0 votes
1 answer
34 views

Can a smart contract hold/own tokens (USDC)?

I want to write a contract that buys back an ERC20 Token using USDC. (in REMIX IDE) I want to understand what is the best practice for paying out the USDC in return for the ERC20 that was sold to the ...
user avatar
  • 115
0 votes
2 answers
31 views

How to do infinite approve/transferFrom in Solidity

I want to write a contract that buys back an ERC20 Token using USDC. (in REMIX IDE) I want to understand what is the best practice for paying out the USDC in return for the ERC20 that was sold to the ...
user avatar
  • 115
0 votes
0 answers
28 views

How to fix gas problem in Ethernaut quiz 13?

I'm trying to call function hack. I set gas limit to 3000K but when call function 'hack' there is the error. Why does eth gas runs out of (63178) by such a simple function? and dramatically, when I ...
user avatar
-2 votes
0 answers
10 views

hi. I have stack to remix 1235 contract. thank you for your time [closed]

from solidity: ParserError: Expected '{' but got identifier --> contracts/cute crypto bunnys.sol:1235:15: | 1235 | contract cute crypto bunnys is ERC721Enumerable, Ownable { | ^^^^^^
user avatar
0 votes
2 answers
18 views

Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable; error in line 4

pragma solidity >= 0.7.0 < 0.9.0; library search { function findIt(uint [] storage numb, uint value) public view returns(uint){ for (uint i = 0; i < numb.length; i++) if (numb[1] == ...
user avatar
0 votes
3 answers
24 views

Which compiler version should I use?

// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.9.0; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; import "@chainlink/contracts/src/v0....
user avatar
  • 1
0 votes
1 answer
17 views

Member "push" not found or not visible after argument-dependent lookup

// SPDX-License-Identifier: GPL-3.0 pragma solidity >0.6.0 < 0.9.0 ; contract xyz { uint256 public abc ; struct lmnop { uint256 abc; string name; } lmnop [] ...
user avatar
0 votes
0 answers
16 views

Need help with a for loop

If anyone would be kind enough to create me a for loop that will check who my top funders are and add them into an array, here is my code i appreciate any help. address[] funders; uint256 ...
user avatar
0 votes
1 answer
29 views

Warning: Return value of low-level calls not used. --> hh.sol:147:6: | 147 | payable(0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097 )

I want to share profit between different wallets. The contract is working and the profit is divided but I get that message that make me feel uncomfortable, and I can't find why. Could you please help ...
user avatar
0 votes
1 answer
17 views

How to call a function of a smart contract if I only know the address of that contract in hardhat script?

I have a factory contract which creates a child contract upon calling a createChild function and emit an event that has the newly created child contract address. Now how to call any function of the ...
user avatar
0 votes
0 answers
143 views

How to programmatically swap tokens using a smart contract with NodeJS and Solidity

I would like to build a bot (using VS code) that swaps ETH for other tokens and swap other tokens for ETH using a smart contract. I have used Remix IDE but I get errors that I can't fix. For example, &...
user avatar
0 votes
0 answers
12 views

Free Mints Not visible

my goal is to have some of my NFTs from my collection available for free for the buyers. Here's the code: // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; import "erc721a/...
user avatar
0 votes
0 answers
32 views

What are the gas, transaction cost and execution cost in Remix?

There was a question here What is the difference between transaction cost and execution cost in remix?, but when I used Remix, I never see the transaction cost differing from execution cost here? It's ...
user avatar
  • 37
0 votes
1 answer
19 views

what input does bytes32 take for this logic?? I've tried different string data types like the word "blue".. i also tried number types..nothing works!

pragma solidity ^0.8.0; contract Ballot { struct Voter { uint weight; bool voted; address delegate; uint vote; } struct Proposal { bytes32 name; uint voteCount; } ...
user avatar
  • 17
0 votes
0 answers
19 views

I GOT ERROR FROM REMIX - SOLIDITY " Check-effects-interaction: " & " Inline assembly: " & " Block timestamp: "

I got error on remixethereum. I need help. What can I do now? Can someone help me:? enter image description here6mVd.png like this for example, xxxxxxxxxxxxxxxxx
user avatar
0 votes
0 answers
8 views

Adding a peer to a local ethereum node created with the --dev flag

I have created a node using the following two commands: geth --datadir --http --dev --http.corsdomain "https://remix.ethereum.org,http://remix.ethereum.org" --networkid 1234 -allow-...
user avatar
  • 1
0 votes
1 answer
61 views

Deployed contract with Remix, and trying to verify contract on Etherscan after few weeks but Bytecode doesn't match

I've been reading as much around this as possible, but cannot verify a contract which relies on openzeppelin imports, because the compiled bytecode differs from the deployed bytecode. I deployed an ...
user avatar
  • 11
0 votes
1 answer
39 views

How to create a dynamic NFT?

This might be a generalized question. But how does one create a dynamic NFT something similar to what NBA did for the latest collection drop? I am referring to this collection: https://opensea.io/...
user avatar
0 votes
1 answer
48 views

In Solidity, when invoking an external contract, how do you override its library functions using a separately deployed contract?

I am trying to understand how an exploit occurred on the Ethereum network as per PeckShield's Tweet. According to the exploit transaction logs, contract code at ...
user avatar
0 votes
1 answer
39 views

solidity transaction error, The called function should be payable if you send value and the value you send should be less than your current balance

I want to write a contract using router from uniswap. But when swapping 1 token to another, I get an error The transaction has been reverted to the initial state. Note: The called function should be ...
user avatar
1 vote
0 answers
10 views

Truffle compiles different binary than RemixIde, even with same compiler version and evm version

The code: pragma solidity <0.9.0; contract Callee { address public a; address public b; function test(uint256 i) public returns(uint256){ a=address(this); b=msg....
user avatar
  • 183
0 votes
1 answer
15 views

How can i set the values of mapping which is inside of a struct?

I have tried some methods but its not working, and dint got any working example on internet. struct customerId{ address id; mapping(string=>uint) customerAmount; mapping(...
user avatar
0 votes
1 answer
45 views

Pushing problem using arrays of a struct into an array of another struct

I want to count the votes of the candidates in general to say who is the winner (easy) and to count the votes of the candidates in each election center (here is my struggle). In latest version 0.8.7 ...
user avatar
0 votes
1 answer
23 views

Withdraw amount from Deployed Contract

Normally we use owner-only restrictions for the withdrawal functions but still, I'm curious why it didn't work. I created a sender and receiver contract. After deploying the contract I kept some ...
user avatar
  • 3
0 votes
0 answers
45 views

Minted NFT not show in opensea and baseuri not return {tokenID}.json

The minted NFT item and detail not displayed on test net Opensea on rinkeby network . pls kindly advise where gone wrong I duplicate sol from this https://etherscan.io/address/...
user avatar
  • 17
0 votes
0 answers
16 views

Permit failed into contract

This is contract doesn't work. Why? pragma solidity >=0.7.0 <0.9.0; interface IPancakeERC20 { function balanceOf(address owner) external view returns (uint); function transferFrom(...
user avatar
0 votes
0 answers
25 views

Remix pending transaction: Stuck

Using Windows Powershell as admin I launched ganache, changed the environment to injected web3 inside of Remix and connected to Localhost 8545 inside of MetaMask. Ganache starts executing properly and ...
user avatar
  • 107
0 votes
0 answers
9 views

Solidity unit tests using Remix unit_tests plugin

I have a 2 contracts Token A - Basic ERC20 Token Token B - An ERC20 Token which takes Token A My question is more on solidity UNIT_TESTS plugin. From my understanding, I can only manipulate msg....
user avatar
  • 115
0 votes
0 answers
25 views

Is it possible to import multiple contracts inside a remix test and pass an ERC20 address?

I want to run unit tests in remix where I have 2 contracts Token A (AUSDC) that will be exchanged for Token B (AToken) However, during the imports, I am shown the ff: error import "../contracts/...
user avatar
  • 115
0 votes
1 answer
10 views

while compiling it on remix i am getting this type error :Operator - not compatible with types tuple() and int_const 1

function setvalue(string memory _name,string memory _description,string memory _uses,string memory _ingredients,string memory _sideeffects,string memory _warnings)public{ Tablet storage data =...
user avatar
  • 1

1
2 3 4 5
55