📕

BIP-48 Runbook

Proposal
July 19, 2024

Links

diamondCut JSON:

bip-48.json17.5KB
{
    "diamondCut": {
        "diamondCut": [
            [
                "0x0000000000000000000000000000000000000000",
                2,
                [
                    "0x208c2c98",
                    "0xbb02e10b"
                ]
            ],
            [
                "0xaef84C2B863aB845F59f672d958B175262dcfc89",
                1,
                [
                    "0x5a049a47",
                    "0xf984019b",
                    "0xc8cda2a0",
                    "0xb0c22bb1",
                    "0xc84c7727"
                ]
            ],
            [
                "0xEb1b833D3E81cb3d390514cabB9b809E6170626C",
                1,
                [
                    "0xb362a6e8"
                ]
            ],
            [
                "0x8ABa09526dc6EB6Ea44eE3f8745dD8bc9EF744E2",
                1,
                [
                    "0x4aa06652",
                    "0x24dd285c"
                ]
            ],
            [
                "0x179Bb2636F0066d837f1a446083A0FBA131c1A46",
                1,
                [
                    "0x0b58f073",
                    "0x88fcd169"
                ]
            ],
            [
                "0x729672c68134E2DF0CdD36D3296841A2993534c7",
                0,
                [
                    "0x94daa221",
                    "0xe3d4e44c",
                    "0xf255da60",
                    "0x93a39bea",
                    "0x363591d0"
                ]
            ],
            [
                "0x729672c68134E2DF0CdD36D3296841A2993534c7",
                1,
                [
                    "0x304ec65d",
                    "0xb6f42085",
                    "0x1799b3b2",
                    "0x1edb6be1",
                    "0x9bb4e35a",
                    "0x83e08888",
                    "0xdc6ba285",
                    "0x39448802",
                    "0xc85951a1",
                    "0x9c45a1d5",
                    "0x34af5416",
                    "0x1e223143",
                    "0x29130a66",
                    "0x4d622831",
                    "0x69744dd0",
                    "0xf4a057e2",
                    "0x6ae1c014",
                    "0xd47aee59",
                    "0x4a16607c",
                    "0x4f9a9678",
                    "0xf9c4ebde",
                    "0xa3ef48c9"
                ]
            ],
            [
                "0x0d8f6F09a2B806d406d511C113f2Fc3F4D608Fc1",
                1,
                [
                    "0xc20b8071",
                    "0x06fdde03",
                    "0x95d89b41",
                    "0x0e89341c"
                ]
            ],
            [
                "0x92458b7ade7798c45E5ff583c353F70F950d66Cf",
                1,
                [
                    "0x64ee4b80",
                    "0xca7b7d7b",
                    "0xfc06d2a6"
                ]
            ],
            [
                "0x5A1675f3156c9e73D7eA20eb58470A0002865E85",
                1,
                [
                    "0x2a27c499",
                    "0xeedc7ab9",
                    "0x7ba6cbf8",
                    "0xeb0e1215",
                    "0xd1db56b8",
                    "0x69aa7e02",
                    "0xcc88d4f9",
                    "0x673c75f0",
                    "0x64b3496b",
                    "0x93523425",
                    "0x64887852",
                    "0xb2b0556d",
                    "0x141933bf",
                    "0xf98da2de",
                    "0x383f170f",
                    "0xd1943f7f",
                    "0xcb2d0a3c",
                    "0xcce813a1",
                    "0x6af8e5a4",
                    "0x7d23804d",
                    "0x50539159",
                    "0xbbf459a7",
                    "0xf788b47c",
                    "0xa13a3742",
                    "0x93c9e531",
                    "0x5c975abb",
                    "0xe60d7a83",
                    "0x471bcdbe",
                    "0x43def26e",
                    "0xc50b0fb0",
                    "0x3b2ecb70",
                    "0x16ada547",
                    "0x06c499d8",
                    "0x686b6159",
                    "0x597490c0"
                ]
            ],
            [
                "0xD64BB5c2dBf12fEBeFc6397926A3c0aA6f8b6535",
                0,
                [
                    "0x33f37f27"
                ]
            ],
            [
                "0xD64BB5c2dBf12fEBeFc6397926A3c0aA6f8b6535",
                1,
                [
                    "0xa84643e4",
                    "0x787cee99",
                    "0xfa345569",
                    "0x1acc0a47",
                    "0x1be655e8",
                    "0x9a516cad",
                    "0x087d78b4",
                    "0x7caa025f",
                    "0xbfe2f3be",
                    "0x6de45df2",
                    "0x014a8a49",
                    "0xbb7de478",
                    "0x43cc4ee0",
                    "0xab434eb7",
                    "0xadef4533",
                    "0x9f06b3fa",
                    "0xb8a04d1b",
                    "0x691bcc88",
                    "0xfc6a19df",
                    "0x13ed3cea",
                    "0xd3c73ec8",
                    "0xa33fa99f"
                ]
            ],
            [
                "0xDE3a2284b50E345cB7985EE677595cC720fbBB02",
                1,
                [
                    "0x86b40a1b",
                    "0xe9522c08",
                    "0xd9ba32fc",
                    "0x170cf084",
                    "0x9d1d2877",
                    "0xe26f7900",
                    "0x76a7bc84",
                    "0xce5fb821",
                    "0xf18d9ed0",
                    "0x371b5b03",
                    "0x052ebc26"
                ]
            ]
        ],
        "initFacetAddress": "0x15A2053B3d559d19FeD2D7FC429304e837cEFa00",
        "functionCall": "0xe1c7392a"
    },
    "encoded": "0x1f931c1c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000015a2053b3d559d19fed2d7fc429304e837cefa000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000006c00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000be000000000000000000000000000000000000000000000000000000000000010c0000000000000000000000000000000000000000000000000000000000000116000000000000000000000000000000000000000000000000000000000000014a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002208c2c9800000000000000000000000000000000000000000000000000000000bb02e10b00000000000000000000000000000000000000000000000000000000000000000000000000000000aef84c2b863ab845f59f672d958b175262dcfc890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000055a049a4700000000000000000000000000000000000000000000000000000000f984019b00000000000000000000000000000000000000000000000000000000c8cda2a000000000000000000000000000000000000000000000000000000000b0c22bb100000000000000000000000000000000000000000000000000000000c84c772700000000000000000000000000000000000000000000000000000000000000000000000000000000eb1b833d3e81cb3d390514cabb9b809e6170626c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001b362a6e8000000000000000000000000000000000000000000000000000000000000000000000000000000008aba09526dc6eb6ea44ee3f8745dd8bc9ef744e20000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000024aa066520000000000000000000000000000000000000000000000000000000024dd285c00000000000000000000000000000000000000000000000000000000000000000000000000000000179bb2636f0066d837f1a446083a0fba131c1a460000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000020b58f0730000000000000000000000000000000000000000000000000000000088fcd16900000000000000000000000000000000000000000000000000000000000000000000000000000000729672c68134e2df0cdd36d3296841a2993534c700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000594daa22100000000000000000000000000000000000000000000000000000000e3d4e44c00000000000000000000000000000000000000000000000000000000f255da600000000000000000000000000000000000000000000000000000000093a39bea00000000000000000000000000000000000000000000000000000000363591d000000000000000000000000000000000000000000000000000000000000000000000000000000000729672c68134e2df0cdd36d3296841a2993534c7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016304ec65d00000000000000000000000000000000000000000000000000000000b6f42085000000000000000000000000000000000000000000000000000000001799b3b2000000000000000000000000000000000000000000000000000000001edb6be1000000000000000000000000000000000000000000000000000000009bb4e35a0000000000000000000000000000000000000000000000000000000083e0888800000000000000000000000000000000000000000000000000000000dc6ba285000000000000000000000000000000000000000000000000000000003944880200000000000000000000000000000000000000000000000000000000c85951a1000000000000000000000000000000000000000000000000000000009c45a1d50000000000000000000000000000000000000000000000000000000034af5416000000000000000000000000000000000000000000000000000000001e2231430000000000000000000000000000000000000000000000000000000029130a66000000000000000000000000000000000000000000000000000000004d6228310000000000000000000000000000000000000000000000000000000069744dd000000000000000000000000000000000000000000000000000000000f4a057e2000000000000000000000000000000000000000000000000000000006ae1c01400000000000000000000000000000000000000000000000000000000d47aee59000000000000000000000000000000000000000000000000000000004a16607c000000000000000000000000000000000000000000000000000000004f9a967800000000000000000000000000000000000000000000000000000000f9c4ebde00000000000000000000000000000000000000000000000000000000a3ef48c9000000000000000000000000000000000000000000000000000000000000000000000000000000000d8f6f09a2b806d406d511c113f2fc3f4d608fc1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004c20b80710000000000000000000000000000000000000000000000000000000006fdde030000000000000000000000000000000000000000000000000000000095d89b41000000000000000000000000000000000000000000000000000000000e89341c0000000000000000000000000000000000000000000000000000000000000000000000000000000092458b7ade7798c45e5ff583c353f70f950d66cf00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000364ee4b8000000000000000000000000000000000000000000000000000000000ca7b7d7b00000000000000000000000000000000000000000000000000000000fc06d2a6000000000000000000000000000000000000000000000000000000000000000000000000000000005a1675f3156c9e73d7ea20eb58470a0002865e850000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000232a27c49900000000000000000000000000000000000000000000000000000000eedc7ab9000000000000000000000000000000000000000000000000000000007ba6cbf800000000000000000000000000000000000000000000000000000000eb0e121500000000000000000000000000000000000000000000000000000000d1db56b80000000000000000000000000000000000000000000000000000000069aa7e0200000000000000000000000000000000000000000000000000000000cc88d4f900000000000000000000000000000000000000000000000000000000673c75f00000000000000000000000000000000000000000000000000000000064b3496b0000000000000000000000000000000000000000000000000000000093523425000000000000000000000000000000000000000000000000000000006488785200000000000000000000000000000000000000000000000000000000b2b0556d00000000000000000000000000000000000000000000000000000000141933bf00000000000000000000000000000000000000000000000000000000f98da2de00000000000000000000000000000000000000000000000000000000383f170f00000000000000000000000000000000000000000000000000000000d1943f7f00000000000000000000000000000000000000000000000000000000cb2d0a3c00000000000000000000000000000000000000000000000000000000cce813a1000000000000000000000000000000000000000000000000000000006af8e5a4000000000000000000000000000000000000000000000000000000007d23804d000000000000000000000000000000000000000000000000000000005053915900000000000000000000000000000000000000000000000000000000bbf459a700000000000000000000000000000000000000000000000000000000f788b47c00000000000000000000000000000000000000000000000000000000a13a37420000000000000000000000000000000000000000000000000000000093c9e531000000000000000000000000000000000000000000000000000000005c975abb00000000000000000000000000000000000000000000000000000000e60d7a8300000000000000000000000000000000000000000000000000000000471bcdbe0000000000000000000000000000000000000000000000000000000043def26e00000000000000000000000000000000000000000000000000000000c50b0fb0000000000000000000000000000000000000000000000000000000003b2ecb700000000000000000000000000000000000000000000000000000000016ada5470000000000000000000000000000000000000000000000000000000006c499d800000000000000000000000000000000000000000000000000000000686b615900000000000000000000000000000000000000000000000000000000597490c000000000000000000000000000000000000000000000000000000000000000000000000000000000d64bb5c2dbf12febefc6397926a3c0aa6f8b653500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000133f37f2700000000000000000000000000000000000000000000000000000000000000000000000000000000d64bb5c2dbf12febefc6397926a3c0aa6f8b6535000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016a84643e400000000000000000000000000000000000000000000000000000000787cee9900000000000000000000000000000000000000000000000000000000fa345569000000000000000000000000000000000000000000000000000000001acc0a47000000000000000000000000000000000000000000000000000000001be655e8000000000000000000000000000000000000000000000000000000009a516cad00000000000000000000000000000000000000000000000000000000087d78b4000000000000000000000000000000000000000000000000000000007caa025f00000000000000000000000000000000000000000000000000000000bfe2f3be000000000000000000000000000000000000000000000000000000006de45df200000000000000000000000000000000000000000000000000000000014a8a4900000000000000000000000000000000000000000000000000000000bb7de4780000000000000000000000000000000000000000000000000000000043cc4ee000000000000000000000000000000000000000000000000000000000ab434eb700000000000000000000000000000000000000000000000000000000adef4533000000000000000000000000000000000000000000000000000000009f06b3fa00000000000000000000000000000000000000000000000000000000b8a04d1b00000000000000000000000000000000000000000000000000000000691bcc8800000000000000000000000000000000000000000000000000000000fc6a19df0000000000000000000000000000000000000000000000000000000013ed3cea00000000000000000000000000000000000000000000000000000000d3c73ec800000000000000000000000000000000000000000000000000000000a33fa99f00000000000000000000000000000000000000000000000000000000000000000000000000000000de3a2284b50e345cb7985ee677595cc720fbbb0200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000b86b40a1b00000000000000000000000000000000000000000000000000000000e9522c0800000000000000000000000000000000000000000000000000000000d9ba32fc00000000000000000000000000000000000000000000000000000000170cf084000000000000000000000000000000000000000000000000000000009d1d287700000000000000000000000000000000000000000000000000000000e26f79000000000000000000000000000000000000000000000000000000000076a7bc8400000000000000000000000000000000000000000000000000000000ce5fb82100000000000000000000000000000000000000000000000000000000f18d9ed000000000000000000000000000000000000000000000000000000000371b5b0300000000000000000000000000000000000000000000000000000000052ebc26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000"
}

Overview

Init Contract

InitMigrateUnripeBeanEthToBeanSteth: 0x15A2053B3d559d19FeD2D7FC429304e837cEFa00

Facets Being Removed

Facets Being Added

Verifying the Transaction

Setup

  1. Follow 🏗️How to Setup Environment, pulling and compiling the latest changes on the add-steth-oracle branch.

The Diamond Cut Transaction

Add the following bip48enc 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 the one that corresponds to the BIP transaction by comparing it with the Raw data field on the Safe multisig transaction.

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

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. Add the following tasks to hardhat.config.js :
  2. task("verifybip-48", async function () {
      facetNames = [
        "BDVFacet",
        "ConvertFacet",
        "ConvertGettersFacet",
        "EnrootFacet",
        "FertilizerFacet",
        "MetadataFacet",
        "SeasonFacet",
        "SeasonGettersFacet",
        "UnripeFacet",
        "WhitelistFacet"
      ];
    
      facetLibraries = {
        ConvertFacet: { LibConvert: "0xc119B6D9cA264fc789a6Ae69C0e37D6dfe9cff27" },
        UnripeFacet: { LibLockedUnderlying: "0x165f9d2a986f70E472aA9569305105034A5DAe2E" },
        SeasonFacet: {
          LibGauge: "0x2d8ee96c167f8f42f0C447b830106179171AA9d5",
          LibIncentive: "0xa1a7662D2aFCE76aAc06460db7825cf99B7ec1B7",
          LibLockedUnderlying: "0x165f9d2a986f70E472aA9569305105034A5DAe2E",
          LibWellMinting: "0xB8e474D767D2278CD1D9CD05941182504BefdE96",
          LibGerminate: "0x08a8e42Bf3C4EF9608dC71a20106d1e028b97F71"
        },
        SeasonGettersFacet: {
          LibLockedUnderlying: "0x165f9d2a986f70E472aA9569305105034A5DAe2E",
          LibWellMinting: "0xB8e474D767D2278CD1D9CD05941182504BefdE96"
        },
        EnrootFacet: { LibSilo: "0xde6e83d979AcDC3f7848cd9C9eAF4911396097D1" }
      };
    
      deployedFacetAddresses = {
        BDVFacet: "0xaef84C2B863aB845F59f672d958B175262dcfc89",
        ConvertFacet: "0xEb1b833D3E81cb3d390514cabB9b809E6170626C",
        ConvertGettersFacet: "0x8ABa09526dc6EB6Ea44eE3f8745dD8bc9EF744E2",
        EnrootFacet: "0x179Bb2636F0066d837f1a446083A0FBA131c1A46",
        FertilizerFacet: "0x729672c68134E2DF0CdD36D3296841A2993534c7",
        MetadataFacet: "0x0d8f6F09a2B806d406d511C113f2Fc3F4D608Fc1",
        SeasonFacet: "0x92458b7ade7798c45E5ff583c353F70F950d66Cf",
        SeasonGettersFacet: "0x5A1675f3156c9e73D7eA20eb58470A0002865E85",
        UnripeFacet: "0xD64BB5c2dBf12fEBeFc6397926A3c0aA6f8b6535",
        WhitelistFacet: "0xDE3a2284b50E345cB7985EE677595cC720fbBB02"
      };
    
      // get the bytecode by deploying facets.
      data = await getFacetBytecode(facetNames, facetLibraries, true);
      // compare facet bytecode with on-chain bytecode.
      await compareBytecode(data, deployedFacetAddresses, false);
    });
    
    async function getFacetBytecode(facetNames, facetLibraries, verbose = false) {
      if (verbose) {
        console.log("Starting Bytecode Verification");
      }
      data = [];
      // loop through all facets:
      for (const facet of facetNames) {
        if (verbose) {
          console.log(`Deploying ${facet}`);
        }
    
        // check if facet is in facetLibraries:
        if (facet in facetLibraries) {
          // deploy libraries from facet dictionary:
          for (const [libraryName, address] of Object.entries(facetLibraries[facet])) {
            const libraryFactory = await ethers.getContractFactory(libraryName);
            libraryContract = await libraryFactory.deploy();
            await libraryContract.deployed();
            const bytecode = await ethers.provider.getCode(libraryContract.address);
            await network.provider.send("hardhat_setCode", [address, bytecode]);
          }
        }
    
        // deploy facet:
        const facetFactory = await ethers.getContractFactory(facet, {
          libraries: facetLibraries[facet]
        });
    
        facetContract = await facetFactory.deploy();
        await facetContract.deployed();
    
        const bytecode = await ethers.provider.getCode(facetContract.address);
        // add facet to data dictionary:
        facetData = {};
        facetData[facet] = {
          "Contract Creation Code": facetContract.deployTransaction["data"].slice(2),
          "Deployed Bytecode": bytecode
        };
        data.push(facetData);
      }
    
      // write data to file:
      const facetBytecode = `facetBytecode-${Math.floor(Date.now() / 1000)}-${facetNames.length}-facets.json`;
      fs.writeFileSync(`diamondCuts/${facetBytecode}`, JSON.stringify(data, null, 2));
      console.log(`Facet bytecode written to diamondCuts/${facetBytecode}`);
      return data;
    }
    
    async function compareBytecode(data, deployedFacetAddresses, verbose = true) {
      invalidFacets = [];
      validFacets = [];
      for (const facets of data) {
        const [name] = Object.keys(facets);
        address = deployedFacetAddresses[name];
        const onchainBytecode = await ethers.provider.getCode(address);
        const jsonBytecode = facets[name]["Deployed Bytecode"];
    
        if (onchainBytecode != jsonBytecode) {
          invalidFacets.push(name);
        } else {
          validFacets.push(name);
        }
      }
      if (verbose) {
        console.log("valid facets: ", validFacets);
        console.log("invalid facets: ", invalidFacets);
      }
      if (invalidFacets.length > 0) {
        console.log("Invalid Facet Bytecode: ", invalidFacets);
      } else {
        console.log("All Facets Bytecode are valid!");
      }
    }
    
    task("deploybip-48", async function () {
      const signer = await impersonateBeanstalkOwner();
    
      const beanstalk = "0xC1E088fC1323b20BCBee9bd1B9fC9546db5624C5";
    
      // verify data matches with tenderly
      // https://dashboard.tenderly.co/public/safe/safe-apps/simulator/7d140279-7dda-4a44-8f65-aee3e3660d71
      const data =
        "0x1f931c1c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000015a2053b3d559d19fed2d7fc429304e837cefa000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000000d00000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000006c00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000be000000000000000000000000000000000000000000000000000000000000010c0000000000000000000000000000000000000000000000000000000000000116000000000000000000000000000000000000000000000000000000000000014a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002208c2c9800000000000000000000000000000000000000000000000000000000bb02e10b00000000000000000000000000000000000000000000000000000000000000000000000000000000aef84c2b863ab845f59f672d958b175262dcfc890000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000055a049a4700000000000000000000000000000000000000000000000000000000f984019b00000000000000000000000000000000000000000000000000000000c8cda2a000000000000000000000000000000000000000000000000000000000b0c22bb100000000000000000000000000000000000000000000000000000000c84c772700000000000000000000000000000000000000000000000000000000000000000000000000000000eb1b833d3e81cb3d390514cabb9b809e6170626c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000001b362a6e8000000000000000000000000000000000000000000000000000000000000000000000000000000008aba09526dc6eb6ea44ee3f8745dd8bc9ef744e20000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000024aa066520000000000000000000000000000000000000000000000000000000024dd285c00000000000000000000000000000000000000000000000000000000000000000000000000000000179bb2636f0066d837f1a446083a0fba131c1a460000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000020b58f0730000000000000000000000000000000000000000000000000000000088fcd16900000000000000000000000000000000000000000000000000000000000000000000000000000000729672c68134e2df0cdd36d3296841a2993534c700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000594daa22100000000000000000000000000000000000000000000000000000000e3d4e44c00000000000000000000000000000000000000000000000000000000f255da600000000000000000000000000000000000000000000000000000000093a39bea00000000000000000000000000000000000000000000000000000000363591d000000000000000000000000000000000000000000000000000000000000000000000000000000000729672c68134e2df0cdd36d3296841a2993534c7000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016304ec65d00000000000000000000000000000000000000000000000000000000b6f42085000000000000000000000000000000000000000000000000000000001799b3b2000000000000000000000000000000000000000000000000000000001edb6be1000000000000000000000000000000000000000000000000000000009bb4e35a0000000000000000000000000000000000000000000000000000000083e0888800000000000000000000000000000000000000000000000000000000dc6ba285000000000000000000000000000000000000000000000000000000003944880200000000000000000000000000000000000000000000000000000000c85951a1000000000000000000000000000000000000000000000000000000009c45a1d50000000000000000000000000000000000000000000000000000000034af5416000000000000000000000000000000000000000000000000000000001e2231430000000000000000000000000000000000000000000000000000000029130a66000000000000000000000000000000000000000000000000000000004d6228310000000000000000000000000000000000000000000000000000000069744dd000000000000000000000000000000000000000000000000000000000f4a057e2000000000000000000000000000000000000000000000000000000006ae1c01400000000000000000000000000000000000000000000000000000000d47aee59000000000000000000000000000000000000000000000000000000004a16607c000000000000000000000000000000000000000000000000000000004f9a967800000000000000000000000000000000000000000000000000000000f9c4ebde00000000000000000000000000000000000000000000000000000000a3ef48c9000000000000000000000000000000000000000000000000000000000000000000000000000000000d8f6f09a2b806d406d511c113f2fc3f4d608fc1000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000004c20b80710000000000000000000000000000000000000000000000000000000006fdde030000000000000000000000000000000000000000000000000000000095d89b41000000000000000000000000000000000000000000000000000000000e89341c0000000000000000000000000000000000000000000000000000000000000000000000000000000092458b7ade7798c45e5ff583c353f70f950d66cf00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000364ee4b8000000000000000000000000000000000000000000000000000000000ca7b7d7b00000000000000000000000000000000000000000000000000000000fc06d2a6000000000000000000000000000000000000000000000000000000000000000000000000000000005a1675f3156c9e73d7ea20eb58470a0002865e850000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000232a27c49900000000000000000000000000000000000000000000000000000000eedc7ab9000000000000000000000000000000000000000000000000000000007ba6cbf800000000000000000000000000000000000000000000000000000000eb0e121500000000000000000000000000000000000000000000000000000000d1db56b80000000000000000000000000000000000000000000000000000000069aa7e0200000000000000000000000000000000000000000000000000000000cc88d4f900000000000000000000000000000000000000000000000000000000673c75f00000000000000000000000000000000000000000000000000000000064b3496b0000000000000000000000000000000000000000000000000000000093523425000000000000000000000000000000000000000000000000000000006488785200000000000000000000000000000000000000000000000000000000b2b0556d00000000000000000000000000000000000000000000000000000000141933bf00000000000000000000000000000000000000000000000000000000f98da2de00000000000000000000000000000000000000000000000000000000383f170f00000000000000000000000000000000000000000000000000000000d1943f7f00000000000000000000000000000000000000000000000000000000cb2d0a3c00000000000000000000000000000000000000000000000000000000cce813a1000000000000000000000000000000000000000000000000000000006af8e5a4000000000000000000000000000000000000000000000000000000007d23804d000000000000000000000000000000000000000000000000000000005053915900000000000000000000000000000000000000000000000000000000bbf459a700000000000000000000000000000000000000000000000000000000f788b47c00000000000000000000000000000000000000000000000000000000a13a37420000000000000000000000000000000000000000000000000000000093c9e531000000000000000000000000000000000000000000000000000000005c975abb00000000000000000000000000000000000000000000000000000000e60d7a8300000000000000000000000000000000000000000000000000000000471bcdbe0000000000000000000000000000000000000000000000000000000043def26e00000000000000000000000000000000000000000000000000000000c50b0fb0000000000000000000000000000000000000000000000000000000003b2ecb700000000000000000000000000000000000000000000000000000000016ada5470000000000000000000000000000000000000000000000000000000006c499d800000000000000000000000000000000000000000000000000000000686b615900000000000000000000000000000000000000000000000000000000597490c000000000000000000000000000000000000000000000000000000000000000000000000000000000d64bb5c2dbf12febefc6397926a3c0aa6f8b653500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000133f37f2700000000000000000000000000000000000000000000000000000000000000000000000000000000d64bb5c2dbf12febefc6397926a3c0aa6f8b6535000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000016a84643e400000000000000000000000000000000000000000000000000000000787cee9900000000000000000000000000000000000000000000000000000000fa345569000000000000000000000000000000000000000000000000000000001acc0a47000000000000000000000000000000000000000000000000000000001be655e8000000000000000000000000000000000000000000000000000000009a516cad00000000000000000000000000000000000000000000000000000000087d78b4000000000000000000000000000000000000000000000000000000007caa025f00000000000000000000000000000000000000000000000000000000bfe2f3be000000000000000000000000000000000000000000000000000000006de45df200000000000000000000000000000000000000000000000000000000014a8a4900000000000000000000000000000000000000000000000000000000bb7de4780000000000000000000000000000000000000000000000000000000043cc4ee000000000000000000000000000000000000000000000000000000000ab434eb700000000000000000000000000000000000000000000000000000000adef4533000000000000000000000000000000000000000000000000000000009f06b3fa00000000000000000000000000000000000000000000000000000000b8a04d1b00000000000000000000000000000000000000000000000000000000691bcc8800000000000000000000000000000000000000000000000000000000fc6a19df0000000000000000000000000000000000000000000000000000000013ed3cea00000000000000000000000000000000000000000000000000000000d3c73ec800000000000000000000000000000000000000000000000000000000a33fa99f00000000000000000000000000000000000000000000000000000000000000000000000000000000de3a2284b50e345cb7985ee677595cc720fbbb0200000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000b86b40a1b00000000000000000000000000000000000000000000000000000000e9522c0800000000000000000000000000000000000000000000000000000000d9ba32fc00000000000000000000000000000000000000000000000000000000170cf084000000000000000000000000000000000000000000000000000000009d1d287700000000000000000000000000000000000000000000000000000000e26f79000000000000000000000000000000000000000000000000000000000076a7bc8400000000000000000000000000000000000000000000000000000000ce5fb82100000000000000000000000000000000000000000000000000000000f18d9ed000000000000000000000000000000000000000000000000000000000371b5b0300000000000000000000000000000000000000000000000000000000052ebc26000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004e1c7392a00000000000000000000000000000000000000000000000000000000";
    
      // Create the transaction object
      const tx = {
        to: beanstalk,
        data: data
      };
    
      // Send the transaction
      const txResponse = await signer.sendTransaction(tx);
    
      // Wait for the transaction to be mined
      await txResponse.wait();
    
      console.log("Transaction sent:", txResponse.hash);
    });
  3. Verify that each facet has the correct deployed code by:
  4. Runing an anvil node forked from mainnet:

    anvil --fork-url https://eth.llamarpc.com --chain-id 1337 

    Runing the script in a separate window in the protocol/ directory:

    npx hardhat clean && npx hardhat compile && npx hardhat verifybip-48 --network localhost

    Validate that facet bytecode are correct.

Submitting Message Signature

Once Signers have verified the transaction, they shall submit and sign a verified message on Etherscan with their BCM address (guide).

Template message: Confirming that I have reviewed BIP-48 with BCM transaction nonce 77, Safe transaction hash 0x5765a2aaf25f2a2d41abdc8602e41b5746684e9e82df02cca85d97a6286fc5be, commit hash 45afeaf1f9c57bcdf506336aff63fa8805a1081f and Snapshot proposal https://snapshot.org/#/beanstalkdao.eth/proposal/0x7a9167d3e201225a3352b4643c9aeaac8916b8cb018796bd72b95adf6f0c5bbd.