Remove GovernorCompatibilyBravo and add simpler GovernorStorage (#4360)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: Francisco Giordano <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-08-03 17:51:07 +02:00
committed by GitHub
parent d39df78f6c
commit 21716722ad
27 changed files with 755 additions and 1259 deletions

View File

@ -1,3 +1,4 @@
const { web3 } = require('hardhat');
const { forward } = require('../helpers/time');
const { ProposalState } = require('./enums');
@ -15,6 +16,9 @@ function concatOpts(args, opts = null) {
return opts ? args.concat(opts) : args;
}
const timelockSalt = (address, descriptionHash) =>
'0x' + web3.utils.toBN(address).shln(96).xor(web3.utils.toBN(descriptionHash)).toString(16, 64);
class GovernorHelper {
constructor(governor, mode = 'blocknumber') {
this.governor = governor;
@ -245,4 +249,5 @@ function proposalStatesToBitMap(proposalStates, options = {}) {
module.exports = {
GovernorHelper,
proposalStatesToBitMap,
timelockSalt,
};