Questions tagged [remix]

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

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

parse error: Expected ';' but got '('

// SPDX-License-Identifier: MIT pragma solidity ^0.8.2; contract TetherToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; ...
0
votes
0answers
47 views

Problem with "Verify & Publish Contract Source Code" on BscScan

I wanted to "Verify & Publish Contract Source Code" on BscScan, but I get this message: ParserError: Multiple SPDX license identifiers found in source file. Use "AND" or "...
0
votes
1answer
15 views

variable value is one execution behind on Polygon

Consider the following .sol file: pragma solidity ^0.8.3; contract Testing { string public astring="firstvalue"; function setString(string memory newValue)public{ ...
0
votes
0answers
17 views

why does any contract i write to the blockchain look like this

ive tried about 40 different contracts and they all do not show as a token, ive tried bsc,bsctestnet, pulsechain testnet. when i try to verify the code on bscscan it says the byte code doesnt match it ...
0
votes
1answer
23 views

I could not find the deployed smart contract and coins

I took the safemoon contract from github, changed the name, compiled and deployed with remix. there seem to be no errors, but I can not find any contract or coins ...
0
votes
0answers
16 views

Adding an additional 2% fee

I have been struggling for days and I was wondering if I could have some help. I am going to launch this Ethereum Based ERC-20 token and I am going to list it on Uniswap, and I want to add an ...
0
votes
1answer
109 views

Get all tokens owned by an address under the same ERC1155 contract

I am making an ERC 1155 contract and it is a mixture of NFTs and FTs, my intention is that from a token id forward, the user only be able to own one of the token, something like the minting below: ...
0
votes
1answer
17 views

How output of abi.encode calculated

I'm still learning solidity but having some hard times while trying to understand how abi.encode works. I mean when i try to see it's output i see a long hex value. For example if i call this function ...
0
votes
0answers
21 views

how to send 15 percent dividend to all token holders?

This is the code for dividend token. when we have a supply of 100 and when we deposit 200 ether then our dividend will be 2 ether per token. Question 1: my question is we have a dividend ...
0
votes
0answers
63 views

How to keep uniswap v3 getPool function from reverting in Remix

I am trying to write a contract that can fetch a uniswap v3 pool address for different pairs of tokens. To start, I just hardcoded in some addresses to see what would happen. pragma solidity >=0.5....
0
votes
0answers
12 views

Remix deploy: pass account password

I use my web3 as account provider. When I deploy it asks for password, I can see that in clef logs ## Account password Please enter the password for account 0x1554ce5a208c80D6087d73296E65405002cd640e ...
0
votes
0answers
8 views

How to recover lost sol files in remix Safari 14.1.2

I was using remix IDE in safari a few weeks before. But today when I open remix and all my sol files in default_workspace disappeared. It seems that remix reset itself back to factory default. I am ...
0
votes
0answers
12 views

Connecting to localhost failed and sol files were lost in remix safari

I open remix.ethereum.org today on Big Sur safari (14.1.2) and found all sol files were lost and not visible. I tried to connect to localhost and activate remixd in plun-in manager and they all failed ...
0
votes
0answers
11 views

Uniswap Clone fails to show and use liquidity pool after providing liquidity. What is the mistake?

I tried to clone uniswap. Procedure completes but it fails to import liquidity pools. Also making it unavailable for swap. I recorded the entire video to demonstrate the actions. I tried this on kovan ...
0
votes
1answer
44 views

How to hide tokenURI values from other people

I am looking for a way to hide the tokenURI values from other people as they can call the tokenURI contract from etherscan and by editing the URL of it, they can snipe the rarest NFT's in my project ...
0
votes
0answers
43 views

how to code erc20token with minting function for specific amount for every specific interval of time..?

say i have "Total_Supply=2750000000tokens",we need to "mint=2150000000tokens" for every day up to 360 days, like to mint 2100tokens for every half'n hour(30 min) totally(...
0
votes
0answers
10 views

unable to change compiler version from latest local version in Remix

I am using Remix and unable to change compiler version from "latest local version" since there is no drop down.
0
votes
0answers
91 views

ERC20: transfer amount exceeds balance - working with transfer with ERC20

I am trying to call transfer of an ERC20 token from another "escrow" smart contract in remix JavaScript VM (London). I have 2 contracts like so: MyToken.sol (an ERC20Votes.sol, but "...
0
votes
2answers
23 views

How do I execute functions in my ERC20 token?

How can I manage to execute functions from my ERC20 token created with remix solidity and deployed on the ropsten test network? I was able to import it to my metamask account but I want to perform ...
0
votes
0answers
41 views

Deploying to ETH mainnet with Remix Gas Fees

When deploying with Remix to ETH mainnet, is it fine to leave the max gas fee as Remix suggests? It seems to be low and I don't want the deployment to fail. Metamask suggests a much higher gas fee. It ...
0
votes
2answers
15 views

What would be the easiest way to return specific bytes range from bytes32 variable?

Full bytes32 var: 0x01000000000000000000000000000000000000000000000000000000ffffffff function checkExpAmount(address _addr) public view returns (bytes4) { return players_data[_addr].playerData[28]...
0
votes
0answers
27 views

Error swapping Tokens for ETH using Remix IDE

I have a smart contract that I've deployed to the RinkyBy Network Via Remix: // SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; interface IUniswap { function swapExactTokensForETH( ...
0
votes
0answers
13 views

primary expression error

I got this error on line 22, I'm trying to set up a presale contract for a new token. event transfer.balance[msg.sender] = safeSub(balances[msg.sender], tokens); // SPDX-License-Identifier: MIT ...
0
votes
0answers
10 views

Undeclared identifier when using function from imported file

I want to import this function in another contract but I received the error from the screenshot below. This is the function I want to import: function assetTransfer (string memory order_id,string ...
0
votes
0answers
25 views

I am not able found ABI ,Write and read contracts in Bscscan

I am getting ABI for my contract,instead i am getting [].After deploying the contract in remix IDE ,after verification process.I am not getting write and read contract
0
votes
0answers
14 views

Insuficient funds, mainnet > 2000$

I'm trying to deploy an NFT contract using remix. I've deployed in development, ropsten and now mainnet. The value is approximately $2,200 to deploy the contract. Is this okay or my contract that ...
0
votes
1answer
90 views

Swap ETH for Tokens and Back on Remix

I'm just trying to create a simple smart contract which can swap eth for tokens, and then swap those tokens for ETH back. This is my code: // SPDX-License-Identifier: agpl-3.0 pragma solidity ^0.8.7; ...
0
votes
1answer
19 views

Solidity: State Mutability Warning

This line of code changes state when a new owner is set, but remix still wants to me to mark the declaration with view, which reads from the contract. Why is that? pragma solidity ^0.8.7; function ...
0
votes
1answer
19 views

Transferfrom and approve not working

I have erc20 tokens. Now I want to send these tokens to the current contract. How can I send it? function bid(uint256 tokens) public { require(block.timestamp < time,"time exceeded"); ...
0
votes
0answers
27 views

presale options for polygon

I've seen a few different options but was having a hard time figuring out which would be best. I was thinking of using because it seems the most straight forward, but since I'm a novice I was looking ...
0
votes
1answer
72 views

Remix code got deleted automatically

I created a small smart contract on Remix IDE. Compiler passed the contract without error. However, when I switch back to my contract after opening another contract file in remix, the solidity code ...
0
votes
0answers
26 views

remix error Expected primary expression

The error is happening on line 16: pragma solidity 0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@...
0
votes
1answer
31 views

Mint erc20 tokens

I mint 1,000,000 of tokens (MAX SUPPLY). I want that 50% of the tokens can be minting like a reward. I have to send that 500,000 tokens a wallet or i can leave it in the contract?
0
votes
1answer
10 views

How to prompt an error message when user inputs invalid argument to the public getter function

I'm new to solidity and smart contract programming. I'm currently using the online remix IDE to run my program. I want to display a error message when the user tries to ask for the value of an array ...
1
vote
1answer
111 views

Why can I not get Remix to deploy to Polygon Mainnet?

I have a contract that I have deployed to both Ropsten and Fantom Mainnet. I want to try it with Polygon. I have plenty of Matic, the contract compiles, but when I try to deploy it I get the error: ...
0
votes
1answer
20 views

ERROR: transact to Lottery.(receive) errored: VM error: revert

I have been developing a personal project and I am getting this error: transact to Lottery.(receive) errored: VM error: revert. Can someone help me? // SPDX-License-Identifier: GPL-3.0 pragma ...
1
vote
1answer
49 views

VSCode and parser not recognizing import statements

When I try to use brownie to compile my solidity code on VS Code using brownie compile, it throws an error, saying my contract should be labeled as an abstract. However, the parser is not recognizing ...
0
votes
0answers
29 views

How to use contract function to send a message to a Rinkeby blockchain?

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1....
0
votes
0answers
13 views

Executing contract in compiled code form

For certain contracts on Ethereum (example), I can connect my web3 wallet and execute functions. For others (example), I don't see this option on Etherscan -- instead there is a link to verify and ...
0
votes
1answer
36 views

How to update an array of struct?

this is my code: struct Entity{ address _address; uint data; } Entity[] entityArray; function addEntityArray(uint _data) public returns(uint){ entityArray.push(Entity((msg.sender), ...
0
votes
1answer
44 views

Create a MAX SUPPLY to Mint ERC20

I want to create an ERC20 on Solidity. I want 1000 TOKENS of MAX SUPPLY (Like the 21m of bitcoin). PERSON A: Mint to his wallet 700 Tokens. (Thats okey) Only 300 Tokens are available. PERSON B: Mint ...
0
votes
1answer
54 views

How to specify max supply ERC20

im creating an ERC20 token and i want to specify a maximium supply for my token? I want to mint 2000 tokens. 1000 of that tokens to my wallet, and leave in the contract the other 1000 tokens. Is that ...
0
votes
1answer
18 views

incrementing and transfering to Holders

Hallo guys Every time i try to sell and distrbute to Holders i get reverted transaction Hash : 0x511a62a40ac43fef117bba410bb375eb67e5ae964c29f3f2d400c04fb0a79562 the Debug shows fail in the Sell token ...
1
vote
1answer
53 views

addliquidity() function revert every time

I am having issue with Uniswap addLiquidity() function. I tried a lot of things but I didn't. Here is my code. I am trying on remix. edit: i am just trying add liquidity weth and dai not new pair. ...
0
votes
0answers
27 views

How to fix transaction reverted while selling token?

transact to FpsCrowdsale.sellTokens errored: VM error: revert. The transaction has been reverted to the initial state. Reason provided by the contract: "ERC20: transfer amount exceeds allowance&...
0
votes
0answers
35 views

The called function should be payable but I don't want it to be payable

I already checked the internet for possible solution but none could help me. I'm using Solidity ^0.8.7 Below is a function to update a ranking of addresses and is triggered by function transfer(). ...
0
votes
1answer
26 views

How can i create a token ERC20 with a customized function

I want to create a and ERC20 token with a specially function. The question is the following: PERSON A: Create 1000 example Tokens. PERSON B: Execute a function that mint 10 of that example Tokens. Im ...
0
votes
1answer
111 views

Is there a way to programmatically set gas limit?

My smart contract has a centralized web app as front end using Ethers.js to communicate (in a Flutter app). When I'm executing a function, I need to pass the gas limit. How can I know what is a good ...
2
votes
1answer
281 views

Low Level Calls in Solidity

I am a beginner to solidity and I came across this concept called "Low-Level Calls". What exactly is a Low-level function? and How is it different from others?
1
vote
2answers
64 views

Chainlink "TypeError: Immutable variables cannot be read during contract creation time..."

I have tried using @chainlink/contracts many ways (truffle, hardhat, remix). In all cases I run into an error that seems to be some bug deep inside on the chainlink library: > Compilation warnings ...

1
2
3 4 5
48