import { OpCode } from '.' ; import { EvmContext } from '../vm/evm-context' ; class MsizeOp implements OpCode { public readonly code = 0x59 ; public readonly mnemonic = 'MSIZE' ; public readonly description = 'Get size of active memory in bytes' ; public readonly gas = 2 ; public readonly bytes = 1 ; public toString ( params ) { return `${ this . mnemonic }` ; } public handle ( context ) { context . stack . push ( context . memory . activeMemoryWords ( ) * BigInt ( 32 ) ) ; context . ip += this . bytes ; } } export const Msize = new MsizeOp ( ) ;