Optimization energy contract

DEBUG