📕

BIP-34 Runbook

Proposal
April 26, 2023

Links

Safe transaction
Safe transaction hash
0xe11e99897867b957ac2694efd311f84c2687e0a8156deab64952d4f2b180e038
Safe transaction nonce
33
GitHub PR
GitHub commit hash
Snapshot proposal

diamondCut JSON:

bip-34.json6.8KB
{
    "diamondCut": {
        "diamondCut": [
            [
                "0x0000000000000000000000000000000000000000",
                2,
                [
                    "0x78309c85",
                    "0x6c8d548e"
                ]
            ],
            [
                "0xB57A1c006D827af549F6A31DC10028e5e2782762",
                0,
                [
                    "0x7907091f",
                    "0x56ba3e24",
                    "0x32ab68ce",
                    "0x553030d0",
                    "0xadccea12"
                ]
            ],
            [
                "0xB57A1c006D827af549F6A31DC10028e5e2782762",
                1,
                [
                    "0x8fd83ecf",
                    "0xd6be1816",
                    "0xe1d9d628",
                    "0xcb44a6cf",
                    "0x067fcd2e",
                    "0x23dc1142",
                    "0xc0aa6a90",
                    "0x3285008a",
                    "0x4433366d",
                    "0x28593984"
                ]
            ],
            [
                "0x9c9360C85cd020D4eF38775F6ADEdD38931f1731",
                0,
                [
                    "0x2a27c499",
                    "0x64ee4b80",
                    "0x3b2ecb70"
                ]
            ],
            [
                "0x9c9360C85cd020D4eF38775F6ADEdD38931f1731",
                1,
                [
                    "0x5c975abb",
                    "0xe60d7a83",
                    "0x471bcdbe",
                    "0x43def26e",
                    "0xc50b0fb0",
                    "0xca7b7d7b",
                    "0xfc06d2a6",
                    "0x16ada547",
                    "0x06c499d8",
                    "0x686b6159"
                ]
            ],
            [
                "0xBb5dC125E48A4580721b1E40Ac52984c2Ce54D3A",
                1,
                [
                    "0x4b4e8d9a",
                    "0x43c5198e",
                    "0xc869c1eb",
                    "0xce133450",
                    "0x6299a9af",
                    "0x0d1a844c",
                    "0x6ee66ddf"
                ]
            ]
        ],
        "initFacetAddress": "0xA3b3fB1951872346ea45EE601B29637Ca67fe6B4",
        "functionCall": "0xe1c7392a"
    },
    "encoded": "0x1f931c1c0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a3b3fb1951872346ea45ee601b29637ca67fe6b400000000000000000000000000000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000278309c85000000000000000000000000000000000000000000000000000000006c8d548e00000000000000000000000000000000000000000000000000000000000000000000000000000000b57a1c006d827af549f6a31dc10028e5e27827620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000057907091f0000000000000000000000000000000000000000000000000000000056ba3e240000000000000000000000000000000000000000000000000000000032ab68ce00000000000000000000000000000000000000000000000000000000553030d000000000000000000000000000000000000000000000000000000000adccea1200000000000000000000000000000000000000000000000000000000000000000000000000000000b57a1c006d827af549f6a31dc10028e5e278276200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000a8fd83ecf00000000000000000000000000000000000000000000000000000000d6be181600000000000000000000000000000000000000000000000000000000e1d9d62800000000000000000000000000000000000000000000000000000000cb44a6cf00000000000000000000000000000000000000000000000000000000067fcd2e0000000000000000000000000000000000000000000000000000000023dc114200000000000000000000000000000000000000000000000000000000c0aa6a90000000000000000000000000000000000000000000000000000000003285008a000000000000000000000000000000000000000000000000000000004433366d0000000000000000000000000000000000000000000000000000000028593984000000000000000000000000000000000000000000000000000000000000000000000000000000009c9360c85cd020d4ef38775f6adedd38931f17310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000032a27c4990000000000000000000000000000000000000000000000000000000064ee4b80000000000000000000000000000000000000000000000000000000003b2ecb70000000000000000000000000000000000000000000000000000000000000000000000000000000009c9360c85cd020d4ef38775f6adedd38931f173100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000a5c975abb00000000000000000000000000000000000000000000000000000000e60d7a8300000000000000000000000000000000000000000000000000000000471bcdbe0000000000000000000000000000000000000000000000000000000043def26e00000000000000000000000000000000000000000000000000000000c50b0fb000000000000000000000000000000000000000000000000000000000ca7b7d7b00000000000000000000000000000000000000000000000000000000fc06d2a60000000000000000000000000000000000000000000000000000000016ada5470000000000000000000000000000000000000000000000000000000006c499d800000000000000000000000000000000000000000000000000000000686b615900000000000000000000000000000000000000000000000000000000000000000000000000000000bb5dc125e48a4580721b1e40ac52984c2ce54d3a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000074b4e8d9a0000000000000000000000000000000000000000000000000000000043c5198e00000000000000000000000000000000000000000000000000000000c869c1eb00000000000000000000000000000000000000000000000000000000ce133450000000000000000000000000000000000000000000000000000000006299a9af000000000000000000000000000000000000000000000000000000000d1a844c000000000000000000000000000000000000000000000000000000006ee66ddf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000"
}

Overview

Facets Being Added

Facets Being Deprecated

*Note that the BIP-34 Snapshot proposal incorrectly states that the SeasonFacet that is currently part of Beanstalk and is being deprecated is 0x83d6e6b446613c9bfaebc64260962bc4f828a3ac, but the correct facet address is 0x0cEFF1129091A0ffa97cC58d4D160F9676866a24 as listed in the table above.

Init Contract

InitSunriseImprovements: 0xA3b3fB1951872346ea45EE601B29637Ca67fe6B4

Verifying the Transaction

Setup

  1. Follow 🏗️How to Setup Environment, pulling and compiling the latest changes on the the bip-sunrise-improvements branch.

The Diamond Cut Transaction

Add the following bip34enc task to hardhat.config.js per How to Verify Facet Changes.

You can verify that the following data value in the final line of code is correct by comparing it with the Raw data field on the Safe multisig transaction.

task('bip34enc', async function () {
  const bcm = await impersonateBeanstalkOwner()
  await mintEth(bcm.address)
  await bcm.sendTransaction({to: BEANSTALK, value: 0, data: '0x1f931c1c0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000a3b3fb1951872346ea45ee601b29637ca67fe6b400000000000000000000000000000000000000000000000000000000000008e0000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000002a0000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000278309c85000000000000000000000000000000000000000000000000000000006c8d548e00000000000000000000000000000000000000000000000000000000000000000000000000000000b57a1c006d827af549f6a31dc10028e5e27827620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000057907091f0000000000000000000000000000000000000000000000000000000056ba3e240000000000000000000000000000000000000000000000000000000032ab68ce00000000000000000000000000000000000000000000000000000000553030d000000000000000000000000000000000000000000000000000000000adccea1200000000000000000000000000000000000000000000000000000000000000000000000000000000b57a1c006d827af549f6a31dc10028e5e278276200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000a8fd83ecf00000000000000000000000000000000000000000000000000000000d6be181600000000000000000000000000000000000000000000000000000000e1d9d62800000000000000000000000000000000000000000000000000000000cb44a6cf00000000000000000000000000000000000000000000000000000000067fcd2e0000000000000000000000000000000000000000000000000000000023dc114200000000000000000000000000000000000000000000000000000000c0aa6a90000000000000000000000000000000000000000000000000000000003285008a000000000000000000000000000000000000000000000000000000004433366d0000000000000000000000000000000000000000000000000000000028593984000000000000000000000000000000000000000000000000000000000000000000000000000000009c9360c85cd020d4ef38775f6adedd38931f17310000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000032a27c4990000000000000000000000000000000000000000000000000000000064ee4b80000000000000000000000000000000000000000000000000000000003b2ecb70000000000000000000000000000000000000000000000000000000000000000000000000000000009c9360c85cd020d4ef38775f6adedd38931f173100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000a5c975abb00000000000000000000000000000000000000000000000000000000e60d7a8300000000000000000000000000000000000000000000000000000000471bcdbe0000000000000000000000000000000000000000000000000000000043def26e00000000000000000000000000000000000000000000000000000000c50b0fb000000000000000000000000000000000000000000000000000000000ca7b7d7b00000000000000000000000000000000000000000000000000000000fc06d2a60000000000000000000000000000000000000000000000000000000016ada5470000000000000000000000000000000000000000000000000000000006c499d800000000000000000000000000000000000000000000000000000000686b615900000000000000000000000000000000000000000000000000000000000000000000000000000000bb5dc125e48a4580721b1e40ac52984c2ce54d3a0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000074b4e8d9a0000000000000000000000000000000000000000000000000000000043c5198e00000000000000000000000000000000000000000000000000000000c869c1eb00000000000000000000000000000000000000000000000000000000ce133450000000000000000000000000000000000000000000000000000000006299a9af000000000000000000000000000000000000000000000000000000000d1a844c000000000000000000000000000000000000000000000000000000006ee66ddf000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000'})
})

Verifying the Diamond Cut

  1. Follow How to Verify Facet Changes.
  2. Verify there are no remaining function selectors from the Facets Being Deprecated section above.
  3. Verify that all function selectors from the Facets Being Added section above are present.

Verifying the Deployed Code

  1. Follow 🧑‍💻[OLD] How to Verify Deployed Code.
🚨
Due to some complications of verifying the facet code on Etherscan this time around, the code deployed on-chain is different from the code in the commit hash. The only differences (if at all) should be the import paths at the top of certain Solidity files (or whitespace at the bottom).

For BIP-34, BCM Signers are being asked to manually check the diffs between the following files:

On the new Field Facet:

  • File 8 of 24 : AppStorage.sol
  • File 9 of 24 : FieldFacet.sol
  • File 11 of 24 : C.sol
  • File 19 of 24 : LibDibbler.sol

On the new Season Facet:

  • File 20 of 44 : Oracle.sol
  • File 21 of 44 : SeasonFacet.sol
  • File 22 of 44 : Sun.sol
  • File 23 of 44 : Weather.sol
  • File 37 of 44 : LibIncentive.sol

On the new Fundraiser Facet:

  • File 11 of 29 : FundraiserFacet.sol

On the InitBipSunriseImprovements contract:

  • File 5 of 6 : InitBipSunriseImprovements.sol

Example of how to verify the deployed code is the same as the GitHub commit hash

  1. Make sure you are on the bip-sunrise-improvements branch in the protocol directory and compile the latest code with npx hardhat compile.
  2. For example, for FieldFacet.sol you can run the following command and paste the result into the first input field of a diff checker.
cat contracts/beanstalk/field/FieldFacet.sol | pbcopy
  1. Then copy the source code from Etherscan and paste the result into the second field of a diff checker.
image
  1. Confirm that the only difference is the import paths at the top of the file.
image
  1. Repeat for each of the 11 Solidity files listed above.

Submitting Message Signature

Once Signers have verified the transaction, they shall submit and sign a verified message signature on Etherscan.

Template message: Confirming that I have reviewed BIP-34 with BCM transaction nonce [Y], Safe transaction hash [tx hash], commit hash [hash] and Snapshot proposal [URL].