Naturally Processed Meals

    eth-create2

    1.0.1 • Public • Published

    eth-create2

    Build Status

    Generate Ethereum CREATE2 addresses

    Usage

    const create2 = require('eth-create2')
     
    // From EIP test vectors
    const creatorAddress = '0xdeadbeef00000000000000000000000000000000'
    const salt = '0x0000000000000000000000000000000000000000000000000000000000000000'
    const initCode = '0x00'
     
    const address = create2(creatorAddress, salt, initCode)
     
    // address === '0xb928f69bb1d91cd65274e3c79d8986362984fda3'

    API

    const resultAddress = create2(address, salt, initCode)

    Generate Ethereum CREATE2 address. Arguments can either be in the usual Ethereum hex encoded string form or Buffers. Note that address is the address of the contract executing the create2 instruction. Returns resultAddress as hex encoded string. Not checksum'ed, but this can be done with eth-checksum or similar modules.

    Install

    npm install eth-create2

    License

    ISC

    Keywords

    none

    Install

    npm i eth-create2

    DownloadsWeekly Downloads

    2

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    7.97 kB

    Total Files

    7

    Last publish

    Collaborators

    • emilbayes