A Blockchain-based Smart Contract Model for Secured Energy Trading management in Smart Microgrids