-
Notifications
You must be signed in to change notification settings - Fork 8
feat: Add processSettlement function to Gateway contract #66
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
base: main
Are you sure you want to change the base?
Changes from all commits
497d7b2
58f4958
ad89e07
3b52085
e386cd0
c7c5910
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainMetadata-only buildInfo pointer update — verify consistency across artifacts. No behavioral impact. Please verify all dbg.json now reference the new build-info and that the file exists. 🏁 Script executed: #!/bin/bash
set -euo pipefail
NEW_HASH=5631a6977c9d28c95713f02c5a51ee48
OLD_HASH=b8a88c4b130e7a569c3029307ef5f126
# Ensure new build-info file exists
fd -a "${NEW_HASH}\.json" build-info || { echo "ERROR: build-info/${NEW_HASH}.json not found"; exit 1; }
# Show all dbg.json buildInfo refs
echo "BuildInfo references in artifacts:"
rg -n '"buildInfo": ' -g 'artifacts/**.dbg.json' | sed -n 's/^\(.*\):\([0-9]*\):\s*"buildInfo":\s*"\([^"]*\)".*/\1:\2 -> \3/p' | sort
# Ensure no dbg.json still points to old hash
if rg -n "$OLD_HASH" -g 'artifacts/**.dbg.json' >/dev/null; then
echo "WARNING: Found dbg.json still referencing old build-info hash:"
rg -n "$OLD_HASH" -g 'artifacts/**.dbg.json'
exit 2
fi
# Verify each referenced buildInfo path exists
FAIL=0
while IFS= read -r ref; do
file="$(echo "$ref" | sed -n 's/.*-> \(.*\)$/\1/p')"
[ -f "$file" ] || { echo "ERROR: Missing buildInfo target: $file (from $ref)"; FAIL=1; }
done < <(rg -n '"buildInfo": ' -g 'artifacts/**.dbg.json' | sed -n 's/^\(.*\):\([0-9]*\):\s*"buildInfo":\s*"\([^"]*\)".*/\1:\2 -> \3/p')
exit $FAILLength of output: 415 #!/bin/bash echo "1) Locating all directories named build-info in the repo..." echo echo resolve relative to each dbg.json locationdbgfile=$(rg -l ""buildInfo":.$relpath" -g 'artifacts/**/.dbg.json') exit "${missing:-0}" #!/bin/bash echo "1) Locating all build-info directories in the repo:" echo echo exit $fail In |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "_format": "hh-sol-artifact-1", | ||
| "contractName": "Strings", | ||
| "sourceName": "@openzeppelin/contracts/utils/Strings.sol", | ||
| "abi": [], | ||
| "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206f309647bf8103ce698bf52bb76c3497fead7d06919b9f69b777e6651857f07a64736f6c63430008120033", | ||
| "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206f309647bf8103ce698bf52bb76c3497fead7d06919b9f69b777e6651857f07a64736f6c63430008120033", | ||
| "linkReferences": {}, | ||
| "deployedLinkReferences": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "_format": "hh-sol-artifact-1", | ||
| "contractName": "ECDSA", | ||
| "sourceName": "@openzeppelin/contracts/utils/cryptography/ECDSA.sol", | ||
| "abi": [], | ||
| "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c9e543adb0dca0224d5a39f6c94a91e72ecce446c5557169eb52097a1e88d51364736f6c63430008120033", | ||
| "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c9e543adb0dca0224d5a39f6c94a91e72ecce446c5557169eb52097a1e88d51364736f6c63430008120033", | ||
| "linkReferences": {}, | ||
| "deployedLinkReferences": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "_format": "hh-sol-artifact-1", | ||
| "contractName": "Math", | ||
| "sourceName": "@openzeppelin/contracts/utils/math/Math.sol", | ||
| "abi": [], | ||
| "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bb5628773684aef89cfc79db470cdbe579a679654cae57342a2d3cf2049844e264736f6c63430008120033", | ||
| "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bb5628773684aef89cfc79db470cdbe579a679654cae57342a2d3cf2049844e264736f6c63430008120033", | ||
| "linkReferences": {}, | ||
| "deployedLinkReferences": {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../../../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "_format": "hh-sol-artifact-1", | ||
| "contractName": "SignedMath", | ||
| "sourceName": "@openzeppelin/contracts/utils/math/SignedMath.sol", | ||
| "abi": [], | ||
| "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220180902dbf67ca73306a34fde98a53759fe734eb0fb323bd6dffcba183062105764736f6c63430008120033", | ||
| "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220180902dbf67ca73306a34fde98a53759fe734eb0fb323bd6dffcba183062105764736f6c63430008120033", | ||
| "linkReferences": {}, | ||
| "deployedLinkReferences": {} | ||
| } |
Large diffs are not rendered by default.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../build-info/d61b59df6bfad998198e6e3c456345ab.json" | ||
| "buildInfo": "../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainDbg buildInfo updated; please ensure settlement functions are safe (reentrancy, ERC20 compliance). Given settlement involves token transfers and fee handling, confirm:
🏁 Script executed: #!/bin/bash
# Quick static checks on Gateway source for safety patterns
set -euo pipefail
fd Gateway.sol | while read -r f; do
echo "==> Inspecting $f"
rg -n 'processSettlement|settleIn|settleOut|nonReentrant|SafeERC20|safeTransferFrom|safeTransfer|protocolFee|senderFee' "$f" -n || true
done
echo "Check tests cover fee deductions and edge cases..."
fd -t f 'test' | rg -n 'processorder|settleOrder|protocol fee|sender fee|SafeERC20|nonReentrant' || trueLength of output: 9247 Add SafeERC20 transfers and nonReentrant guards to Gateway settlement functions The current • In • Fee‐recipient validation (already present): if (_senderFee != 0) {
require(_senderFeeRecipient != address(0), "InvalidSenderFeeRecipient");
}• Tests These changes will ensure safe token operations and guard against reentrancy. 🤖 Prompt for AI Agents |
||
| } | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../build-info/b8a88c4b130e7a569c3029307ef5f126.json" | ||
| "buildInfo": "../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } | ||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Potential typo in contract path: “Sponsore” vs “Sponsor” The path includes “ProviderBatchCallAndSponsore.sol” while the summary references “ProviderBatchCallAndSponsor”. Recommend normalizing the source filename to “ProviderBatchCallAndSponsor.sol” and regenerating artifacts to avoid long-lived typos across imports, docs, and tooling. If renaming the Solidity file:
🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "_format": "hh-sol-artifact-1", | ||
| "contractName": "IGateway", | ||
| "sourceName": "contracts/ProviderBatchCallAndSponsore.sol", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in source filename. The source filename contains a typo: "ProviderBatchCallAndSponsore.sol" should be "ProviderBatchCallAndSponsor.sol" (Sponsor, not Sponsore). 🤖 Prompt for AI Agents |
||
| "abi": [ | ||
| { | ||
| "inputs": [], | ||
| "name": "getAggregator", | ||
| "outputs": [ | ||
| { | ||
| "internalType": "address", | ||
| "name": "", | ||
| "type": "address" | ||
| } | ||
| ], | ||
| "stateMutability": "view", | ||
| "type": "function" | ||
| } | ||
| ], | ||
| "bytecode": "0x", | ||
| "deployedBytecode": "0x", | ||
| "linkReferences": {}, | ||
| "deployedLinkReferences": {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "_format": "hh-sol-dbg-1", | ||
| "buildInfo": "../../build-info/5631a6977c9d28c95713f02c5a51ee48.json" | ||
| } | ||
|
Comment on lines
+1
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainPotential typo in Solidity filename/path: “Sponsore”. Artifact path suggests the Solidity file is named ProviderBatchCallAndSponsore.sol. Consider renaming to ProviderBatchCallAndSponsor.sol for consistency and to avoid future import/deployment confusion. 🏁 Script executed: #!/bin/bash
# Find all references to the misspelling to assist with a clean rename
set -euo pipefail
rg -n --hidden --glob '!node_modules' 'Sponsore' || trueLength of output: 277575 Rename “ProviderBatchCallAndSponsore.sol” to “ProviderBatchCallAndSponsor.sol”
🤖 Prompt for AI Agents |
||
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.
💡 Verification agent
🧩 Analysis chain
Verify buildInfo target and repo-wide pointer consistency
Metadata-only change. Please ensure the referenced build-info exists and that all dbg.json files now consistently point to it.
Run this to validate dbg.json pointers and existence of the new build-info:
Additionally, per PR objectives, confirm IGateway artifacts expose the new event/function:
🏁 Script executed:
Length of output: 1223
🏁 Script executed:
Length of output: 1280
Update IGateway ABI to include new event and function
The build-info pointers in all
.dbg.jsonfiles consistently reference the same hash (5631a6977c9d28c95713f02c5a51ee48.json), and that file exists underartifacts/build-info/. No broken references were found.However, neither of your IGateway artifacts exposes the new
ProcessSettlementevent or theprocessSettlementfunction:• artifacts/contracts/ProviderBatchCallAndSponsore.sol/IGateway.json
• artifacts/contracts/interfaces/IGateway.sol/IGateway.json
Please update the IGateway interface (and re-generate its artifact) so that its ABI includes:
event ProcessSettlement(...)function processSettlement(...)This will fulfill the PR objective of exposing the new event and function in the IGateway artifact.
🤖 Prompt for AI Agents