Skip to content

fix: gate issue_carbon_credits behind carbon-oracle auth (Closes #312) - #355

Open
laurentketterle-hub wants to merge 4 commits into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-312-carbon-credit-auth
Open

fix: gate issue_carbon_credits behind carbon-oracle auth (Closes #312)#355
laurentketterle-hub wants to merge 4 commits into
Heliobond:mainfrom
laurentketterle-hub:fix/issue-312-carbon-credit-auth

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Closes #312issue_carbon_credits had no authorization check, so any address could mint unlimited, freely-transferable carbon credits to itself or others.

Changes

  • Added a carbon-oracle authorization gate to issue_carbon_credits (mirrors set_carbon_credit_price): the stored CarbonOracle address must require_auth() before credits are minted.
  • Emitted a new CarbonCreditsIssued event on issuance for indexability.
  • Added a regression test asserting a non-oracle caller is rejected.

Acceptance criteria

  • Unauthorized callers cannot mint credits to arbitrary addresses
  • A test asserts a non-oracle call is rejected
  • An event is emitted on issuance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issue_carbon_credits has no authorization check — anyone can mint unlimited carbon credits to any address

1 participant