New answers tagged

1 vote

Newbie question

If you want to pass the value while deployment, then you need to make the constructor() as payable, like this: // SPDX-License-Identifier: MIT pragma solidity ^0.8.18; contract FundMe { ...
SYED ASAD KAZMI's user avatar
0 votes

Gas estimation failed - remix

I solved this error in remix by changing the compiler version to the latest and on the deploy section, i also changed the environment from injected provider to remix vm sepolia fork. Kindly note that ...
Abigirl's user avatar
1 vote

How multiplication and division works in solidity?

When it comes to the order of precedence of operators, according to the Solidity documentation, multiplication, division and modulo are evaluated before addition and substraction. On the other hand, ...
Gabriel Stoica's user avatar
-1 votes

How multiplication and division works in solidity?

Could you please point out which refer link to According to solidity precedence, multiplication has precedence against division? As my know, because solidity don't have float, and it will be run from ...
CT95's user avatar
  • 386
1 vote
Accepted

How to determine whether code is running in a JS VM such as Remix, as opposed to ETH mainnet?

One way is to check block.number. In the Remix VM environment, it will increment rapidly with each transaction or block mined. However, on the ETH mainnet or testnet, it will progress much more slowly,...
SYED ASAD KAZMI's user avatar
1 vote

How to prevent division before multiplication precision loss?

If you want to keep the last 6 decimals, then it's not actually downscaling from 24-decimal format to 18-decimal format, instead it's keeping it the same. And that, you can simply achieve by getting ...
SYED ASAD KAZMI's user avatar
0 votes
Accepted

How to initialize a smart contract using Remix?

To use the initialize function in Remix you have to follow these steps to deploy your proxy contract: Deploy upgradable contracts using Remix There you will be able to pass the bytes of parameters to ...
Falcon Stakepool's user avatar
0 votes
Accepted

Deploy upgradable contracts using Remix

To deploy an upgradeable contract using Remix you have to do the following: When a UUPS contract is selected in Deploy & Run’s Contract select box, you’ll see some checkboxes below the Deploy ...
Falcon Stakepool's user avatar
0 votes

LearnEth sending Ether tutorial complete? Donating nothing

You have to make that function payable and when calling the function you will have to specify the amount you want to send either in WEI or in ETH If you are calling a function from RemixIDE you can do ...
Talha Sajid Chaudhary's user avatar
0 votes

Can't remove the liquidity from uniswap

I don't know what you mean by buy/sell function, tokens don't need that. They just need to be able to be transferred without some mechanic in the token blocking that. I have seen a lot of people ...
Maka's user avatar
  • 850
0 votes

I can't use the deploy button on remix

Make sure in the account section the address is visible or else try changing your environment
Shreyas Keni's user avatar
0 votes

How to Save solidity remix.ethereum file in local disk with sol extension|How to upload/direct load on github after save on local disk?

In the 2024 version, you can simply right-click on a folder or file in the file explorer, then select "Download". If it's a folder then it will be compressed as a zip file before being ...
JassMint's user avatar
1 vote
Accepted

LP contract doesn't approve

It seems like you are trying to approve from the contract address, meaning that your contract is approving the lp to take the tokens. When in reality you want the user to call approve before calling ...
Rohan Nero's user avatar
  • 1,577
0 votes
Accepted

Getting different binary for the same Solidity source code compiling with solc and Remix

It's just the metadata part of the bytecode that is different. Contracts compiled with solidity all have a metadata part at the end of the bytecode: https://docs.soliditylang.org/en/latest/metadata....
0xSanson's user avatar
  • 3,129
0 votes

Adding Multiple Owners and Allowing Original Owner to Remove Other Owners

I've added the addOwner() and removeOwner() functions as per your given specifications in your existing code. Here's the revised code: // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 &...
SYED ASAD KAZMI's user avatar
0 votes

i am compiling this lottery contract but the picWinner and getPlayers are not working

I believe you are trying to pull getPlayers to the front-end from your local copy instance. If this is the case, I'd recommend you compile and deploy the contract on remix.ethereum.org Once you have ...
Ndhlovu1's user avatar
0 votes

payable(address).transfer(value) runs out of gas

When you're calling the send_ransom() function of Ursurpur contract by passing the address of the King contract, then this line is executed: (bool success, bytes memory err) = payable(_king).call{...
SYED ASAD KAZMI's user avatar
0 votes

Influencing/Setting tx.gasprice

The gas price can only be set externally, when building the transaction. If you have more context on how you are preparing the transaction we could help you do so.
Franfran's user avatar
  • 583
0 votes

Getting started with a project

For testing how the frontend corresponding to a contract's function call looks and to simulate how you'll be interacting with the contracts on a frontend, you can use something like: Thirdweb: You ...
SYED ASAD KAZMI's user avatar
0 votes

Getting started with a project

I'm not familiar with front-end, but you can use hardhat to develop, test, deploy, etc... with your smart-contract. Unit-test can be written by javascript or typescript, so I think it will be easy for ...
CT95's user avatar
  • 386
1 vote

Wrong type of smart contract being instantiated on using new keyword

If you're referring to this line: newPatientSmartContract = new patient(msg.sender, name); Then, indeed it's creating a new patient contract, not RC3. The same can be confirmed by invoking the public ...
SYED ASAD KAZMI's user avatar
0 votes

Visual Studio Code

Yes, you can certainly use Visual Studio Code Editor for testing and debugging your smart contacts using tools like Foundry (based purely on Solidity), Hardhat (based on Javascript) etc., according to ...
SYED ASAD KAZMI's user avatar
0 votes
Accepted

FlashLoans contract funds are being wrongly withdrawn without any action, how is this possible?

Basically they just call function withdrawFunds. You should be able to see for yourself that anyone can call that function and withdraw any tokens. For some reason they are obfuscating the call by ...
0xSanson's user avatar
  • 3,129
0 votes

What is from address and Topic address in Remix log

"from" is the address of the contract that emitted the event. _"from " and "_amount" are parameters which are defined in the signature of the event, in the code of the ...
DarkWinter's user avatar
0 votes

Is there a way to retrieve the fund back from the contract to Metamask wallet

there is no way to withdraw fund from smart contract if you are not create any withdraw function before deployment i think next time you don't make this mistake also use testnet for verification of ...
Ronak Bharadiya's user avatar
0 votes

Withdrawing funds from the contract creation address if the contract creation fails

The contract creation to this address has failed. I do not believe it is possible to withdraw the funds.
Mikko Ohtamaa's user avatar

Top 50 recent answers are included