You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
490 B
17 lines
490 B
const { ethers } = require('hardhat');
|
|
|
|
const generators = {
|
|
address: () => ethers.Wallet.createRandom().address,
|
|
bytes32: () => ethers.hexlify(ethers.randomBytes(32)),
|
|
uint256: () => ethers.toBigInt(ethers.randomBytes(32)),
|
|
hexBytes: length => ethers.hexlify(ethers.randomBytes(length)),
|
|
};
|
|
|
|
generators.address.zero = ethers.ZeroAddress;
|
|
generators.bytes32.zero = ethers.ZeroHash;
|
|
generators.uint256.zero = 0n;
|
|
generators.hexBytes.zero = '0x';
|
|
|
|
module.exports = {
|
|
generators,
|
|
};
|
|
|