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

What is the best way to handle ERC20 token payments internally in the another contract?

I'm trying to handle ERC20 token payments, using the instance of the deployed ERC20 smart contract in another smart contract, but getting the following error: contract SimpleSmartContract function ...
0
votes
0answers
21 views

Correct way of randomly selecting token Ids from already minted NFT's

I have an NFT project with 1000 NFTs. As part of my project, users who hold an NFT will be entered into a lottery. The function I want to implement is the following: Select x number of users to ...
0
votes
0answers
30 views

Trying to make our own token: Can not verify contract (can not match byte code) on etherscan.io (mainnet)

We are trying to verify our smart contract code on mainnet to make a token but are unable to do so. We followed this tutorial, although we are using an older version of the code: https://medium.com/...
0
votes
0answers
35 views

HI, im a beginner solidity coder in an internship/training with a blockchain startup. I was tasked with a lottery contract that im having trouble with

Make lottery smart contract Entry fee 25000000000000000 Duration: Every 10 Minutes ○ 50% Winners and 50% Losers ○ Winner Gets 1.8X ○ Losers gets 0X I have come up with the following code //SPDX-...
0
votes
0answers
11 views

What to pass for abi encoded arguments

I had cloned usdc contract on polygon test network and deployed it. I want to test deposit method but couldn't able to figure what to pass in depositData( more specifically in which format should i ...
1
vote
1answer
25 views

How to pass array of addresses while testing the contract

I've written a contract... contract TimeLock is TimelockController { uint256 minDelay = block.timestamp + 4 minutes; constructor( address[] memory proposers, address[] ...
0
votes
1answer
16 views

Using payable functions in the remix ide

I created a simple solidity contract in the remix ide. I cannot figure out how to test the payable functions I created. here is an example of a payable function: function pay() payable { } here is a ...
0
votes
1answer
23 views

Recreating a re-entrancy attack but transaction failed/reverted, why?

I tried creating 2 contracts (Victim.sol and Attack.sol) in Remix, to recreate a re-entrancy attack, in particular the recursive function calling. Victim.sol is the contract to be siphoned, I ...
1
vote
1answer
17 views

Unable to withdraw/transfer funds from contract (using Remix)

I wanted to create a contract where wallets can deposit and withdraw funds, to test the re-entrancy attack. However, on deploying this contract in Remix VM (London), I'm unable to withdraw using the ...
0
votes
2answers
29 views

how to write a contract to set a reward for players and they claim the reward?

I want to create a contract to give the players rewards and they claim their rewards. It seems everything is ok! // SPDX-License-Identifier: MIT pragma solidity ^0.8; import "@openzeppelin/...
0
votes
1answer
11 views

Ownable function call from another function

I have two ownable functions (I'm using openzeppelin), when I invoke the second function from the first one, I get: "Ownable: caller is not the owner". function first() external view ...
0
votes
0answers
8 views

Remix price token implementation error

Please help me with the implementation of this contract. Blockquote// //AggregatorV3Interface internal priceFeed; /** * Network: Kovan * Aggregator: ETH/USD * Address: ...
0
votes
0answers
6 views

| ^ (Relevant source part starts here and spans across multiple lines). this error had occured while complining how to correct it help me out [duplicate]

// SPDX-License-Identifier: GPL-3.0 pragma solidity>= 0.5.0 < 0.9.0; contract Identity { string name; uint age; constructor() public { name = "Prem"; age =24; } function getName() view ...
0
votes
2answers
13 views

View function throws an error with block.number

Looking at https://docs.soliditylang.org/en/v0.8.11/contracts.html#view-functions I understood the solidity view function can work with any function unless it mutate states, emit events or perform any ...
1
vote
1answer
23 views

Forwarding Ether from one contract to another

I am currently try to write two smart contracts. Here is the first one: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract Token { mapping(address => uint) ...
0
votes
1answer
14 views

How to return mapping type in solidity?

I wrote a function that returns mapping type which contains all the tokenID and owner of the tokenID. But I get the following error when compiling. error: TypeError: Data location must be "memory&...
0
votes
1answer
21 views

Error while returning mappings in solidity

How can I return a list of mapping for a specific data? My purpose is to be able to view all the created offers to the users specifically by searching. Here is the code I wrote: contract MyContract { ...
0
votes
0answers
13 views

how can i fix these loop warnings and gas fee warnings. the code is compiled fine just want to update these warnings before launch

Here's the contract code to the token "alex". Below are the warnings from remix. Thanks for any assistance // SPDX-License-Identifier: MIT pragma solidity 0.8.4; contract alex { ...
1
vote
2answers
75 views

Expected Identifier but got '='

Trying to add a struct object to a mapping, however the compiler gives error that expected identifier. Here is my code snippet contract Structs { struct User { string name; ...
0
votes
0answers
35 views

Remix IDE not connecting to Ganache Web3 Provider

I'm trying to deploy my smart contract to Ganache (perferably the Ganache desktop app but this issue is also occurring for ganache-cli). When I select "Web3 Provider" under the "...
1
vote
2answers
55 views

Deploying a simple contract to ETH Mainnet (from remix) costing $500? Am I doing this wrong?

I have a simple contract that I've tested on my ganache network, and now I'd like to push it to the mainnet. So I funded my Metamask with around $100 or 0.025 eth, figured that would be enough to ...
0
votes
2answers
24 views

Solidity fund transfer is redirecting to another address

I am trying to send funds in solidity using the below code / SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract SendEther { function sendAmount() payable public {...
0
votes
0answers
7 views

How to see bytes in bytecode to estime gas cost of deployment

Pretty much title, trying to estimate my gas cost. I know each byte costs 200 gas. When I compile on Remix I see this object property. Is counting the number of characters in that an accurate measure? ...
0
votes
0answers
26 views

Error: Returned error: VM Exception while processing transaction: revert Transaction failed -- Reason given: Transaction failed

I am following a youtube tutorial for coding a smart contract for a MultiSigWallet. The code is working fine in Remix. All the functions, submitTransaction, confirmTransaction and executetTransaction ...
0
votes
1answer
21 views

Is the smart contract receiving funds or is it the address?

//SPDX-License-Identifier: MIT pragma solidity 0.6.12; contract ExceptionExample { mapping(address => uint) public balanceReceived; function receiveMoney() public payable { ...
0
votes
1answer
21 views

Have been having this error, ParserError: Expected ';' but got '}'

// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; contract will { address owner; uint fortune; bool deceased; constructor() payable public { owner = ...
0
votes
0answers
18 views

solidity ^0.8.0 - receiving payment failed at require(msg.value == ___ ether)

ide: remix injected web3 on ropsten network, issue: I'm new to solidity and reverse engineering a little 3 year old project while learning the breaking change from 0.4+ to 0.8.0 I'm not sure what I'm ...
1
vote
2answers
77 views

Message call to another contract with argument not working

Here I am trying to call contract A's callMe function from contract B using the low level function, call (bool success, )=_b.call(abi.encodeWithSignature("callMe(uint)",val)); But when I do ...
0
votes
0answers
28 views

why does my contract say honeypot?

https://bscscan.com/address/0x4451f5016724867fd00438eb30d5b2f23d3d69bd This is my code source. TokenSniffer does not pick it up and staysafu says its a honeypot, the token is tradeable
0
votes
1answer
27 views

Sending eth to deployed contract between 2 metamask wallets

pragma solidity >=0.7.0 <0.9.0; contract StructMapping { mapping(address => uint) public balanceReceived; function getBalance() public view returns(uint) { return address(...
0
votes
1answer
20 views

Understanding revert with array of contracts

I have the following solidity file: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; error MustBeOwner(); error BookDoesNotExist(); // book contract contract Book { ...
0
votes
1answer
27 views

Which address is paying the gas fee? And, can the smart contract pay the gas fee by itself?

pragma solidity ^0.8.1; contract SendMoney{ uint public publicBalance; uint public lockedUntil; function receiveMoney() public payable{ publicBalance += msg.value; ...
0
votes
1answer
26 views

How to add separative commas every 3 digits in solidity to an input integer?

Is there a way to add separative commas to large input numbers? let's say the input was 1000, I want the output for this function to be a casted string that has this format "1,000". Note: I'...
0
votes
1answer
19 views

Chain link Aggregator v3 Interface error?

Hello! I am following a tutorial that implements Chain Link's Aggregator V3 Interface, but it seems the code is not interacting properly with its import. Attempting to deploy on Remix brings up the ...
0
votes
1answer
18 views

Contract address balance function returns BN in truffle but actual balance in remix

I am very new to solidity, contracts, and truffle, and I ran across a disconnect between the results of calling the getBalance() function of this basic contract: contract TruffleTutorial { address ...
0
votes
0answers
10 views

Remix - Parser Error on pragma 8.11

I am using the newest version of pragma. 8.11 creating a contract for a token. I am getting a parser error at the bottom line stating expected pragma import directive. Can anyone help I feel like i ...
0
votes
1answer
31 views

Contract charging fees only on sell

The contract below charges fees only on the sale of the token. Nothing is charged on purchase. I can't find which part of the code this is in and how to change it Initially I imagined that there was a ...
0
votes
0answers
14 views

Why ISN'T my GUI interacting with my smart contract?

I successfully deployed an Ethereum smart contract within the Web3 Provider environment, and I am able to successfully interact with the various functions only via the Remix IDE. Find below my ...
0
votes
0answers
15 views

HELP! Accidently Deleted Remix Work Space

I accidently deleted a workspace in remix and cannot figure out how to get it back! my token launches in two weeks!
0
votes
1answer
25 views

What is the meaning of this arguments in this curly brackets

Pls how do i interprete this argument in this curly brackets marked in red. I'm a beginner in solidity programming and I am have a hard time interpreting this arguments and what does the arguments ...
0
votes
0answers
17 views

Solidity error basic programme

I am not able to find the error to this problem Can anyone please help me with it It is showing that hasDeceased function is having some error... Not able to access the function ...
0
votes
1answer
15 views

How do I pay functions in remix?

I am making an NFT vending machine. Here's the code: // SPDX-License-Identifier: MIT pragma solidity ^ 0.8.10; contract VendingMachine { address payable internal vendingAdmin; struct item { ...
0
votes
1answer
51 views

How to add a fee for each swap

I'm making a small NFT tool and I'm having troubles calculating the fee and making the user pay for it, the fee itself is 0,10% and I want to apply it to each time the function createMarketSale is ...
0
votes
1answer
30 views

Why does my contract deployment in Remix get stuck at "creation of contract pending"?

I am using Remix in Chrome. When I click on deploy, my contract gets stuck on 'creation of contract pending'. Can someone help me please?
0
votes
1answer
28 views

Adding whitelist batch function

So for my project I want to add a function that allows me to add multiple addresses and assign a name to those addresses that will be later used for minting their NFTs. This function takes in an array ...
0
votes
2answers
31 views

Can you deploy contracts to the mainnet with remix.ethereum?

As the title. Is it possible to deploy your .sol directly to the mainnet with e.g. MetaMask? What options do I pick in remix 'deploy' to do this? Once it is deployed, what is the simplest way of ...
0
votes
1answer
17 views

How to input a value into a function without parameter on Remix?

I read this where it has a function deposit() as below, without any parameter. We are supposed to send a value to msg.value but how do you do that in Remix as I can't find one text field for deposit ...
1
vote
0answers
25 views

Cannot run default JS script from within Remix?

just getting started with Remix. I want to run the default deploy_ethers.js script and see there are two ways to do it: Right-click on the script and hit "Run". Open the file and run remix....
0
votes
1answer
15 views

Accidentally published a useless contract when working in Remix. How can I withdraw the contract from IPFS? Should I care?

I am working on a versity exercise, a small and basic contract. Beginner as I am and tired as I was, I accidentally pressed Publish to IPFS instead of the Deploy button. How would I withdraw that ...
0
votes
0answers
13 views

How to import deployed contact on public testnet into remix [duplicate]

I see that there are lots of information on how to deploy your contact to rinkbey using remix but not vice versa. I want to copy deployed contact from rinkbey testnet to local Blockchain simulator ...

1
2 3 4 5
50