From d4ef892c0010ce701e92e26706e056012a0e5f44 Mon Sep 17 00:00:00 2001 From: Drew Date: Wed, 6 Mar 2024 11:25:33 -0500 Subject: [PATCH] deployment, reset, and test scripts for tractor sdk using not-yet-existing contracts --- package.json | 2 ++ projects/sdk/src/constants/addresses.ts | 1 + protocol/hardhat.config.js | 29 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/package.json b/package.json index 7a70051cd8..b26639fc99 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,8 @@ "sdk:dev": "yarn workspace @beanstalk/sdk dev", "sdk:build": "yarn workspace @beanstalk/sdk build", "sdk:test": "jest --selectProjects sdk --silent --runInBand --", + "sdk:tractor:reset": "cd protocol; npx hardhat tractor_sdk_test_init --network localhost; cd ..;", + "sdk:tractor:test": "yarn sdk:test -t 'tractor' --network localhost --verbose", "sdk-wells:test": "jest --selectProjects sdk-wells --runInBand --silent=false --", "sdk-wells:test:watch": "jest --selectProjects sdk-wells --runInBand --watch --verbose true --", "sdk:testdev": "jest --selectProjects sdk --watch --runInBand --", diff --git a/projects/sdk/src/constants/addresses.ts b/projects/sdk/src/constants/addresses.ts index 4329c267df..d1094cc1dc 100644 --- a/projects/sdk/src/constants/addresses.ts +++ b/projects/sdk/src/constants/addresses.ts @@ -16,6 +16,7 @@ export const addresses = { PIPELINE: Address.make("0xb1bE0000C6B3C62749b5F0c92480146452D15423"), ROOT: Address.make("0x77700005BEA4DE0A78b956517f099260C2CA9a26"), USD_ORACLE: Address.make("0x1aa19ed7DfC555E4644c9353Ad383c33024855F7"), + JUNCTION: Address.make("0x0f88D35a40bCF9FbE024DBB5df4e4504086336b0"), // ---------------------------------------- // BeaNFT Contracts diff --git a/protocol/hardhat.config.js b/protocol/hardhat.config.js index 14c5244eb0..6fd60b88dd 100644 --- a/protocol/hardhat.config.js +++ b/protocol/hardhat.config.js @@ -188,6 +188,35 @@ task("diamondABI", "Generates ABI file for diamond, includes all ABIs of facets" console.log("ABI written to abi/Beanstalk.json"); }); +// Used for testing Tractor. +task("tractor_sdk_test_init", async function () { + await network.provider.request({ + method: "hardhat_reset", + params: [ + { + forking: { + jsonRpcUrl: process.env.FORKING_RPC, + blockNumber: parseInt(process.env.BLOCK_NUMBER), + }, + }, + ], + }); + + const owner = await impersonateBeanstalkOwner(); + await mintEth(owner.address); + await upgradeWithNewFacets({ + diamondAddress: BEANSTALK, + facetNames: ["TractorFacet"], + bip: false, + verbose: false, + account: owner + }); + console.log("TractorFacet cut"); + + const tractor = await ethers.deployContract("Junction", [], owner); + console.log("Junctions deployed to ", tractor.address); +}); + task("marketplace", async function () { const owner = await impersonateBeanstalkOwner(); await mintEth(owner.address);