In highly interconnected large-scale event and other Internet of Things (IoT) device-intensive scenarios, traditional terrestrial base stations have difficulty meeting the requirements of IoT devices for network speed and security, and have exacerbated carbon pollution. To this end, a blockchain-enabled unmanned aerial vehicles (UAVs)-assisted mobile edge computing (MEC) system is introduced to enhance communication efficiency and ensure the privacy of IoT devices. In this system, the Byzantine consensus algorithm is applied in the blockchain. Considering the pollution of reducing carbon dioxide emissions, a strategy for jointly optimizing the flight trajectories of UAVs, task offloading scheduling, and MEC computing resource allocation is formulated to minimize the system's carbon emissions and time delay while meeting MEC and blockchain computing tasks. However, due to the coupling of variables, this problem is very complex. Therefore, the original problem is decoupled into multiple subproblems, and the block coordinate descent method (BCD) and successive convex approximation method (SCA) are used for solving. Specifically, the UAV flight trajectories, task offloading scheduling, and MEC computing resource allocation are alternately optimized until convergence. Simulation results verify the effectiveness and good performance of the proposed algorithm in this article.