mirror of openzeppelin-contracts
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.
 
 
 
 
 
openzeppelin-contracts/test/helpers/methods.js

14 lines
326 B

const { ethers } = require('hardhat');
const selector = signature => ethers.FunctionFragment.from(signature).selector;
const interfaceId = signatures =>
ethers.toBeHex(
signatures.reduce((acc, signature) => acc ^ ethers.toBigInt(selector(signature)), 0n),
4,
);
module.exports = {
selector,
interfaceId,
};