Files: e46c31f9eba336c3c5c1cec482e028a89c0940be / deps / utils.js
415 bytesRaw
1 | const ethUtil = require('ethereumjs-util') |
2 | const Address = require('./address.js') |
3 | |
4 | var Utils = {} |
5 | |
6 | Utils.isWASMCode = function (code) { |
7 | return code.slice(0, 4).toString() === new Uint8Array([0, 0x61, 0x73, 0x6d]).toString() |
8 | } |
9 | |
10 | Utils.newAccountAddress = function (sender, nonce) { |
11 | return new Address('0x' + ethUtil.generateAddress(sender.toString(), nonce.toString()).toString('hex')) |
12 | } |
13 | |
14 | module.exports = Utils |
15 |
Built with git-ssb-web