Smart Contract — New Feature
Summary
A recurring schedule's parameters must be validated before a proposal is accepted. This adds creation-time checks for amount, interval, recipient, and token, following the existing validation patterns.
Background
create_proposal in contracts/accord/src/lib.rs validates the recipient address, amount, and token before creating a proposal. The validate.rs module holds reusable validation helpers. The new recurring-payment proposal entrypoint must validate the schedule-specific parameters: amount per period, interval, recipient, and token.
What Needs to Be Done
- Validate that
amount_per_period is at least MIN_AMOUNT, following the existing amount check pattern.
- Validate that
interval_secs is within the range [MIN_INTERVAL_SECS, MAX_INTERVAL_SECS].
- Validate that the recipient address is not the contract's own address.
- Validate the token address through the existing
validate_token helper.
- Return the appropriate contract error for each validation failure.
Acceptance Criteria
Files to Look At
contracts/accord/src/lib.rs — the proposal entrypoint with validation logic
contracts/accord/src/validate.rs — existing validation helpers
Difficulty: Medium
Smart Contract — New Feature
Summary
A recurring schedule's parameters must be validated before a proposal is accepted. This adds creation-time checks for amount, interval, recipient, and token, following the existing validation patterns.
Background
create_proposalincontracts/accord/src/lib.rsvalidates the recipient address, amount, and token before creating a proposal. Thevalidate.rsmodule holds reusable validation helpers. The new recurring-payment proposal entrypoint must validate the schedule-specific parameters: amount per period, interval, recipient, and token.What Needs to Be Done
amount_per_periodis at leastMIN_AMOUNT, following the existing amount check pattern.interval_secsis within the range[MIN_INTERVAL_SECS, MAX_INTERVAL_SECS].validate_tokenhelper.Acceptance Criteria
Files to Look At
contracts/accord/src/lib.rs— the proposal entrypoint with validation logiccontracts/accord/src/validate.rs— existing validation helpersDifficulty: Medium