-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Milestone
Description
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
forge 0.2.0 (27cabbd 2024-11-29T00:28:06.641192000Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Apple Silicon)
Describe the bug
it seems the use of the ether keyword anywhere in a forge script contract will cause break forge script.
My code:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import {Script} from "forge-std/Script.sol";
contract POC is Script {
function run() external {
uint256 a = .1 ether;
}
}
The error:
▶ forge script POC
Error: No contract found with the name `POC`
a workaround is to just not use the keyword.
Workaround code:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
import {Script} from "forge-std/Script.sol";
contract POC is Script {
function run() external {
uint256 a = 1e17;
}
}
console output
▶ forge script POC
[⠊] Compiling...
No files changed, compilation skipped
Script ran successfully.
Gas used: 21161
ind-igo
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Completed