Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add more assets to Base deployment #589

Merged
merged 3 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-pandas-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@enzymefinance/environment": patch
---

Add more assets to Base deployment
60 changes: 56 additions & 4 deletions packages/environment/src/assets/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default defineAssetList(Network.BASE, [
decimals: 18,
id: "0x50c5725949a6f0c72e6c4a641f24049a917db0cb",
name: "Dai Stablecoin",
releases: [],
releases: [sulu],
symbol: "DAI",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -45,7 +45,7 @@ export default defineAssetList(Network.BASE, [
decimals: 18,
id: "0x9e1028f5f1d5ede59748ffcee5532509976840e0",
name: "Compound",
releases: [],
releases: [sulu],
symbol: "COMP",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -55,10 +55,23 @@ export default defineAssetList(Network.BASE, [
},
},
{
decimals: 18,
decimals: 6,
id: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
name: "USD Coin",
releases: [sulu],
symbol: "USDC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x7e860098f58bbfc8648a4311b374b1d669a2bc6b",
rateAsset: RateAsset.USD,
},
},
{
decimals: 6,
id: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
name: "Tether USD",
releases: [],
releases: [sulu],
symbol: "USDT",
type: AssetType.PRIMITIVE,
priceFeed: {
Expand All @@ -67,4 +80,43 @@ export default defineAssetList(Network.BASE, [
rateAsset: RateAsset.USD,
},
},
{
decimals: 8,
id: "0x0555e30da8f98308edb960aa94c0db47230d2b9c",
name: "Wrapped BTC",
releases: [sulu],
symbol: "WBTC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0xccadc697c55bbb68dc5bcdf8d3cbe83cdd4e071e",
rateAsset: RateAsset.USD,
},
},
{
decimals: 18,
id: "0xd4a0e0b9149bcee3c920d2e00b5de09138fd8bb7",
name: "Aave Base WETH",
releases: [sulu],
symbol: "aBasWETH",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x71041dddad3595f9ced3dccfbe3d1f4b0a16bb70",
rateAsset: RateAsset.USD,
},
},
{
decimals: 6,
id: "0x4e65fe4dba92790696d040ac24aa414708f5c0ab",
name: "Aave Base USDC",
releases: [sulu],
symbol: "aBasUSDC",
type: AssetType.PRIMITIVE,
priceFeed: {
type: PriceFeedType.PRIMITIVE_CHAINLINK,
aggregator: "0x7e860098f58bbfc8648a4311b374b1d669a2bc6b",
rateAsset: RateAsset.USD,
},
},
]);
23 changes: 18 additions & 5 deletions packages/environment/test/utils/client.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { http, createPublicClient } from "viem";
import { arbitrum, mainnet, polygon } from "viem/chains";
import { http, type PublicClient, createPublicClient } from "viem";
import { arbitrum, base, mainnet, polygon } from "viem/chains";
import { Network } from "../../src/networks.js";

export function getClient(network: Network) {
const chain = network === Network.ETHEREUM ? mainnet : network === Network.POLYGON ? polygon : arbitrum;
const chain =
network === Network.ARBITRUM
? arbitrum
: network === Network.BASE
? base
: network === Network.POLYGON
? polygon
: mainnet;
const url = `https://${
network === Network.ETHEREUM ? "eth" : network === Network.POLYGON ? "polygon" : "arb"
network === Network.ARBITRUM
? "arb"
: network === Network.BASE
? "base"
: network === Network.POLYGON
? "polygon"
: "eth"
}-mainnet.g.alchemy.com/v2/${process.env.VITE_ALCHEMY_API_KEY}`;

return createPublicClient({
chain,
transport: http(url, { batch: true }),
});
}) as PublicClient; // TODO: remove typecasting (currently breaks for the Base network client)
}
Loading