A smart medicine container is provided to secure accesses to a bulk supply of pills stored therein and pills dispensed therein. The medicine container comprises a control unit, a memory, a communication interface unit, a pill-supply housing configured to store a bulk supply of pills, a pill-supply locking means configured to lock access to the pill-supply housing, a dispensing assembly configured to dispense pills from among the bulk supply of pills, and a dispensed-pill housing configured to receive and store dispensed pills, a dispensed-pill locking means configured to lock access to the dispensed-pill housing. The control unit is programmed to irreversibly cause the pill-supply locking means to lock access to the pill-supply housing and irreversibly cause the dispensed-pill locking means to lock access to the dispensed-pill housing when receiving information indicating that the bulk supply of pills should permanently discontinue to be taken by a patient.