# An Organized Repository of Ethereum Smart Contracts' Source Codes and Metrics
## Appendix A Queries  
Listing A1 displays a GQL query that returns smart contracts' addresses having more than 20 methods defined in a contract. Listing A2 displays the query results in the JSON format. The query output, in addition to the smart contract's addresses, contains various information (intrinsic metrics) such as the number of events, the number of functions, the number of modifiers and the number of payables, as specified by the query A1,  
```
{ metrics(query:{functions_gt:20}){  address events functions modifiers payable } }
```  
Listing A2: A GQL result displaying intrinsic metrics. ```
{ \"data\":{ \"metrics\":[ {  \"contractAddress\": \"0 xb7f4c286851 cbf0 cbf2 fe8 ebf40412b196c0e8 ad\",  \"events\":7,  \"functions\":27,  \"modifiers\":1,  \"payable\":1\"contractAddress\": \"0x755 cebe8 cc53c7 cb1e1 bb641026a17d37d4 aea91\", \"events\": 4, \"functions\": 31, \"modifiers\": 1, \"payable\": 4 ], { { \"contractAddress\": \"0 xb92 aa4a864 daf0d6a509e73a9364 feba44384965\", \"events\": 3, \"functions\": 24, \"modifiers\": 1, \"payable\": 1 ],... } } Listing A3 displays a GQL query that returns some extrinsic metrics of a specific smart contract's address. Listing A4 displays the query results in the JSON format. The query output, in addition to the smart contract's address, contains information such as the total number of transactions generated by the smart contract and the amount of crypto coins associated with the smart contract's address specified by the query A3,
```
{ metrics(query:{address_eq: \"0x536c7 efeebff067a69393133b1c87a163a6b0598\"}) {  adress  transactions  balance } }
```
Listing A4: A GQL result displaying exstrinsic metrics. ```
{ \"data\": [ \"metrics\": [ { \"contractAddress\": \"0x536c7 efeebff067a69393133b1c87a163a6b0598\", \"transactions\": 639, \"balance\": 0 Ether ] ] } }
```

Listing A5: A GQL query for displaying exstrinsic metrics. ## References

* (1) [PERSON]; [PERSON]. A Systematic Analysis of Real-World Energy Blockchain Initiatives. _Future Internet_**2019**, _11_, 174. [CrossRef]
* (2) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] An overview on smart contracts: Challenges, advances and platforms. _Future Gener. Comput. Syst._**2020**, _105_, 475-491. [CrossRef]* [PERSON] et al. (2020) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Blockchain and Trust for Secure, End-User-Based and Decentralized IoT Service Provision. _IEEE Access_**2020**, \(8\), 119961-119979. [CrossRef]
* [PERSON] et al. (2018) [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] [PERSON]; [PERSON] Initial Coin Offerings and Agile Practices. _Future Internet_**2018**, _10_, 103. [CrossRef]
* [PERSON] and [PERSON] (2018) [PERSON]; [PERSON] Security Vulnerabilities in Ethereum Smart Contracts. In Proceedings of the 20 th iiWAS, Yogyakarta, Indonesia, 19 November 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 375-380. [CrossRef]
* [PERSON] et al. (2018) [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON] Towards Verifying Ethereum Smart Contract Bytecode in Isabelle/HOL. In Proceedings of the 7 th ACM SIGPLAN CCP, Los Angeles, CA, USA, 8 January 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 66-77. [CrossRef]
* [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON] A.; [PERSON] [PERSON] Smart Contracts Search Engine in Blockchain. In Proceedings of the 3 rd ICFNDS, Paris, France, 1 July 2019; Association for Computing Machinery: New York, NY, USA, 2019. [CrossRef]
* [PERSON] et al. (2018) [PERSON]; [PERSON]; [PERSON]; [PERSON] Smart Contracts Software Metrics: A First Study. _arXiv_**2018**, arXiv:cs.SE/1802.01517. * [PERSON] and [PERSON] (2007) [PERSON]; [PERSON] Open Source Software: A Source of Possibilities for Software Engineering Education and Empirical Software Engineering. In Proceedings of the First International Workshop on Emerging Trends in FLOSS Research and Development, Minneapolis, MN, USA, 20-26 May 2007; p. 5. [CrossRef]
* [PERSON] et al.