Skip to content

Commit

Permalink
deployment, reset, and test scripts for tractor sdk using not-yet-exi…
Browse files Browse the repository at this point in the history
…sting contracts
  • Loading branch information
funderbrker committed Mar 6, 2024
1 parent 23cc9d1 commit d4ef892
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 --",
Expand Down
1 change: 1 addition & 0 deletions projects/sdk/src/constants/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions protocol/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d4ef892

Please sign in to comment.