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: linea activation #573

Merged
merged 15 commits into from
Feb 4, 2025
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

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,4 @@ scroll = { key = "${ETHERSCAN_API_KEY_SCROLL}", chainId = 534352 }
zksync = { key = "${ETHERSCAN_API_KEY_ZKSYNC}", chain = 324 }
linea = { key = "${ETHERSCAN_API_KEY_LINEA}", chain = 59144 }


# See more config options https://github.com/gakonst/foundry/tree/master/config
4 changes: 2 additions & 2 deletions generator/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {freezeUpdates} from './features/freeze';
import {emissionUpdates} from './features/emission';
import {assetListing, assetListingCustom} from './features/assetListing';
import {generateFiles, writeFiles} from './generator';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
import {getClient} from '@bgd-labs/rpc-env';
import {getBlockNumber} from 'viem/actions';

const program = new Command();
Expand Down Expand Up @@ -87,7 +87,7 @@ const FEATURE_MODULES_V3 = [

async function generateDeterministicPoolCache(pool: PoolIdentifier): Promise<PoolCache> {
const chain = getPoolChain(pool);
const client = CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]];
const client = getClient(CHAIN_TO_CHAIN_ID[chain], {});
return {blockNumber: Number(await getBlockNumber(client))};
}

Expand Down
4 changes: 2 additions & 2 deletions generator/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
linea,
} from 'viem/chains';
import {Hex, getAddress} from 'viem';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
import {getClient} from '@bgd-labs/rpc-env';

export const AVAILABLE_CHAINS = [
'Ethereum',
Expand Down Expand Up @@ -62,7 +62,7 @@ export function getPoolChain(pool: PoolIdentifier) {
}

export function getExplorerLink(chainId: number, address: Hex) {
const client = CHAIN_ID_CLIENT_MAP[chainId];
const client = getClient(chainId, {});
let url = client.chain?.blockExplorers?.default.url;
if (url && url.endsWith('/')) {
url = url.slice(0, -1); // sanitize explorer url
Expand Down
2 changes: 1 addition & 1 deletion generator/features/assetListing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {stringPrompt} from '../prompts/stringPrompt';
import {translateJsBoolToSol} from '../prompts/boolPrompt';
import {transformNumberToPercent, translateJsPercentToSol} from '../prompts/percentPrompt';
import {transformNumberToHumanReadable, translateJsNumberToSol} from '../prompts/numberPrompt';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
import {getClient} from '@bgd-labs/rpc-env';
import {IERC20Detailed_ABI} from '@bgd-labs/aave-address-book/abis';

async function fetchListing(pool: PoolIdentifier): Promise<Listing> {
Expand Down
4 changes: 2 additions & 2 deletions generator/features/emission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {CHAIN_TO_CHAIN_ID, getPoolChain, getExplorerLink} from '../common';
import {TEST_EXECUTE_PROPOSAL} from '../utils/constants';
import {EmissionUpdate} from './types';
import {addressPrompt, translateJsAddressToSol} from '../prompts/addressPrompt';
import {CHAIN_ID_CLIENT_MAP} from '@bgd-labs/js-utils';
import {getClient} from '@bgd-labs/rpc-env';

async function fetchEmission(pool: PoolIdentifier): Promise<EmissionUpdate> {
const asset = await addressPrompt({
Expand All @@ -26,7 +26,7 @@ async function fetchEmission(pool: PoolIdentifier): Promise<EmissionUpdate> {
type: 'function',
},
],
client: CHAIN_ID_CLIENT_MAP[CHAIN_TO_CHAIN_ID[chain]],
client: getClient(CHAIN_TO_CHAIN_ID[chain], {}),
address: asset,
});
let symbol = '';
Expand Down
32 changes: 8 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@bgd-labs/aave-address-book": "4.8.0",
"@bgd-labs/aave-cli": "^1.1.12",
"@bgd-labs/js-utils": "^1.4.7-26df3486a64891c314113e00d6444724493df97e.0",
"@bgd-labs/js-utils": "^1.4.7",
"@inquirer/prompts": "^7.1.0",
"@inquirer/testing": "^2.1.37",
"catapulta-verify": "^1.2.1",
Expand Down
Loading
Loading