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

Transfer token failed due to Gas estimation failed

Have issue transfer token, hope to get support from this. my contract https://rinkeby.etherscan.io/address/0x6D96673922d54108e8eFaFDe191Dc473dCeE709B pragma solidity ^0.5.0; import "github.com/...
0
votes
0answers
28 views

Is an ERC721 Burn event to send ERC20 tokens to that owner possible?

Trying to burn a minted ERC721 token and have the contract transfer to that owner a number of ERC20 tokens deposited beforehand to the ERC721 contract address. However I get a Remix JavaScript Vm ...
0
votes
1answer
14 views

Passing Object to smart contract's payable function

I'm developing a contract where I should be able to pay multiple user's addresses. I'm using TRON blockchain. I can use the TRONIDE developer API to send funds. But they recently shutdown their API ...
0
votes
1answer
23 views

Smart Contracts for the Blind Auctions

In blind auctions from solidity documentation what value should I insert under the bid function?Even I inserted string value,integer value under the bid function but it is showing the error as invalid ...
0
votes
0answers
20 views

Solidity contract: How to deal with return parameters in solidity

i am having an issue with an function I would like to call. Following case: The function looks like this: Params Type token0 IERC20 token1 IERC20 amount uint256 parts uint256 flags uint256 and ...
0
votes
0answers
9 views

“Revert: VM Exception while processing transaction” while trying to swap with 1Inch

since a while I am trying to program a swap contract for 1Inch. The problem is that I always get a Revert message when trying to call the function. I made sure that the contract has enough funds from ...
0
votes
1answer
12 views

Solidity compiler and Deploy & run transactions buttons are missing in Remix

Solidity compiler and Deploy & run transactions buttons are missing in Remix. I tried many times to refresh with no result.
0
votes
0answers
11 views

View in a function makes the other not working

Sorry, new here. I look up everywhere but couldn't find an answer. Got these 2 simple functions. Can anyone explain why if i add "view " in the setUser function (first one) the other ...
0
votes
0answers
11 views

Token not visible under “Tokens” on Etherscan

I have deployed an erc20 token contract to rinkeby, ropsten using truffle. Each time the contract is deployed properly. However, the token details are not visible under 'tokens' in etherscan. Please ...
0
votes
0answers
28 views

Swaping ETH to DAI on Uniswap

I don't get why when trying to deploy my contract it says that gas estimation errored. Forked Mainnet with ganache-cli -f <INFURA_ID> Trying to deploy and execute following code: pragma solidity ...
0
votes
0answers
16 views

Fee for creating new ERC20 token is too high [closed]

I am creating a basic ERC20 token and experienceing very high fee when deploying on mainnet. Wonder when transaction fee is only $8, my deployment wants around .05 ETH Here is the alert. You are ...
0
votes
0answers
6 views

Determining value of variable: How to check the value of Log in the new version of Remix IDE

I am getting problem in understanding the working of the latest version of Remix IDE. I want to see the value of variable (i.e. Val). I am trying to run the following code: pragma solidity ^0.5.1; ...
0
votes
0answers
20 views

when i run the below code ,Getfrom function asks for byte32 transfer_id ,which byte32 hash should i give to display output? [closed]

pragma solidity ^0.7.0; contract peertopeer { enum State { None, Initiated, Confirmed } enum TransactionType { Unknown, Deposit, Withdrawal } struct Transfer { address buyer; address seller; ...
0
votes
0answers
12 views

Remix (or any other tool): Solidity program to EVM opcode

I am interested in obtaining sequence of opcodes for a Solidity program: One example is given in the following program obtained from Link of paper I have attached the image also I need a link to a ...
1
vote
1answer
27 views

when msg.sender is the owner?

how do I know if the msg.sender is the owner (the person that deployed) of the contract or a random address that interacted with the contract? in this case for example: address payable owner = ...
0
votes
1answer
16 views

when i pass values in request transfer and call sent simple event function ,get functions are not showing any changes

pragma solidity ^0.7.0; contract peertopeer { enum State { None, Initiated, Confirmed } enum TransactionType { Unknown, Deposit, Withdrawal } uint toyprice; struct ...
1
vote
0answers
15 views

Debugging contracts on a mainnet fork with Remix

I'm developing a contract that relies on some states of other contracts currently deployed on mainnet. I'm after a way to test and debug my contract without having to deploy to mainnet first. I'm ...
0
votes
1answer
13 views

how to resolve return argument implicitly convertible to expected type address

function getFrom(bytes32 transferId)public returns (address ) { Transfer memory transfer = transfers[transferId]; if (msg.sender != transfer.to && msg.sender != transfer.from) ...
0
votes
1answer
18 views

how to pass address(0x0) to remix?

I want my users call a function and send some deposit to contract. I want them to chose whether they want to send ETH or ERC20 tokens. I have my code and I see no flaw in it. but how can I pass ...
0
votes
1answer
46 views

Can't call “addLiquidityETH” Uniswap function from my contract

I'm a newbie, have been learning Solidity for 6 months now. I have been trying to fix this problem for couple of months but still got no hope. I'm trying to learn how to add liquidity to Uniswap by ...
0
votes
1answer
13 views

What is wrong in require()?

The voter can be registered only once but the code below registers more than one voter with same address struct Voter { string name; uint8 age; bool voted; address voterID;...
0
votes
2answers
29 views

How to I initialise an array inside the contructor in solidity?

I'm using the remix IDE.I want to define the size of the array at the time constructor is called. Someone please help. This is what I tried : pragma solidity >=0.7.0 <0.8.0; contract Vote { ...
0
votes
0answers
33 views

What's wrong with my buyToken function?

Here is my solidity interface IERC20 { function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external ...
0
votes
0answers
12 views

Arrays not showing up inside structures

I am creating a record of people and have created a structure struct asset{ uint assetId; string hash; address creatorAddress; uint cost; uint soldCount; } struct person{ uint ...
0
votes
0answers
13 views

Deploying ERC20 Error

I'd like to deploy follow "StandardERC20" token to kovan test net using Truffle. I want to deploy same contract like "https://etherscan.io/address/...
0
votes
1answer
24 views

How to restore sol file for Remix?

I was writing and testing some contracts using Remix. I worked just fine, but for some reasons the sol files didn’t load up today. I tried to search it in my local storage but could not find them. Can ...
2
votes
1answer
23 views

73: TypeError: “send” and “transfer” are only available for objects of type “address payable”

This is my simple code for following along a tutorial. We are building a Lottery Smart Contract. However, I am failing to transfer the contract's balance to the winner. (see the last line inside of ...
0
votes
1answer
37 views

How to get an interface form smart contract

I have a Smart Contract that I deployed on the blockchain. I would like to create another smart contract that will call the first smart contract. I would like to create an interface containing method ...
0
votes
0answers
14 views

Error at calling the memory function

I am using an remix ide for the smart contract development, at the time of compilation of the below code I am facing the error of expected primary expression. Could anyone help me out with this ...
0
votes
1answer
30 views

Unable to interact with a contract on Kovan network on Remix IDE

I am working on a project and I have successfully deployed a smart contract on Kovan test network, but for some reason, I am not able to interact with it in JS code. So, now I want to access it ...
0
votes
1answer
14 views

Sending token dynamically

uint h =10; p.transfer(10 ether) p.transfer(h ether); The second line is working but I need to send token dynamically as in line 3, but it is showing an error. How can I resolve it?. I am using 0.7.6 ...
0
votes
0answers
38 views

ParserError: Expected ';' but got '{' (bool success, ) = recipient.call{ value: amount }(“”);

pragma solidity ^0.6.0; library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created ...
0
votes
1answer
13 views

Solidity: How to enter a value in a dynamic array inside a struct?

I'm working on the following code in Remix IDE. What I'm trying to do is create an object of a structure that is mapped to an address. Inside the struct, there is a dynamic array. How can I put a ...
0
votes
1answer
12 views

Create new UI for deployed contract with remix?

Is there any way to create new UI for a contracted deployed with Remix? I know, I can use remix and Metamask to deploy contracts to real ethereum networks (Main, Rinkeby,...) and remix provides us a ...
0
votes
1answer
24 views

Import wants >=0.6.0 but the import of the import is ^0.5.0

that solidity compiling is a mess :frowning: I’m trying hours to find out why my contracts sometime compile and sometimes not … Now I got it … I'm using a local ganache server and the online IDE remix....
1
vote
1answer
32 views

How to add numbers in Solidity without getting an error?

I don't understand why this doesn't return 11. I hope someone can help me with this. Thanks in advance! pragma solidity 0.8.0; contract a { uint256 numberA = 5; string operator = "+"...
1
vote
1answer
36 views

Error Transaction revert / no balance but Balance is there

contract MyToken is ERC20 { constructor () ERC20("StableToken", "STBL") public { // Mint 100 tokens to msg.sender // Similar to how /...
1
vote
1answer
20 views

Add and compare items of struct in Solidity (dealing with struct in Solidity)

How can I know the whole entityData of the struct and add a new entity only if it didn't exist before (ensure no replicated data)? struct EntityStruct { uint entityData; bool isEntity; bool ...
0
votes
1answer
47 views

How to call external ERC20 token transfer function

I am trying to transfer ERC20 token from another smart contract. For that I am following this article. So I wrote the smart contract as following, pragma solidity >=0.4.23 <0.6.0; interface ...
0
votes
1answer
19 views

How to get the current selected account in Metamask?

How to get the current selected account in Metamask? I've seen things like this as the answer to this.. const accounts = await web3.eth.getAccounts(); const account = accounts[0]; But doesn't this ...
0
votes
1answer
12 views

theres a way to automatically import all imports you need in contract (that are on your computer) to remix ide

I have a remix ide contract and somehow I added all the imports automatically from my computer files im assuming. Does anyone know how to replicate this as i am trying to do it again and cannot find ...
0
votes
1answer
31 views

Trying first transfer contract in solidity

So i´ve been experimenting with Solidity and Remix and i wanted to and a simple while loop to the .transfer and .balance method. While being able to deploy the contract, I can´t seem to be able to ...
0
votes
1answer
34 views

Why does this payable address fail to transfer funds?

contract MyContract { address payable public owner; address payable public withdrawAddress = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2; constructor() public { owner = msg.sender; ......
0
votes
1answer
12 views

Why did I get an error about using memory keyword in function getname?

// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; contract s12 { uint public age; string public name; bool rollno; constructor() public { rollno= false; } ...
0
votes
0answers
17 views

BlankToken Transaction

So i deployed my smart contract on Kovan Network using Remix IDE, i after successful compilation I added the arguments of the constructor to create the token, it deployed successfully but the issue ...
0
votes
1answer
15 views

Bytes32 and Data Payload question

Hello Solidity Expert, I am working on Ethernaut challenge 8 called Vault: Ethernaut See the contract code at the end of this post. I feel I solved the challenge but for some reason I cannot open the ...
1
vote
2answers
183 views

Always get `Dai/insufficient-allowance` error

Scroll for EDIT I'm using Solidity 0.7.5 and I'm trying to swap DAI to ETH from my account, through UniswapRouter02. Here's my environment REMIX IDE Metamask with KOVAN testnet I have about 2 ETH and ...
0
votes
1answer
27 views

How to withdraw a contracts funds?

How can an address withdraw a contract's ether? contract MyContract { address payable public withdrawAddress = 0x........; constructor() public { owner = msg.sender; } function ...
0
votes
1answer
17 views

how can I make function of another contract callable?

Obviously there is a problem with the deploy procedure or the remix IDE, but how can I make the function callable? pragma solidity> = 0.5.0 <0.6.0; import'openzeppelin-solidity / contracts / ...
0
votes
1answer
29 views

false Transaction mined but execution failed

I was trying to deploy my smart contract to Kovan test network using Remix IDE,although it compiles successfully but when I try to deploy it I get this error message "false Transaction mined but ...

1
2 3 4 5
37