UNPKG

sevm

Version:

A Symbolic Ethereum Virtual Machine (EVM) bytecode decompiler & analyzer library & CLI

175 lines (174 loc) 5.76 kB
import { type IInst, Tag, type Expr } from '.'; export declare class Sha3 extends Tag { readonly offset: Expr; readonly size: Expr; readonly args?: Expr[] | undefined; readonly tag = "Sha3"; constructor(offset: Expr, size: Expr, args?: Expr[] | undefined); eval(): Sha3; children(): Expr[]; } export declare class Create extends Tag { readonly value: Expr; readonly offset: Expr; readonly size: Expr; readonly bytecode: Uint8Array | null; readonly tag = "Create"; readonly type = "address"; /** * Creates a new account with associated code. * * @param value Value in _wei_ to send to the new account. * @param offset Byte offset in the memory in bytes, the initialisation code for the new account. * @param size Byte size to copy (size of the initialisation code). * @param bytecode */ constructor(value: Expr, offset: Expr, size: Expr, bytecode?: Uint8Array | null); eval(): Expr; } export declare class Call extends Tag { readonly gas: Expr; readonly address: Expr; readonly value: Expr; readonly argsStart: Expr; readonly argsLen: Expr; readonly retStart: Expr; readonly retLen: Expr; readonly tag = "Call"; throwOnFail: boolean; constructor(gas: Expr, address: Expr, value: Expr, argsStart: Expr, argsLen: Expr, retStart: Expr, retLen: Expr); eval(): Expr; } export declare class ReturnData extends Tag { readonly retOffset: Expr; readonly retSize: Expr; readonly tag = "ReturnData"; readonly type = "bytes"; readonly wrapped = false; constructor(retOffset: Expr, retSize: Expr); eval(): Expr; } export declare class CallCode extends Tag { readonly gas: Expr; readonly address: Expr; readonly value: Expr; readonly memoryStart: Expr; readonly memoryLength: Expr; readonly outputStart: Expr; readonly outputLength: Expr; readonly tag = "CallCode"; constructor(gas: Expr, address: Expr, value: Expr, memoryStart: Expr, memoryLength: Expr, outputStart: Expr, outputLength: Expr); eval(): Expr; } export declare class Create2 extends Tag { readonly offset: Expr; readonly size: Expr; readonly value: Expr; readonly tag = "Create2"; constructor(offset: Expr, size: Expr, value: Expr); eval(): Expr; } export declare class StaticCall extends Tag { readonly gas: Expr; readonly address: Expr; readonly memoryStart: Expr; readonly memoryLength: Expr; readonly outputStart: Expr; readonly outputLength: Expr; readonly tag = "StaticCall"; constructor(gas: Expr, address: Expr, memoryStart: Expr, memoryLength: Expr, outputStart: Expr, outputLength: Expr); eval(): Expr; } export declare class DelegateCall extends Tag { readonly gas: Expr; readonly address: Expr; readonly memoryStart: Expr; readonly memoryLength: Expr; readonly outputStart: Expr; readonly outputLength: Expr; readonly tag = "DelegateCall"; constructor(gas: Expr, address: Expr, memoryStart: Expr, memoryLength: Expr, outputStart: Expr, outputLength: Expr); eval(): Expr; } export declare class Stop implements IInst { readonly name = "Stop"; eval(): this; } export declare class Return implements IInst { readonly offset: Expr; readonly size: Expr; readonly args?: Expr[] | undefined; readonly name = "Return"; /** * Exits the current context successfully. * * @param offset Byte offset in the memory in bytes, to copy what will be the return data of this context. * @param size Byte size to copy (size of the return data). * @param args */ constructor(offset: Expr, size: Expr, args?: Expr[] | undefined); eval(): Return; } /** * */ export interface IReverts { [selector: string]: { /** * */ sig?: string; }; } export declare class Revert implements IInst { readonly offset: Expr; readonly size: Expr; readonly selector?: string | undefined; readonly sig?: { /** * */ sig?: string; } | undefined; readonly args?: Expr[] | undefined; readonly name = "Revert"; static readonly ERROR = "08c379a0"; static readonly PANIC = "4e487b71"; /** * Stop the current context execution, revert the state changes (see `STATICCALL` for a list * of state changing opcodes) and return the unused gas to the caller. * * It also reverts the gas refund to its value before the current context. * If the execution is stopped with `REVERT`, the value 0 is put on the stack of the calling context, * which continues to execute normally. * The return data of the calling context is set as the given chunk of memory of this context. * * @param offset byte offset in the memory in bytes. The return data of the calling context. * @param size byte size to copy (size of the return data). * @param args */ constructor(offset: Expr, size: Expr, selector?: string | undefined, sig?: { /** * */ sig?: string; } | undefined, args?: Expr[] | undefined); eval(): Revert; /** * https://docs.soliditylang.org/en/latest/control-structures.html#panic-via-assert-and-error-via-require */ static isRequireOrAssert(selector: string | undefined): boolean; isRequireOrAssert(): boolean; } export declare class Invalid implements IInst { readonly opcode: number; readonly name = "Invalid"; constructor(opcode: number); eval(): this; } export declare class SelfDestruct implements IInst { readonly address: Expr; readonly name = "SelfDestruct"; constructor(address: Expr); eval(): this; }