aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils/address_utils.ts
blob: 01a7a6fd4d4c5ae647bac9adc48e2e2a3c2d7520 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { ZeroEx } from '0x.js';

import { crypto } from './crypto';

export const addressUtils = {
    generatePseudoRandomAddress(): string {
        const randomBigNum = ZeroEx.generatePseudoRandomSalt();
        const randomBuff = crypto.solSHA3([randomBigNum]);
        const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`;
        return randomAddress;
    },
};