0.1.1 • Published 2 years ago

opcodes v0.1.1

Weekly downloads
-
License
CC0-1.0
Repository
-
Last release
2 years ago

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
0.1.1

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago