opcodes
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

opcodes

npm | github

usage examples

import op from 'opcodes'; // default is hexstring

const xfer = '0x' + op.PUSH20 + '00'.repeat(20) + op.SELFDESTRUCT;
console.log(xfer) //  0x730000000000000000000000000000000000000000ff
// CommonJS
const { PUSH20, SELFDESTRUCT } = require('opcodes');

// or ES modules
import op from 'opcodes'; 
const { PUSH20, SELFDESTRUCT } = op;

const xfer2 = '0x' + PUSH20 + '00'.repeat(20) + SELFDESTRUCT;
console.log(xfer2) // 0x730000000000000000000000000000000000000000ff
const { PUSH20, SELFDESTRUCT } = require('opcodes/buffer');

const xfer = Buffer.concat([
    PUSH20,
    Buffer.alloc(20),
    SELFDESTRUCT
]);
console.log('0x' + xfer.toString('hex')) // 0x730000000000000000000000000000000000000000ff

/opcodes/

    Package Sidebar

    Install

    npm i opcodes

    Weekly Downloads

    0

    Version

    0.1.1

    License

    CC0-1.0

    Unpacked Size

    38.1 kB

    Total Files

    13

    Last publish

    Collaborators

    • yoyyyyo