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

fix: add event topics for Spectra Finance #10658

Merged
merged 2 commits into from
Jun 15, 2024
Merged
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
9 changes: 9 additions & 0 deletions projects/spectra/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ module.exports = {
methodology: `All deposited underlying in Spectra Principal Tokens and all underlying supplied as liquidity in Spectra Markets`,
};

const curvePoolDeployedTopic =
"0x3c7b686d948efcba31c9cfd1aeae78faac70fe0c1ed90d151d49c75e85027a91";
const ptDeployedTopic =
"0xcf50c3e7162cc35f5befd4f0379ddd760d499ca96330c9ae8faa4059919caaee";

Object.keys(config).forEach((chain) => {
const { factory, fromBlock } = config[chain];
module.exports[chain] = {
Expand Down Expand Up @@ -89,10 +94,12 @@ Object.keys(config).forEach((chain) => {
const logs = await getLogs({
api,
target: factory,
topic: curvePoolDeployedTopic,
eventAbi:
"event CurvePoolDeployed(address indexed poolAddress, address indexed ibt, address indexed pt)",
onlyArgs: true,
fromBlock: fromBlock,
extraKey: "markets",
});
return logs.map((i) => [i.poolAddress, i.ibt]);
}
Expand All @@ -101,10 +108,12 @@ Object.keys(config).forEach((chain) => {
const logs = await getLogs({
api,
target: factory,
topic: ptDeployedTopic,
eventAbi:
"event PTDeployed(address indexed pt, address indexed poolCreator)",
onlyArgs: true,
fromBlock: fromBlock,
extraKey: "pts",
});
return logs.map((i) => i.pt);
}
Expand Down
Loading