fix(agents): conservative default spending limits (#323) - #926
Open
raymondidahor-bot wants to merge 1 commit into
Open
fix(agents): conservative default spending limits (#323)#926raymondidahor-bot wants to merge 1 commit into
raymondidahor-bot wants to merge 1 commit into
Conversation
) Freshly registered agents defaulted to effectively unlimited caps (10,000 USDC/tx, 100,000 USDC/day) with no way to tighten them. Defaults are now restrictive named constants (500 USDC/tx, 5,000 USDC/day) and raising them requires an explicit owner-authorized update_policy call. Defaults documented in DEPLOY.md. Close Stellar-Ecosystem#323 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@raymondidahor-bot 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! 🚀 |
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
Fixes #323
Freshly registered agents defaulted to effectively unlimited spending caps (10,000 USDC/tx, 100,000 USDC/day) with no way to tighten them. This PR makes the defaults restrictive named constants and documents them.
Changes
contract/agents/src/lib.rsDEFAULT_MAX_PER_TX_STROOPS(500,000,000 stroops = 500 USDC) andDEFAULT_MAX_PER_DAY_STROOPS(5,000,000,000 stroops = 5,000 USDC) with a prominent comment block explaining the security rationale.register_agentnow uses these constants instead of the inline permissive literals (10,000 USDC/tx, 100,000 USDC/day).update_policy(max_per_tx_stroops > 0,max_per_day >= max_per_tx) so invalid limits are rejected at write time.contract/agents/DEPLOY.mdstellar contract invokecommand an owner uses to raise limits.Acceptance criteria
update_policycall (caller.require_auth()+agent.owner == caller)Close #323
🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com