import { consumeGas } from "../../Frame/consumeGas.js";
import { pushStack } from "../../Frame/pushStack.js";
import { QuickStep } from "../../../primitives/GasConstants/BrandedGasConstants/constants.js";
/**
* PUSH0 opcode (0x5f) - Push 0 onto stack
* EIP-3855: Introduced in Shanghai hardfork
*
* Stack: [] => [0]
* Gas: 2 (GasQuickStep)
*/
export function handler_0x5f_PUSH0(frame: FrameType): EvmError | null {
// Note: Add hardfork validation when Hardfork module is available
// if (evm.hardfork.isBefore(.SHANGHAI)) {
// return { type: "InvalidOpcode" };
// }
const gasErr = consumeGas(frame, QuickStep);
if (gasErr) return gasErr;
const pushErr = pushStack(frame, 0n);
if (pushErr) return pushErr;
frame.pc += 1;
return null;
}