aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/utils/address_utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/test/utils/address_utils.ts')
-rw-r--r--packages/contracts/test/utils/address_utils.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/contracts/test/utils/address_utils.ts b/packages/contracts/test/utils/address_utils.ts
new file mode 100644
index 000000000..a9fb6921a
--- /dev/null
+++ b/packages/contracts/test/utils/address_utils.ts
@@ -0,0 +1,10 @@
+import { crypto, generatePseudoRandomSalt } from '@0xproject/order-utils';
+
+export const addressUtils = {
+ generatePseudoRandomAddress(): string {
+ const randomBigNum = generatePseudoRandomSalt();
+ const randomBuff = crypto.solSHA3([randomBigNum]);
+ const randomAddress = `0x${randomBuff.slice(0, 20).toString('hex')}`;
+ return randomAddress;
+ },
+};