Skip to content

Commit

Permalink
add sepolia oracle contract and tables
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Aug 22, 2024
1 parent 7df096a commit dba6ee8
Show file tree
Hide file tree
Showing 5 changed files with 730 additions and 627 deletions.
1 change: 1 addition & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ NFT_ADDRESS="0x07b696af58c967c1b14c9dde0ace001720635a660a8e90c565ea459345318b30"
TOKEN_REGISTRY_ADDRESS="0x006f55e718ae592b22117c3e3b557b6b2b5f827ddcd7e6fdebd1a4ce7462c93e"
TOKEN_REGISTRY_V2_ADDRESS="0x0013e25867b6eef62703735aa4cfa7754e72f4e94a56c9d3d9ad8ebe86cee4aa"
TWAMM_ADDRESS="0x043e4f09c32d13d43a880e85f69f7de93ceda62d6cf2581a582c6db635548fdc"
ORACLE_ADDRESS="0x0"

STAKER_ADDRESS="0x02a3ed03046e1042e193651e3da6d3c973e3d45c624442be936a374380a78bb5"
GOVERNOR_ADDRESS="0x053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd"
Expand Down
1 change: 1 addition & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ NFT_ADDRESS="0x04afc78d6fec3b122fc1f60276f074e557749df1a77a93416451be72c435120f"
TOKEN_REGISTRY_ADDRESS="0x0293c0d738eff5aa65619069d437eba2bcb320fb8003f37c9708afcdbe8739c8"
TOKEN_REGISTRY_V2_ADDRESS="0x0"
TWAMM_ADDRESS="0x073ec792c33b52d5f96940c2860d512b3884f2127d25e023eb9d44a678e4b971"
ORACLE_ADDRESS="0x003ccf3ee24638dd5f1a51ceb783e120695f53893f6fd947cc2dcabb3f86dc65"

STAKER_ADDRESS="0x0359c9a32c758a162a6c59a9cff93f09a2eb2dbe82cba9ecbdd64aa4314f8687"
GOVERNOR_ADDRESS="0x048bb83134ce6a312d1b41b0b3deccc4ce9a9d280e6c68c0eb1c517259c89d74"
Expand Down
21 changes: 19 additions & 2 deletions src/EVENT_PROCESSORS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,25 @@ import {
} from "./events/staker";
import {
DescribedEvent,
GovernorReconfiguredEvent,
GovernorCanceledEvent,
GovernorCreationThresholdBreached,
GovernorExecutedEvent,
GovernorProposedEvent,
GovernorReconfiguredEvent,
GovernorVotedEvent,
parseDescribedEvent,
parseGovernorCanceledEvent,
parseGovernorCreationThresholdBreached,
parseGovernorExecutedEvent,
parseGovernorProposedEvent,
parseGovernorVotedEvent,
parseGovernorReconfigured,
parseGovernorVotedEvent,
} from "./events/governor";
import {
parseRegistrationEvent,
TokenRegistrationEvent,
} from "./events/tokenRegistry";
import { parseSnapshotEvent, SnapshotEvent } from "./events/oracle";

export const EVENT_PROCESSORS = [
<EventProcessor<LegacyPositionMintedEvent>>{
Expand Down Expand Up @@ -449,4 +450,20 @@ export const EVENT_PROCESSORS = [
await dao.insertGovernorReconfiguredEvent(parsed, key);
},
},
<EventProcessor<SnapshotEvent>>{
filter: {
fromAddress: FieldElement.fromBigInt(process.env.ORACLE_ADDRESS),
keys: [
// SnapshotEvent
FieldElement.fromBigInt(
0x0385e1b60fdfb8aeee9212a69cdb72415cef7b24ec07a60cdd65b65d0582238bn
),
],
},
parser: parseSnapshotEvent,
async handle(dao, { parsed, key }): Promise<void> {
logger.debug("Snapshot", { parsed, key });
await dao.insertOracleSnapshotEvent(parsed, key);
},
},
] as const;
Loading

0 comments on commit dba6ee8

Please sign in to comment.