Conversation
…parsing - Update ExampleReceiver.sol to use parseUpdateFromPayload() for high-level struct-based parsing - Add helper function pattern for memory-to-calldata conversion - Use safe getter functions (hasPrice, getPrice, etc.) for property extraction - Add utility functions: getCurrentPrice(), getSpread(), isPriceFresh(), setTargetFeedId() - Update tests to use TransparentUpgradeableProxy for PythLazer initialization - Add comprehensive test cases for struct-based parsing, fee validation, and helper functions - Update README with detailed documentation on contract architecture, tri-state property system, and integration guide - Update pyth-crosschain submodule to include PythLazerStructs.sol Co-Authored-By: aditya@dourolabs.xyz <aditya@dourolabs.xyz>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
aditya520
reviewed
Dec 18, 2025
|
|
||
| **PythLazer.sol** is the main contract that verifies ECDSA signatures from trusted signers. It manages trusted signer keys with expiration times and collects verification fees for each update. | ||
|
|
||
| **PythLazerLib.sol** is a library that provides parsing functions for Lazer payloads. It includes both low-level parsing functions like `parsePayloadHeader()` and `parseFeedHeader()`, as well as a high-level `parseUpdateFromPayload()` function that returns a structured `Update` object. |
Contributor
There was a problem hiding this comment.
Can we emphasize in the README that how these 3 functions differs and in which use case we have to use them, currently it is not so clear imo.
lazer/evm/README.md
Outdated
Comment on lines
124
to
127
| Price: | ||
| 100000000 | ||
| Exponent: | ||
| -8 |
Contributor
There was a problem hiding this comment.
can we have the "value" in front of the tag ? like how we had earlier.
…e output - Add table explaining differences between parseUpdateFromPayload, parsePayloadHeader, parseFeedHeader, and parseFeedProperty - Update console.log output to show values inline (e.g., 'Price: 100000000' instead of separate lines) - Add parsePayload helper function for memory-to-calldata conversion - Update README integration guide to include the helper function pattern Co-Authored-By: aditya@dourolabs.xyz <aditya@dourolabs.xyz>
…nd inline output" This reverts commit 0306984.
- Changed console.log('Price:') + console.logInt(price) to console.log('Price:', int256(price))
- Same for Exponent, Best bid price, and Best ask price
- Updated README expected output to match new format
Co-Authored-By: aditya@dourolabs.xyz <aditya@dourolabs.xyz>
Riateche
approved these changes
Jan 7, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pyth Examples Contribution
Type of Contribution
Project Information
Project/Example Name: Pyth Lazer EVM Example
Pyth Product Used:
Blockchain/Platform:
Description
What does this contribution do?
Updates the Pyth Lazer EVM example to use the new
PythLazerLibstruct-based parsing approach withparseUpdateFromPayload()instead of manual low-level parsing. This provides a cleaner, more maintainable integration pattern.Key changes:
ExampleReceiver.solto usePythLazerStructs.UpdateandFeedstructshasPrice(),getPrice(), etc.) for property extractionTransparentUpgradeableProxyfor proper PythLazer initializationHow does it integrate with Pyth?
The contract receives signed Pyth Lazer updates, verifies them via the
PythLazercontract, and parses the payload usingPythLazerLib.parseUpdateFromPayload()to extract structured price feed data.What problem does it solve or demonstrate?
Demonstrates the recommended approach for integrating Pyth Lazer price feeds using the new struct-based parsing API, which is cleaner and less error-prone than manual byte parsing.
Updates Since Last Revision
console.logstatements to display signed integers inline usingconsole.log("Price:", int256(price))instead of separate linesTesting & Verification
How to Test This Contribution
Prerequisites
Setup & Run Instructions
Both tests pass:
test_updatePrice_parseAndLog()- Tests parsing and logging price datatest_revert_insufficientFee()- Verifies fee requirementChecklist
Code Quality
Testing
Additional Context
Notes for Reviewers
Memory-to-calldata conversion: The
parsePayload()helper function is needed becausePythLazerLib.parseUpdateFromPayload()expectsbytes calldatabutverifyUpdate()returnsbytes memory. The external call pattern (this.parsePayload()) converts memory to calldata.Submodule update: Updated
lib/pyth-crosschainto include the newPythLazerStructs.solfile.Human Review Checklist
parseUpdateFromPayloadbut contract uses helper)parsePayloadhelper pattern is clearly explainedLink to Devin run: https://app.devin.ai/sessions/0fee8f43574b4c9198b0dd65fe9de258
Requested by: aditya@dourolabs.xyz