Skip to main content
4 votes
Accepted

assertEq is showing error when written in the test file foundry

You need to inherit the test.sol in your test contract. Like this : contract FundMeTest is Test { FundMe fundme; function setup() external { fundme = new FundMe(); } function ...
Zartaj Afser's user avatar
  • 5,320
3 votes

Remix errors trying to test and run a script

First of all I'd like to point out some clarifications: I assume that you are clicking on the "Compile and run script" button (because that's the only button that shows the same "...
Mila A's user avatar
  • 1,554
2 votes

why can use array's push

From https://docs.soliditylang.org/en/v0.8.16/types.html?highlight=Push#allocating-memory-arrays As opposed to storage arrays, it is not possible to resize memory arrays (e.g. the .push member ...
mermeladeK's user avatar
2 votes

How do I simulate multiple users in a remix unit test?

To resemble multiple user functionality, you have to update your test file a bit with inheritance like: pragma solidity >=0.4.22 <0.7.0; import "remix_tests.sol"; import "...
Aniket's user avatar
  • 3,545
1 vote
Accepted

Issue with Accounts Not Displaying in Remix VM (Cancun and Shanghai) Environments

This problem is with crome i guess , change chrome profile it will work
MD AZAD's user avatar
  • 60
1 vote

remix.ethereum.org - you cannot test payable methods

Did you send value when deploying the contract? Here is a picture of where you need to include the value when deploying:
auditor_chick's user avatar
1 vote

How do i prevent further burn once the minimum total supply of my token has been reached?

Asssuming you’re programming one solidity, your burn function should use a require to ensure currentTotalSupply !<= minimumTotalSupply
immaxkent's user avatar
  • 519
1 vote
Accepted

Data location must be "calldata" for parameter in external function, but none was given. --> Undeclared identifier

There are multiple errors in your code. Apparently, you have not declared variables and mappings (that's why the undeclared variable error). Create a mapping of allowed if you want to use it. mapping(...
Shubham Sharma's user avatar
1 vote

Gas for call to a simple contract function on Remix

In the context of Ethereum, "gas" refers to the execution cost of a transaction or a contract function. Every operation that is performed on the Ethereum blockchain requires a certain amount ...
VX3's user avatar
  • 686
1 vote
Accepted

How do I test extra parameters in Remix?

If you want to call payable function and send ether with the transaction in remix IDE, then you need to use those 2 provided input fields. The given amount is not related to the gas fees. Your ...
Majd TL's user avatar
  • 3,257
1 vote

Unexpected "catch Error" Behavior

In your first vote you vote using vote(0), an internal call which keeps the same transaction context and therefore same msg.sender. In your second vote you vote using this.vote(0), an external call (...
Kenzo Agada's user avatar
  • 1,256
1 vote
Accepted

Testing the Remix example2 contract

The problem is with getOwner(). It is a function of the contract sender, but you try to use it in testSuite. testSuite does not know what getOwner() is and where it comes from. I see that in the line ...
Kostiantyn Kurbatskyi's user avatar
1 vote

My remix.eth page does not connect with my metamask account

First, try to disconnect your metamask from everything by clicking on that green "Connected" on the left side from metamask and then disconnect all accounts. After that lockout from Metamask ...
Majd TL's user avatar
  • 3,257
1 vote
Accepted

Unit test on remix keeps throwing typeError

Proper approach to the unit testing is test contract with external calls, in this way you can see the call parameters and return values then decide what structure you should be using. If you want to ...
defikintaro's user avatar
1 vote

Solidity Smart Contract - Split and Send Contract ETH Balance Between Two Accounts

seems pretty explanatory to me.... in case you missed it he wants to create a function and then call that function from the pay address function. i interpret his question as asking, "can i hand ...
macguyver's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible