Use of Unmanned Aerial Vehicles (UAVs) is rapidly increasing in various domains such as disaster management, delivery of goods, surveillance, military, etc. Significant issues in the expansion of UAV-based applications are the security of (IoT to UAV) communication, and the limited flight time of the UAVs and IoT devices considering the limited battery power. Standalone UAVs are not capable of accomplishing several tasks, and therefore swarm of UAVs is being explored. Security issues in the swarm of UAVs do not allow the applications to leverage the full benefits that one can offer. Several recent studies have proposed the use of a distributed network of UAVs to upgrade the level of security in the swarm of UAVs. In this paper, a framework for secure and reliable energy trading among UAVs and charging stations is presented. Advanced blockchain, based on the tangle data structure is used to create a distributed network of UAVs and charging stations. The proposed model allows the UAVs to buy energy from the charging station in exchange for tokens. If the UAV does not have sufficient tokens to buy the energy, then the model allows the UAV to borrow tokens from the charging station. The borrowed tokens can be repaid back to the charging station with interest or late fees. A game-theoretic model is used for deciding the buying strategy of energy for UAVs. Numerical analysis shows that the proposed model helps in providing increased utility for the swarm of UAVs and charging stations in a secure and cost-optimal way as compared to the conventional schemes. The results can eventually be applied to IoT devices that constantly need energy to perform under ideal conditions.