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

How do I execute this Timelock contract on Remix Ethereum?

i am using a timelock smart contract but im not sure how to input the proper value to use this function on remix. what exactly do i put in data byte field? how do i get that data from the other ...
0
votes
0answers
9 views

How to add Lock Function on solidity?

I have code for the ERC20 token which has freeze, unfreeze, lockUser & unlockUser functions. I want: When I lock someone he will be automatically unlocked after x days or, Scheduled release of ...
0
votes
1answer
14 views

The called function should be payable if you send value and the value you send should be less than your current balance. WITH NON-Payable functions

I have the following functions function balance() public view returns(uint152) { return uint152(IERC20(token).balanceOf(address(this))); } function balance1() public view returns(...
1
vote
0answers
13 views

My contract shows a zero balance on Metamask

I just need some help on a contract I'm doing an experimental project token for. My setup as follows: Using Remix for solidity Metamask account linked Contract is using pragma ^0.4.4 (original code ...
0
votes
2answers
20 views

Declaration Error: Identifier already declared

I'm having a problem declaring the enum Stage. The previous declaration is here: enum stage {Init, Reg, Vote, Done} Changing the Stage name doesn't help: enum stage {Init, Reg, Vote, Done} Stage ...
0
votes
0answers
23 views

UniswapV2Router02.addLiquidity false Transaction mined but execution failed

The two tokens have been approve to the router contract, but they always fail when the addLiquidity method is called. "false Transaction mined but execution failed" is displayed in remix. ...
0
votes
0answers
19 views

Cant receive wETH to my contract after swap on uniswap

I write a simple contract to do a flash loan from aave and interact with uniswap in it. I found out that no wETH is sent to my contract after swaping on uniswap. Transcations are here: https://kovan....
0
votes
0answers
100 views

How to convert my custom ERC20 token to BEP20?

I have my custom token on the Ethereum network and I want to send part of the tokens to the binance smart chain. That is, issue a wrapped token.For example: https://etherscan.io/token/...
0
votes
1answer
40 views

Web3 how to send ether from client Metamask to contract address native receive function?

I wonder how can I natively pop-up the MetaMask window to send specific amount of ether as a donation to already defined SC address and ABI? Short code intro: pragma solidity >=0.7.0 <0.8.6; [......
0
votes
1answer
33 views

swap token for usdt, create function send 1 usdt and receive 1 token

I need to create a smart contract where each token of mine will be exchanged for 1 usdt, that is, a person sends 1 usdt to the function and he adds 1 token to his balance sheet. How can I do it? with ...
0
votes
0answers
17 views

Converting Remix ABI JSON statements to ABI-encoded Constructor Arguments

I am using MetaMask wallet with test-Ether via the Rinkeby faucet on Rinkeby test network to create a smart contract via Remix and Etherscan. The code is basically using the functions from the ...
1
vote
1answer
47 views

Security implementation of a function in Solidity

I'm here for asking some tips on calling function from other contracts in solidity. Here is the function for generating a random number (which I need in the main contract) using the chainlink VRF. ...
0
votes
1answer
30 views

Gas Cost of a Single Function

how can I check the gas cost of a single function in my smart contract? Thank you
0
votes
1answer
15 views

Deposit Money Automatically On Child Creation In Factory Pattern

I am implementing a factory pattern contract and on my constructor I want to deposit money into my child contract as soon as the child is rendered --Factory-- function newChild() { Child child = ...
0
votes
0answers
46 views

How to interact with the functions of my smart contract in Hardhat?

I am learning to program in Solidity and have followed a basic tutorial on creating a smart contract from a number counter. The tutorial was followed by using Remix and I was very clear about the ...
1
vote
1answer
42 views

How to pay an Oracle with Link token if I have payable with Ethereum values?

First of all, I'm new to this smart contract world, and so I would like to apology if it's a stupid question. I'm programming with Remix and with Solidity as programming language.I have 2 files: ...
1
vote
1answer
29 views

What is meaning of logical comparison of ethereum address | solidity

I am reading this smart contract. In that smart contract, they are comparing two addresses. (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); What is the ...
0
votes
0answers
23 views

Where should I put the estimate gas produced by the remix IDE in my code?

I'm creating the ERC20 smartcontract transfer with web3. I just want to use gas optimally so that users want to do token transfer. From the Remix IDE I got the GASESTIMATES. But I don't know where to ...
0
votes
0answers
23 views

Gas estimation failed when send a transact

When I run sendDeposit function, everything works fine, but when I try to run startSession function an error saying : "Gas estimation errored with the following message (see below). The ...
1
vote
0answers
8 views

What is the advantage of --asm option in solc, how can we compile the contract using --asm option in online remix tool?

Kindly guide me the advantage of --asm option in solc compared to run-time and deployed opcode facility in REMIX, and how can we compile the contract on online REMIX tool using --asm option? Zulfi.
0
votes
0answers
22 views

Detect Lock/Unlock actions in MetaMask

I want my dApp to detect Lock/Unlock actions in MetaMask, just like in: Remix=>"Deploy & Run transactions"=>"Injected Web3" ethereum.on('accountsChanged'... - is not ...
0
votes
0answers
25 views

Gas estimation error when funding HTLC

I have a hash time lock contract on remix and using my metamask test accounts on Kovan testnet. I am trying to test the hash time lock contract by deploying the contract and funding it with some erc20 ...
0
votes
1answer
28 views

I want to store decimal value in a storage variable and later use that variable at same precision in the formula later internally

I want to store uint public MINTING_VELOCITY = 0.000002; And later use it in the formula: A x t x MINTING_VELOCITY ,where A = 2000 ,t(staking_duration_time) = 120 Issue is currently MINTING_VELOCITY ...
0
votes
1answer
29 views

How to send ether from sender account to a given account

I am new to solidity and trying to develop a small smart contract. I want to send ether from the sender account to a given account. But I always get this error "VM error: revert. revert The ...
1
vote
1answer
93 views

Remixd Error when Hooking up shared folder to Remix

The first type of error occurs when I run the listener on my Windows 10 using a terminal (powershell). The listener (remixd) starts OK then when I go to connect to the browser session I get the ...
0
votes
1answer
23 views

troubles with import in Remix IDE

I have the following error when try to compile: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol:5:1: ParserError: Source "https://github.com/...
1
vote
1answer
12 views

what is the reason for extra gas burned with truffle?

I have a complex smart contract which I want to deploy in test net (then main net). When I deploy the contract in rinkeby using remix (enabled optimization) It only cost round 3 millions gas. but When ...
1
vote
1answer
38 views

How to generate solidity encode function signature from Javascript?

What I am trying to achieve is like , i should be able to call a set of solidity functions dynamically based on some criteria. i'm using call() method to achieve the same. (bool success, bytes memory ...
0
votes
1answer
13 views

Increase values in array

I am increasing the value at a particular index in Solidity but it is giving me bad instruction error. Can anyone tell me what I am missing here? Please check the sample contract for reference: pragma ...
0
votes
2answers
142 views

Invalid Big number

When i try to deploy my example contract it gives me the error creation of Auction errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", ...
0
votes
1answer
14 views

How to pass quotes inside a string via remix?

How do you pass in a value as a string via remix - if that value includes quotes? For example A function takes a string - in remix I enter: <path id="svg_1" d="m-44.5,88.5c234,144 ...
0
votes
1answer
20 views

Contract Polymorphism based on address type cast issue

I am new to solidity and having difficulty understanding polymorphism and address typecasting of contracts. I am passing the address of child_1 contract to getChild2Value(address adr) which type cast ...
0
votes
0answers
26 views

invalid opcode error

I would like to set array contents using data present in another one. I'm tring to use the function below but got opcode error. Can anyone explain me why? function getfreecars() public returns(uint) { ...
0
votes
1answer
13 views

Cannot activate “deploy and run” plugin

I'm completely new to blockchain development and remix. It's my first time ever using Remix. Apparently "Deploy and run transactions" plugin is already activated by default. However, the ...
0
votes
1answer
40 views

Solidity: Wrapping an ERC20 token inside of a new token

Is it possible to wrap and track a ERC20 token amount in another token? Would I need to use ERC-721 to do this? Let's say I send my ERC20 token to a specific smart contract which will wrap it in a new ...
0
votes
1answer
20 views

Push large number of items in mapping with constructor or other methods

I would like to push large number of items into mapping. Prototype looks like this mapping (uint => string) ipfs_hashes; constructor() ERC721("GameItem", "ITM") public { ...
0
votes
0answers
5 views

Remix error when deploying

Getting the following error when hitting deploy to Ropsten network creation of EventExample errored: call to plugin has timed out compilerMetadata - deployMetadataOf - {"from":"udapp&...
0
votes
0answers
7 views

Is there a way to use remixd with the Remix electron app to access local filesystem?

I'm using the bundled remix electon app, and it's quite cool, but I was just wondering if there is a way to use remixd with the Remix electron app to access local filesystem? It seems that to use ...
0
votes
1answer
18 views

array problem invalid opcode

new to ethereum. I'm tring to write smartcontracto to manage car rental. Can anyone explain me why the function to insert new car is not working (code below): function insertnewcar(string memory model,...
0
votes
0answers
18 views

How to get rid of “Gas estimation errored with the following message” in this case?

In my front-end, I try to call a function called endAuction. In endAuction, I transfer payment to a seller and participants. While calling it from the front-end the transaction fails without any ...
0
votes
0answers
14 views

What is the purpose of EVM tags, their haphazard arrangement and their relationship to functions?

I want to understand the purpose of tags in EVM assembly and their relationship with Solidity function. pragma solidity ^0.5.1; import './Mod.sol'; contract MOFTest{ ModifiedBank mb; ...
0
votes
1answer
23 views

How to call a function in parent contract from children contract?

I am new to solidity.. please bear with my foolish question I would like to get the variable called num in a parent contract from its children. So, what I have in my mind is to try to get the address ...
1
vote
0answers
34 views

org.web3j.protocol.exceptions.ClientConnectionException: Invalid response received on web3j on Android

I am trying to execute transactions by calling my RegisterNewUser function in the deployed smart contract through Android and I am using Infura. However, when I run, there is an error as seen below : ...
0
votes
0answers
20 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
1answer
18 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
27 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
24 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
13 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
18 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
12 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 ...

1
2 3 4 5
38