Skip to content

deal hangs #740

@maa105

Description

@maa105

Dears

Thanks for the amazing efforts you put into this. I detected a bug in deal function when used with reflection tokens. the bug is in v1.9.2 (v1.9.1 doesnt have it). The bug is the deal function just hangs and never returns in v1.9.2 vs it throws in v1.9.1 (expected as this is a reflection token).

test to run:

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.25;

import {Test, console} from "forge-std/Test.sol";
contract MyTest is Test {
    function testThingy() public {
        vm.createSelectFork("wss://bsc-rpc.publicnode.com"); // A BSC RPC Node. You might want to change this
        vm.writeLine("./log.txt", "start");
        deal(0xc748673057861a797275CD8A068AbB95A902e8de, address(this), 1 ether);
        vm.writeLine("./log.txt", "end");
    }
}

foundry.toml:

[profile.default]
src = "Foundry/src"
out = "out"
libs = ["Foundry/lib"]
test = "Foundry/test"
optimizer = true
optimizer_runs = 20000
viaIR = true
evm_version = "cancun"
gas_limit = "18446744073709551615"
solc = "0.8.25"
fs_permissions = [{ access = "write", path = "./"}]

I do vm.writeLine instead of console.log cause when it hangs you do not get the console.logs

I tried on multiple versions and I was able to zero in on the version where this bug happens which is v1.9.2. So for me v1.9.1 it didnt hang (it failed but didnt hang). v1.9.2 it hanged.

Related to: #409

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions