import { toBigIntBE } from 'bigint-buffer' ; import { OpCode } from '.' ; import { EvmContext } from '../vm/evm-context' ; class OriginOp implements OpCode { public readonly code = 0x32 ; public readonly mnemonic = 'ORIGIN' ; public readonly description = 'Get the origin address.' ; public readonly gas = 1 ; public readonly bytes = 1 ; public toString ( params ) { return `${ this . mnemonic }` ; } public handle ( context ) { context . stack . push ( toBigIntBE ( context . origin . toBuffer ( ) ) ) ; context . ip += this . bytes ; } } export const Origin = new OriginOp ( ) ;