dexorder
This commit is contained in:
14
lib_openzeppelin_contracts/test/helpers/methods.js
Normal file
14
lib_openzeppelin_contracts/test/helpers/methods.js
Normal file
@@ -0,0 +1,14 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user