-
Notifications
You must be signed in to change notification settings - Fork 195
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
Update subgraphs for m2 contract changes #192
Merged
mooselumph
merged 3 commits into
Layr-Labs:m2-mainnet-contracts
from
mooselumph:m2-mainnet-contracts-subgraphs
Jan 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10,460 changes: 10,460 additions & 0 deletions
10,460
subgraphs/eigenda-operator-state/abis/BLSApkRegistry.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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,65 @@ | ||
import { | ||
OperatorAddedToQuorums as OperatorAddedToQuorumsEvent, | ||
OperatorRemovedFromQuorums as OperatorRemovedFromQuorumsEvent | ||
} from "../generated/BLSApkRegistry/BLSApkRegistry" | ||
import { | ||
OperatorAddedToQuorum, | ||
OperatorRemovedFromQuorum | ||
} from "../generated/schema" | ||
|
||
import { NewPubkeyRegistration as NewPubkeyRegistrationEvent } from "../generated/BLSApkRegistry/BLSApkRegistry" | ||
import { NewPubkeyRegistration } from "../generated/schema" | ||
|
||
|
||
|
||
|
||
export function handleOperatorAddedToQuorums( | ||
event: OperatorAddedToQuorumsEvent | ||
): void { | ||
let entity = new OperatorAddedToQuorum( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operator = event.params.operator | ||
entity.quorumNumbers = event.params.quorumNumbers | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleOperatorRemovedFromQuorums( | ||
event: OperatorRemovedFromQuorumsEvent | ||
): void { | ||
let entity = new OperatorRemovedFromQuorum( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operator = event.params.operator | ||
entity.quorumNumbers = event.params.quorumNumbers | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleNewPubkeyRegistration( | ||
event: NewPubkeyRegistrationEvent | ||
): void { | ||
let entity = new NewPubkeyRegistration( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operator = event.params.operator | ||
entity.pubkeyG1_X = event.params.pubkeyG1.X | ||
entity.pubkeyG1_Y = event.params.pubkeyG1.Y | ||
entity.pubkeyG2_X = event.params.pubkeyG2.X | ||
entity.pubkeyG2_Y = event.params.pubkeyG2.Y | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} |
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
98 changes: 98 additions & 0 deletions
98
subgraphs/eigenda-operator-state/src/registry-coordinator.ts
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,98 @@ | ||
import { | ||
ChurnApproverUpdated as ChurnApproverUpdatedEvent, | ||
Initialized as InitializedEvent, | ||
OperatorDeregistered as OperatorDeregisteredEvent, | ||
OperatorRegistered as OperatorRegisteredEvent, | ||
OperatorSetParamsUpdated as OperatorSetParamsUpdatedEvent, | ||
OperatorSocketUpdate as OperatorSocketUpdateEvent | ||
} from "../generated/RegistryCoordinator/RegistryCoordinator" | ||
import { | ||
ChurnApproverUpdated, | ||
OperatorDeregistered, | ||
OperatorRegistered, | ||
OperatorSetParamsUpdated, | ||
OperatorSocketUpdate | ||
} from "../generated/schema" | ||
|
||
export function handleChurnApproverUpdated( | ||
event: ChurnApproverUpdatedEvent | ||
): void { | ||
let entity = new ChurnApproverUpdated( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.prevChurnApprover = event.params.prevChurnApprover | ||
entity.newChurnApprover = event.params.newChurnApprover | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleOperatorDeregistered( | ||
event: OperatorDeregisteredEvent | ||
): void { | ||
let entity = new OperatorDeregistered( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operator = event.params.operator | ||
entity.operatorId = event.params.operatorId | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleOperatorRegistered(event: OperatorRegisteredEvent): void { | ||
let entity = new OperatorRegistered( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operator = event.params.operator | ||
entity.operatorId = event.params.operatorId | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleOperatorSetParamsUpdated( | ||
event: OperatorSetParamsUpdatedEvent | ||
): void { | ||
let entity = new OperatorSetParamsUpdated( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.quorumNumber = event.params.quorumNumber | ||
entity.operatorSetParams_maxOperatorCount = | ||
event.params.operatorSetParams.maxOperatorCount | ||
entity.operatorSetParams_kickBIPsOfOperatorStake = | ||
event.params.operatorSetParams.kickBIPsOfOperatorStake | ||
entity.operatorSetParams_kickBIPsOfTotalStake = | ||
event.params.operatorSetParams.kickBIPsOfTotalStake | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} | ||
|
||
export function handleOperatorSocketUpdate( | ||
event: OperatorSocketUpdateEvent | ||
): void { | ||
let entity = new OperatorSocketUpdate( | ||
event.transaction.hash.concatI32(event.logIndex.toI32()) | ||
) | ||
entity.operatorId = event.params.operatorId | ||
entity.socket = event.params.socket | ||
|
||
entity.blockNumber = event.block.number | ||
entity.blockTimestamp = event.block.timestamp | ||
entity.transactionHash = event.transaction.hash | ||
|
||
entity.save() | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the addresses of these new contracts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are dummy addresses that get replaced by the deployer. Making that explicit by zeroing them out.
It looks like the
preprod-goerli
andgoerli
ones may correspond to actual contracts on goerli, but we can't update those until the new deployment.