Tags
The following is a guide on verifying that the expected facet addresses are added/changed/removed upon the execution of a diamondCut
call.
- Follow .How to Setup Environment
- Add the following code to the
hardhat.config.js
file in theprotocol
directory of the cloned repository. - Run the following command in a separate terminal window (in the same directory) to the mainnet fork that you started per .How to Setup Environment
- Go to a site like https://www.diffchecker.com/text-compare/ and paste the output in the first text field.
- Add the hardhat task in the that corresponds to theBIP Runbooks
diamondCut
call to thehardhat.config.js
file. The following is an example from BIP-37. - Run the following command in the same terminal window as step (3). Again,
bip37enc
is just an example from BIP-37โsee the respective. This will execute theBIP RunbooksdiamondCut
. - Run the
facet
task again. - Go back to https://www.diffchecker.com/text-compare/ and paste the new output in the second text field.
- Click โFind Differenceโ to generate the diff.
- Manually parse the diff and confirm that the expected facet addresses and function selectors from the are correspondingly added, changed or removed.BIP Runbooks
Note that you may have to add the import for getBeanstalk
on line 10 from .utils
.
task('facet', async function () {
const bs = await getBeanstalk()
console.log(await bs.facets())
})
You may have to add an import for getBeanstalk
from utils.js
.
npx hardhat facet --network localhost | pbcopy
This command will get a list of all the facet addresses and their function selectors at BLOCK_NUMBER
(set in the .env
file). pbcopy
copies the output to your clipboard.
task('bip37enc', async function () {
const bcm = await impersonateBeanstalkOwner()
await mintEth(bcm.address)
await bcm.sendTransaction({to: BEANSTALK, value: 0, data: 'TBD'})
})
npx hardhat bip37enc --network localhost
npx hardhat facet --network localhost | pbcopy