Repository navigation
feat(contract): enforce immutable per-token escrow caps - #151
nasirudeenbadirudeen87-cloud wants to merge 5 commits into
Conversation
|
@nasirudeenbadirudeen87-cloud Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
This PR has merge conflicts with |
|
@nasirudeenbadirudeen87-cloud Thanks for the PR. It can't be merged yet. To unblock it: CI is failing. Here's what broke:
Please fix these errors and run the same steps locally before pushing ( Merge conflicts: this branch conflicts with Push to this same branch and CI will re-run. Once it's green and conflict-free, it'll be reviewed for merge. |
3d7dce7 to
e124ae0
Compare
Malware scan: passed, with notes for the reviewerNothing malicious was detected in
|
… allowlist Main's constructor now takes the immutable token allowlist (DocForum#36), so the caps become a second argument instead of replacing it: __constructor(allowed_tokens, maximum_amounts). An empty cap map keeps the uncapped behaviour; a non-empty map rejects tokens without an entry (TokenCapNotConfigured = 36) and any escrow total over its cap (AmountCapExceeded = 37). Code 35 is left for DocForum#38's solvency check. Caps are checked on the shared create path (so every create variant and each batch item), on top_up's resulting total (main's top_up is reused), and on a pooled escrow's funding target. New tests in token_caps.rs; all existing constructor call sites pass an empty map. SDK bindings regenerated with the pinned Stellar CLI, scripts/deploy gains --maximum-amounts, ADR renumbered to 0013 (0006 and 0012 are taken), and snapshots updated for the new (empty) MaximumAmounts instance entry.
|
@nasirudeenbadirudeen87-cloud This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@nasirudeenbadirudeen87-cloud CI is failing on two jobs. The SDK bindings match contract WASM job fails: Use stellar CLI 28.1.0, as CI does (see The Go SDK integration (local quickstart) job fails when deploying the contract: The deploy step passes constructor arguments that no longer match Please fix and push. |
|
@afeezorobsco-cyber I regenerated |
|
@afeezorobsco-cyber I merged current main and reconciled the immutable per-token cap checks with the current escrow contract. The full contract suite, release WASM build, generated-binding check, and resource-baseline check pass locally. PR #151 is mergeable and its refreshed malware scan passed. Please review the updated branch and the contract version ordering alongside the other pending changes. |
|
@nasirudeenbadirudeen87-cloud This PR now has merge conflicts with git fetch upstream # upstream = https://github.com/DocForum/docforum-escrow.git
git rebase upstream/main
# resolve the conflicts, re-run the tests, then:
git push --force-with-leaseThe usual culprits are shared docs like Automated message. It won't repeat unless the PR conflicts again after your next push. |
|
@nasirudeenbadirudeen87-cloud Heads-up: #268 just changed how contract PRs work in this repo. Your PR changes
This should also make your next merge from |
Summary
top_up, bounded by the cumulative escrow amount and backed by a balance-delta check.Validation:
git diff --checkpassed. Tests/build/install were not run per contributor workflow. The generated TypeScript bindings and SDKtopUpwrapper still need regeneration before SDK consumers can use the new surface; no new testnet deployment was made.Closes #56