Description
CalloraVault::set_authorized_caller reads meta.owner and calls meta.owner.require_auth() but takes no caller parameter and performs no caller == owner check, diverging from every other privileged function which takes an explicit caller. This inconsistent pattern makes auditing harder and the API surface inconsistent. Align it with the rest of the contract.
Requirements and Context
- Add an explicit
caller: Address parameter, caller.require_auth(), and assert caller == meta.owner.
- Keep emitting
set_authorized_caller with (old, new) data.
- Validate
new_caller is not the vault address (consistent with init).
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b bug/vault-set-authorized-caller-auth
- Implement changes
contracts/vault/src/lib.rs — explicit caller + self-address guard
docs/interfaces/vault.json — update signature
- Test and commit
cargo test -p callora-vault
- Test non-owner caller reverts; self-address rejected
- Include test output and notes in the PR
Example commit message
fix: require explicit owner caller in set_authorized_caller
Acceptance Criteria
Guidelines
.rs under contracts/vault/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
CalloraVault::set_authorized_callerreadsmeta.ownerand callsmeta.owner.require_auth()but takes nocallerparameter and performs nocaller == ownercheck, diverging from every other privileged function which takes an explicitcaller. This inconsistent pattern makes auditing harder and the API surface inconsistent. Align it with the rest of the contract.Requirements and Context
caller: Addressparameter,caller.require_auth(), and assertcaller == meta.owner.set_authorized_callerwith(old, new)data.new_calleris not the vault address (consistent withinit).Suggested Execution
contracts/vault/src/lib.rs— explicit caller + self-address guarddocs/interfaces/vault.json— update signaturecargo test -p callora-vaultExample commit message
Acceptance Criteria
callerparameter with owner checknew_callerrejectedGuidelines
.rsundercontracts/vault/src/,cargo test,///docs, minimum 95% line coverage, nounwrap()in prod paths