You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when I use the deal() function to mint some tokens to an address for testing an ERC20 contract the forge test command gives me the MemoryLimitOOG error, but suppose I use a mint function implemented in the ERC20 contract itself to mint the tokens then forge test works fine.
This gives me the above mentioned error while running forge test
import {Test, console2, StdStyle} from "forge-std/Test.sol";
import {ERC20} from "../src/ERC20.sol";
contract BaseSetup is ERC20, Test {
address internal alice;
address internal bob;
constructor() ERC20("Name", "SYM", 18) {}
function setUp() public virtual {
alice = makeAddr("alice");
bob = makeAddr("bob");
console2.log(StdStyle.blue("When Alice has 300 Tokens"));
deal(address(this), alice, 300e18);
}
}
//Test Contracts here
This runs perfectly while running forge test
import {Test, console2, StdStyle} from "forge-std/Test.sol";
import {ERC20} from "../src/ERC20.sol";
contract BaseSetup is ERC20, Test {
address internal alice;
address internal bob;
constructor() ERC20("Name", "SYM", 18) {}
function setUp() public virtual {
alice = makeAddr("alice");
bob = makeAddr("bob");
console2.log(StdStyle.blue("When Alice has 300 Tokens"));
_mint(alice, 300e18); //_mint is an internal mint function implemented in the ERC20 contract.
}
}
//Test Contracts here
I'm wondering what could be the possible issue. I know the error means enough memory isn't available to carry the task. But why using the deal() function requires more memory?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I noticed that when I use the
deal()
function to mint some tokens to an address for testing an ERC20 contract theforge test
command gives me theMemoryLimitOOG
error, but suppose I use a mint function implemented in the ERC20 contract itself to mint the tokens thenforge test
works fine.This gives me the above mentioned error while running forge test
This runs perfectly while running forge test
I'm wondering what could be the possible issue. I know the error means enough memory isn't available to carry the task. But why using the
deal()
function requires more memory?Beta Was this translation helpful? Give feedback.
All reactions