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
Overview
None of
identity::initialize,shipment::initialize,escrow::initialize,document::initialize, orreputation::initializecalladmin.require_auth()— they only guard against being called twice. Whoever callsinitializefirst 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
admin.require_auth()as the first line of each of the 5initialize()functions, immediately after the already-initialized checkinitializefails when not signed by the claimed adminAcceptance Criteria
initialize()functions calladmin.require_auth()initializepanics/fails when not signed by the claimed admin