Skip to content

[CONTRACT-05] Add admin.require_auth() to all 5 contracts' initialize() #1122

Description

@mftee

Overview

None of identity::initialize, shipment::initialize, escrow::initialize, document::initialize, or reputation::initialize call admin.require_auth() — they only guard against being called twice. Whoever calls initialize first becomes admin with no cryptographic proof they are who they claim, relying entirely on the deploy script calling it within the same transaction as deployment. This should be enforced by the contract itself, not just by deployment convention.

Technical Details

  • Add admin.require_auth() as the first line of each of the 5 initialize() functions, immediately after the already-initialized check
  • Add or update a test per contract confirming initialize fails when not signed by the claimed admin

Acceptance Criteria

  • All 5 initialize() functions call admin.require_auth()
  • Each contract has a test confirming initialize panics/fails when not signed by the claimed admin
  • Existing passing tests continue to pass

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions