What does .attach() method do in Beacon Proxy upgrade script (hardhat)?

I'm using the script to upgrade beacon proxies as outlined in Hardhat's docs here but I'm confused by the last line in the upgrade script file.

What does the following line accomplish? (photo attached)

const box = BoxV2.attach(BOX_ADDRESS);

it gives you a contract object that is attached to that address. Means any method you call will be called on the contract of that address

2 Likes

gotcha.

I usually call contract methods from frontend so wasn't sure but this makes sense

1 Like