-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add mainnet deployment addresses
- Loading branch information
Showing
8 changed files
with
127 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const YearnGovernance = "0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52"; | ||
export const Addresses = !process.env.WEB3_PROVIDER && { | ||
adapters: { | ||
registryV2: "0xFbD588c72B438faD4Cf7cD879c8F730Faa213Da0", | ||
ironBank: "0xed00238F9A0F7b4d93842033cdF56cCB32C781c2" | ||
}, | ||
helper: "0x420b1099B9eF5baba6D92029594eF45E19A04A4A", | ||
oracle: "0xE7eD6747FaC5360f88a2EFC03E00d25789F69291" | ||
}; |
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,40 @@ | ||
import Table from "cli-table3"; | ||
|
||
import { JsonRpcProvider } from "@ethersproject/providers"; | ||
import { YearnGovernance, Addresses } from "./common.mjs"; | ||
|
||
import { Yearn } from "../dist/index.js"; | ||
|
||
const url = process.env.WEB3_PROVIDER || "http://localhost:8545"; | ||
const provider = new JsonRpcProvider(url); | ||
|
||
const yearn = new Yearn(1, { | ||
provider, | ||
addresses: Addresses | ||
}); | ||
|
||
async function main() { | ||
const ironBank = await yearn.ironBank.get(); | ||
|
||
const ironBankTable = new Table(); | ||
ironBankTable.push(...ironBank.map(market => [market.name, market.address, market.typeId])); | ||
|
||
console.log("IronBank markets:"); | ||
console.log(ironBankTable.toString()); | ||
|
||
const ironBankGeneralPositionTable = new Table(); | ||
const ironBankGeneralPosition = await yearn.ironBank.generalPositionOf(YearnGovernance); | ||
|
||
ironBankGeneralPositionTable.push(...Object.entries(ironBankGeneralPosition)); | ||
console.log("Yearn Multisig general IronBank position:"); | ||
console.log(ironBankGeneralPositionTable.toString()); | ||
|
||
const ironBankUserMetadataTable = new Table(); | ||
const ironBankUserMetadata = await yearn.ironBank.userMetadata(YearnGovernance); | ||
|
||
ironBankUserMetadataTable.push(...ironBankUserMetadata.map(market => Object.values(market))); | ||
console.log("Yearn Multisig IronBank user metadata:"); | ||
console.log(ironBankUserMetadataTable.toString()); | ||
} | ||
|
||
main(); |
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
import Table from "cli-table3"; | ||
|
||
import { JsonRpcProvider } from "@ethersproject/providers"; | ||
import { YearnGovernance, Addresses } from "./common.mjs"; | ||
|
||
import { Yearn } from "../dist/index.js"; | ||
|
||
const url = process.env.WEB3_PROVIDER || "http://localhost:8545"; | ||
const provider = new JsonRpcProvider(url); | ||
|
||
const yearn = new Yearn(1, { | ||
provider, | ||
addresses: Addresses | ||
}); | ||
|
||
async function main() { | ||
// Get all tokens supported by zapper | ||
const supported = await yearn.tokens.supported(); | ||
console.log("Zapper supported tokens:", supported.length); | ||
|
||
// Get token balances for common coins in ETH mainnet | ||
const balances = await yearn.tokens.balances(YearnGovernance); | ||
|
||
const balancesTable = new Table(); | ||
balancesTable.push(...balances.map(balance => [balance.token.name, balance.balance, balance.balanceUsdc])); | ||
|
||
console.log("Yearn Multisig token balances:"); | ||
console.log(balancesTable.toString()); | ||
} | ||
|
||
main(); |
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,39 @@ | ||
import Table from "cli-table3"; | ||
|
||
import { JsonRpcProvider } from "@ethersproject/providers"; | ||
import { YearnGovernance, Addresses } from "./common.mjs"; | ||
|
||
import { Yearn } from "../dist/index.js"; | ||
|
||
const url = process.env.WEB3_PROVIDER || "http://localhost:8545"; | ||
const provider = new JsonRpcProvider(url); | ||
|
||
const yearn = new Yearn(1, { | ||
provider, | ||
addresses: Addresses | ||
}); | ||
|
||
async function main() { | ||
const vaults = await yearn.vaults.get(); | ||
|
||
const vaultsTable = new Table(); | ||
vaultsTable.push(...vaults.map(vault => [vault.name, vault.address, vault.typeId])); | ||
|
||
console.log("V1 & V2 vaults:"); | ||
console.log(vaultsTable.toString()); | ||
|
||
const positions = await yearn.vaults.positionsOf(YearnGovernance); | ||
|
||
const positionsTable = new Table(); | ||
positionsTable.push( | ||
...positions.map(position => { | ||
const vault = vaults.find(vault => (vault.address = position.assetAddress)); | ||
return [vault.name, position.balance]; | ||
}) | ||
); | ||
|
||
console.log("Yearn Multisig vault positions:"); | ||
console.log(positionsTable.toString()); | ||
} | ||
|
||
main(); |
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