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 ...
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 "...
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 ...
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 "...
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
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:
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
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(...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
remix-tests × 50remix × 31
solidity × 28
unittesting × 9
contract-development × 3
blockchain × 3
testing × 3
payable × 3
erc-20 × 2
testnets × 2
smart-contract-wallets × 2
polygon × 2
test × 2
go-ethereum × 1
web3js × 1
transactions × 1
tokens × 1
metamask × 1
contract-deployment × 1
dapps × 1
evm × 1
contract-debugging × 1
erc-721 × 1
oracles × 1
rinkeby × 1