sevm
Version:
A Symbolic Ethereum Virtual Machine (EVM) bytecode decompiler & analyzer library & CLI
80 lines (79 loc) • 2.59 kB
TypeScript
import { type Expr, Tag } from '.';
import type { Type } from '../abi';
/**
* Represents a global Solidity built-in property.
*
* @see https://docs.soliditylang.org/en/develop/units-and-global-variables.html#special-variables-and-functions
*/
export declare class Prop extends Tag {
readonly symbol: string;
readonly type: Type;
readonly tag = "Prop";
constructor(symbol: string, type: Type);
eval(): Expr;
}
/**
* A collection of _Block and Transaction Properties_ defined as `Prop`.
*
* @see https://docs.soliditylang.org/en/develop/units-and-global-variables.html#block-and-transaction-properties
* @see {@link Prop}
*/
export declare const Props: {
"address(this)": Prop;
"codesize()": Prop;
"returndatasize()": Prop;
"address(this).balance": Prop;
"gasleft()": Prop;
} & {
"block.number": Prop;
"block.basefee": Prop;
"block.coinbase": Prop;
"block.timestamp": Prop;
"block.difficulty": Prop;
"block.gaslimit": Prop;
"block.chainid": Prop;
"block.prevrandao": Prop;
} & {
"msg.sender": Prop;
"msg.data.length": Prop;
} & {
"tx.origin": Prop;
"tx.gasprice": Prop;
};
export declare const FNS: {
readonly BALANCE: readonly [(address: string) => string, "uint256", 49];
readonly EXTCODESIZE: readonly [(address: string) => string, "uint256", 59];
readonly EXTCODEHASH: readonly [(address: string) => string, "bytes32", 63];
readonly BLOCKHASH: readonly [(blockNumber: string) => string, "bytes32", 64];
};
export declare class Fn extends Tag {
readonly mnemonic: keyof typeof FNS;
readonly value: Expr;
readonly tag = "Fn";
constructor(mnemonic: keyof typeof FNS, value: Expr);
eval(): Expr;
}
export declare class DataCopy extends Tag {
readonly kind: 'calldatacopy' | 'codecopy' | 'extcodecopy' | 'returndatacopy';
readonly offset: Expr;
readonly size: Expr;
readonly address?: Expr | undefined;
readonly bytecode?: Uint8Array | undefined;
readonly tag = "DataCopy";
constructor(kind: 'calldatacopy' | 'codecopy' | 'extcodecopy' | 'returndatacopy', offset: Expr, size: Expr, address?: Expr | undefined, bytecode?: Uint8Array | undefined);
eval(): this;
}
/**
* Get deposited value by the instruction/transaction responsible for this execution.
*/
export declare class CallValue extends Tag {
readonly tag = "CallValue";
constructor();
eval(): Expr;
}
export declare class CallDataLoad extends Tag {
location: Expr;
readonly tag = "CallDataLoad";
constructor(location: Expr);
eval(): Expr;
}