Tags: xmtp/smart-contracts
Tags
fix: use `abi.encode` for hashing arrays (XMTP-10) (#165) Change hashing of nodeIds_ to use abi.encode in PayerReportManager to address XMTP-10 This pull request updates the hashing logic in the PayerReportManager contract to use abi.encode for nodeIds_ when computing the keccak256 that combines endSequenceId_, endMinuteSinceEpoch_, payersMerkleRoot_, and the nodeIds_ hash. It also updates unit tests to reflect the new computed values. Modify PayerReportManager to replace abi.encodePacked(nodeIds_) with abi.encode(nodeIds_) in the hash computation in PayerReportManager.sol Update three expected bytes32 constants in tests to match the new hash results in PayerReportManager.t.sol
Store endMinuteSinceEpoch as part of PayerReport (#110) ### Store endMinuteSinceEpoch as part of PayerReport struct in settlement-chain contracts - Adds `endMinuteSinceEpoch` field to the `PayerReport` struct in [IPayerReportManager.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-9fb0d383a957303659dfce9466a61de006a70c84e9d00bcc77e77d2cb559dd16) to track the timestamp of the message at `endSequenceId` - Updates `PayerReportManager.sol` contract to include the new `endMinuteSinceEpoch_` parameter when creating `PayerReport` objects in [PayerReportManager.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-6a7edafdcbfd59cce9a879b0794c842ebd8f7eb961fa871b85f25513232a82f9) - Modifies test files to pass the new `endMinuteSinceEpoch_` parameter with value 0 in [PayerReportManager.t.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-88d841009e835b92dfaa91cbaaca83627d59bcb7e62090ff6a6af09f7ee67bdb) and [Harnesses.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-f803a3747dfd9bb6151512e75424166315fd4e6c591066540f3f690ec7093177) #### 📍Where to Start Start with the `PayerReport` struct definition in [IPayerReportManager.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-9fb0d383a957303659dfce9466a61de006a70c84e9d00bcc77e77d2cb559dd16) to understand the new field addition, then review how it's used in the contract implementation in [PayerReportManager.sol](https://github.com/xmtp/smart-contracts/pull/110/files#diff-6a7edafdcbfd59cce9a879b0794c842ebd8f7eb961fa871b85f25513232a82f9). ---- _[Macroscope](https://app.macroscope.com) summarized bdc4b6c._ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new timestamp field to payer reports, capturing the time associated with the end of a report period. * **Bug Fixes** * Ensured the new timestamp field is properly initialized when creating payer reports. * **Tests** * Updated tests to include and validate the new timestamp field in all relevant scenarios. * **Documentation** * Improved comments and field naming for clarity in payer report structures. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Run CI on branch and main (#83) ### Expand GitHub workflow to run CI on branch and main pushes in addition to tag events The GitHub workflow [.github/workflows/release-from-tag.yml](https://github.com/xmtp/smart-contracts/pull/83/files#diff-cee4eadd46d2585fd337f530116877504920be9ec452bdbfb915b95857438208) now triggers on pushes to the `main` branch and pull requests in addition to tag events. The workflow adds multiple Docker image tagging strategies including `type=ref,event=branch`, `type=ref,event=pr`, and `type=sha` for different event types, while restricting semver tagging to tag events only. Build artifacts are uploaded for all workflow runs using `actions/upload-artifact@v4`, and GitHub Release creation is made conditional with `if: startsWith(github.ref, 'refs/tags/')` to only occur for tag events. #### 📍Where to Start Start with the workflow trigger configuration at the top of [.github/workflows/release-from-tag.yml](https://github.com/xmtp/smart-contracts/pull/83/files#diff-cee4eadd46d2585fd337f530116877504920be9ec452bdbfb915b95857438208) to understand the new event conditions. ---- _[Macroscope](https://app.macroscope.com) summarized e69c9e1._
PreviousNext