-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
135 changed files
with
2,751 additions
and
926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v18.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { BeanstalkSDK } from "@beanstalk/sdk"; | ||
import chalk from "chalk"; | ||
|
||
export const getDeltaB = async (sdk: BeanstalkSDK) => { | ||
const deltaB = await sdk.bean.getDeltaB(); | ||
console.log(`${chalk.bold.whiteBright("DeltaB: ")} ${chalk.greenBright(deltaB.toHuman())}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { BeanstalkSDK } from "@beanstalk/sdk"; | ||
import { BlockchainUtils } from "@beanstalk/sdk/dist/types/utils/TestUtils"; | ||
import chalk from "chalk"; | ||
import { table } from "table"; | ||
|
||
export const setDeltaB = async (sdk: BeanstalkSDK, chain: BlockchainUtils, direction: string, amount) => { | ||
const multiplier = amount === "50000" ? 2 : amount; | ||
if (direction === "down") { | ||
await chain.setPriceUnder1(multiplier); | ||
} else if (direction === "up") { | ||
await chain.setPriceOver1(multiplier); | ||
} else { | ||
console.log(`unknown input: ${direction}. Expected "up", or "down"`); | ||
} | ||
|
||
const deltaB = await sdk.bean.getDeltaB(); | ||
console.log(`${chalk.bold.whiteBright("New DeltaB: ")} ${chalk.greenBright(deltaB.toHuman())}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { TokenValue } from "@beanstalk/sdk-core"; | ||
import { account as _account, impersonate, chain } from "./setup"; | ||
import { defaultAbiCoder } from "ethers/lib/utils"; | ||
|
||
main().catch((e) => { | ||
console.log("FAILED:"); | ||
console.log(e); | ||
}); | ||
|
||
async function main() { | ||
const account = process.argv[3] || _account; | ||
const { sdk, stop } = await impersonate(account); | ||
sdk.DEBUG = false; | ||
|
||
let deltaB = await sdk.bean.getDeltaB(); | ||
|
||
if (deltaB.gte(TokenValue.ZERO)) { | ||
await chain.setPriceUnder1(); | ||
} else { | ||
await chain.setPriceOver1(); | ||
} | ||
// chain.mine() | ||
deltaB = await sdk.bean.getDeltaB(); | ||
console.log("New DeltaB: ", deltaB.toHuman()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import chalk from "chalk"; | ||
import { account as _account, impersonate, chain } from "./setup"; | ||
|
||
main().catch((e) => { | ||
console.log("FAILED:"); | ||
console.log(e); | ||
}); | ||
|
||
async function main() { | ||
const account = process.argv[3] || _account; | ||
console.log(`${chalk.bold.whiteBright("Account:")} ${chalk.greenBright(account)}`); | ||
const { sdk, stop } = await impersonate(account); | ||
|
||
console.log("--- SWAP ---"); | ||
sdk.swap.getGraph(); | ||
|
||
console.log("\n\n--- DEPOSIT ----"); | ||
// @ts-ignore | ||
sdk.silo.depositBuilder.getGraph(); | ||
await stop(); | ||
} |
10 changes: 10 additions & 0 deletions
10
projects/sdk-wells/src/constants/abi/UnwrapAndSendEthJunction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"inputs": [{ "internalType": "address", "name": "to", "type": "address" }], | ||
"name": "unwrapAndSendETH", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ "stateMutability": "payable", "type": "receive" } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.