Mclean Matthew

Mouillot David

Villéger Sébastien

Graham Nicholas

Auber Arnaud

Matthew Mclean
email: mcleamj@gmail.com

Interspecific differences in environmental response blur trait dynamics in classic statistical analyses

Trait-based ecology strives to better understand how species, through their bio-ecological traits, respond to environmental changes, and influence ecosystem functioning. Identifying which traits are most responsive to environmental changes can provide insight for understanding community structuring and developing sustainable management practices. However, misinterpretations are possible, because standard statistical methods (e.g., principal component analysis and linear regression) for identifying and ranking the responses of different traits to environmental changes ignore interspecific differences. Here, using both artificial data and real-world examples from marine fish communities, we show how considering species-specific responses can lead to drastically different results than standard community-level methods. By demonstrating the potential impacts of interspecific differences on trait dynamics, we illuminate a major, yet rarely discussed issue, highlighting how analytical misinterpretations can confound our basic understanding of trait responses, which could have important consequences for biodiversity conservation.

Introduction

Using species' traits, defined as any bio-ecological feature influencing individual performance in a given environment [START_REF] Violle | Let the concept of trait be functional![END_REF], is widely advocated for understanding how biological communities respond to environmental change. This requires identifying which traits exhibit the greatest environmental responses and best characterize community dynamics [START_REF] Lavorel | Predicting changes in community composition and ecosystem functioning from plant traits: revisiting the Holy Grail[END_REF][START_REF] Mcgill | Rebuilding community ecology from functional traits[END_REF][START_REF] Suding | Scaling environmental change through the community-level: a trait-based response-and-effect framework for plants[END_REF][START_REF] Dehling | Morphology predicts species' functional roles and their degree of specialization in plant-frugivore interactions[END_REF][START_REF] Gross | Functional trait diversity maximizes ecosystem multifunctionality[END_REF].

More specifically, ranking the respective contributions of different traits to community responses can help identify the ecological mechanisms structuring communities [START_REF] Weiher | Assembly Rules, Null Models, and Trait Dispersion: New Questions from Old Patterns[END_REF][START_REF] Pollock | The role of functional traits in species distributions revealed through a hierarchical model[END_REF][START_REF] Fort | Hierarchy of root functional trait values and plasticity drive early-stage competition for water and phosphorus among grasses[END_REF][START_REF] Sakschewski | Resilience of Amazon forests emerges from plant trait diversity[END_REF]. For example, in a marine fish community, if all species increasing in abundance are related by high temperature preferences, we could likely conclude that changes in community structure are primarily driven by ocean warming, and that future increases in warm-adapted species are likely [START_REF] Cheung | Signature of ocean warming in global fisheries catch[END_REF].

While this response-trait approach is recognized for providing clearer information for planning conservation and management efforts that are applicable across ecosystems and taxa (Dı áz and Cabido 2001;[START_REF] Winemiller | Functional traits, convergent evolution, and periodic tables of niches[END_REF][START_REF] Pecuchet | From traits to life-history strategies: Deconstructing fish community composition across European seas[END_REF], proper interpretations of trait responses are critical.

Currently, descriptive statistics like ordination analyses are used to rank the respective contributions of different traits to temporal and spatial community responses, i.e. which traits are most responsive to environmental changes in time and space [START_REF] Peres-Neto | Giving meaningful interpretation to ordination axes: assessing loading significance in principal component analysis[END_REF][START_REF] Pla | Quantifying Functional Biodiversity[END_REF][START_REF] Legendre | Numerical Ecology[END_REF]. In temporal dynamics, principal component analysis (PCA) is used to examine changes in a given community over time by examining the movement of the community along the main principal component axes, while the most responsive traits are inferred by ranking PCA loadings [START_REF] Peres-Neto | Giving meaningful interpretation to ordination axes: assessing loading significance in principal component analysis[END_REF][START_REF] Pla | Quantifying Functional Biodiversity[END_REF][START_REF] Legendre | Numerical Ecology[END_REF]. Additionally, trait responsiveness can be inferred as the slope of the regression between trait abundance and time or an environmental gradient [START_REF] Noordijk | Invertebrates in field margins: taxonomic group diversity and functional group abundance in relation to age[END_REF][START_REF] Jamil | A unimodal species response model relating traits to environment with application to phytoplankton communities[END_REF]. From a purely descriptive standpoint, these methods provide accurate assessments of the traits that explain the highest amount of variation in a dataset, and thus accurately identify the traits with the greatest contributions to community variation in a statistical context. However, using only such descriptive statistics can lead to misinterpretations of how traits respond to environmental changes.

While ordination or regression-based methods might accurately indicate which trait increased or decreased the most over time or space, this finding does not necessarily mean that this trait was the most responsive to environmental changes. For example, if a certain trait emerged as the most responsive because it had the greatest regression slope, this result could be due to a single dominant species while all other species with this trait were unaffected, thus questioning the unequivocal responsiveness of this group. For instance, 'piscivore' could be identified as the trait most impacted by an environmental disturbance, yet if only one dominant piscivore species decreased in abundance, while all remaining piscivores were unaffected we have little confidence that piscivores are actually affected by this disturbance. Even though, under the mass-ratio hypothesis, changes in the traits of the most abundant species should have the highest impact on ecosystem processes owning to their dominance, it does not imply that they are the most representative of how traits in general respond to changing environments [START_REF] Grime | Benefits of plant diversity to ecosystems: immediate, filter and founder effects[END_REF][START_REF] Díaz | Incorporating plant functional diversity effects in ecosystem service assessments[END_REF][START_REF] Mokany | Functional identity is more important than diversity in influencing ecosystem processes in a temperate native grassland[END_REF]. Rather, other traits could be far more responsive to environmental changes, but simply less dominant in the community. Another problematic case arises when a particular trait is shared by only a few species. If these species increase or decrease synchronously in abundance just by chance, standard methods might indicate that the trait is highly responsive while actually being a random signal [START_REF] Peres-Neto | Linking trait variation to the environment: critical issues with community-weighted mean correlation resolved by the fourth-corner approach[END_REF]. Instead, when a trait is shared by many similarly affected species, we have greater confidence that this trait contributes strongly to community responses, and is highly responsive to environmental change.

In this note, we aim to point out that using standard statistical methods to identify which traits are most responsive to environmental changes can lead to misinterpretations with important consequences for anticipating changes in biodiversity. Such methods do not account for the potential impacts of individual species, particularly dominant species and species with inconsistent responses. Here, we illustrate the issues outlined above with a simulated case study and two real-world examples using a basic index to rank the contribution of different trait groups to community responses to environmental change.

Materials and Methods

Trait group contributions to community responses

Here, 'trait' refers to any morphological, physiological or phenological feature related to organismal fitness [START_REF] Violle | Let the concept of trait be functional![END_REF]. In this study, for simplicity, we considered trait groups (commonly referred to as functional groups), which are defined as groups of species with shared trait attributes (e.g., pelagic, demersal, piscivore, planktivore, schooling, diurnal, oviparous, etc.). Thus, groups were not chosen in order to combine species with similar responses, but rather were defined according to shared bio-ecological characteristics. This trait-based approach is commonly used to identify whether certain shared characteristics explain how species respond to environmental perturbations [START_REF] Engelhard | Ecotypes as a concept for exploring responses to climate change in fish assemblages[END_REF]McLean et al. 2018b). While considering groups is most relevant for categorical traits, it can be easily extended by grouping continuous traits, which is common in trait-based studies [START_REF] Mouillot | Functional over-redundancy and high functional vulnerability in global fish faunas on tropical reefs[END_REF][START_REF] Vigliola | Unexpected high vulnerability of functions in wilderness areas: evidence from coral reef fishes[END_REF]).

However, it should be noted that the issues outlined above apply equally to community-weighted mean approaches, particularly because dominant species can drive changes in average trait values, masking the responses of other species with similar trait values.

Here, we developed a simple index to demonstrate the potential misinterpretations of using standard statistical methods that do not account for interspecific variation in environmental responses. However, it should be noted that this index is used purely for demonstrative purposes and is not proposed a solution for integrating interspecific differences into trait dynamics. This simple index, hereafter called the trait response (TR) index, ranks trait group contributions to temporal community dynamics. This index thus considers changes in community structure over time and identifies the most responsive trait groups. This index has three complementary criteria: i. The slope of the change in trait groups over time (i.e., ∆ abundance or biomass time -1 ).

ii. Kendall's coefficient of concordance, a measure of consistency among changes in trait group member's abundances (i.e., whether species within a given trait group display similar dynamics), ranging from 0 to 1 [START_REF] Legendre | Species associations: the Kendall coefficient of concordance revisited[END_REF]. When the coefficient is 1, all species display the same type of change; when the coefficient is 0, there is no consistency among species, and the dynamics of the corresponding trait group are essentially random. Kendall's coefficient is calculated by rank-ordering the abundances of each species across years, and consistency among species' abundance rankings within each group is computed via the mean and sum of squared deviations of the rankings (see [START_REF] Legendre | Species associations: the Kendall coefficient of concordance revisited[END_REF].

iii. The number of species whose temporal trends (increase vs. decrease in abundance) are the same as the overall group to which they belong, i.e., if the overall trait group decreased in abundance, the number of species in this group that decreased in abundance. This component first adds a probabilistic aspect, reinforcing that higher numbers of species with consistent responses reduce the likelihood that trait group dynamics are due to chance alone. Secondly, it complements Kendall's concordance, which can be equal for groups with different numbers of species. For example, groups consisting of singletons or doubletons could show very high slopes and have 100% response consistency, however, having only 1 to 2 species limits our confidence that this group is truly responsive, whereas a higher number of species showing consistent responses increases our confidence.

The TR index is then calculated as the absolute value of the product of these three criteria according to the following formula:

𝑇𝑅 𝑖 = |𝑚 𝑖 × 𝑊 𝑖 × 𝑛 𝑖 |
where i is a given trait group, m is the regression slope of the change in the trait group (i.e., abundance or biomass) through time, W is Kendall's coefficient for the trait group, and n is the number of species in the group that have the same temporal trend as the overall group itself (i.e., increase or decrease). This index produces a unit-less value (that ranges between 0 and ∞) that is used to rank the overall contributions of each trait group to changes in community structure over time, i.e., to identify the most responsive trait groups. The absolute value is used in order to rank trait group responses regardless of whether groups increase or decrease. Higher values of the index correspond to groups with strong responsiveness, while lower values correspond to groups with weak responsiveness due to either low abundance changes, low consistency among species, or low species count.

Simulated case study

To qualitatively demonstrate the problems outlined in the introduction, we first created artificial datasets of species' abundances and traits, where we considered changes in the abundance of ten species comprising four trait groups over four years (note that some species belonged to more than one group) (Fig. 1a-d). For this theoretical example, species abundances were specifically (i.e., non-randomly) chosen to highlight the case of a right-skewed community distribution due to many rare and one dominant species, and the potential impact this can have on analytical interpretations. Thus we allocated large decreasing abundances to a single species, and assigned lower abundances to all other species. We furthermore adjusted species' abundances so that three of the trait groups had low response consistency among species (groups 1, 3, and 4), while one trait group had high consistency (group 2). Temporal dynamics of the trait groups (Fig. 1e) were first calculated using the two standard methodsthe slope of the abundance of each trait group over time and the PCA loadings of each group. The TR index was then calculated and trait group contribution rankings were compared across the three methods.

Real-world example 1: reef fish responses to coral bleaching

We next examined coral-reef fish dynamics following a mass coral bleaching event, specifically examining which trait groups were most impacted by coral mortality. The Seychelles Islands experienced wide-spread coral mortality following severe bleaching during the 1998 El Niño event, which led to substantial changes in benthic structure and reef fish community composition [START_REF] Graham | Predicting climate-driven regime shifts versus rebound potential in coral reefs[END_REF]. Fish abundance data were collected at 21 sites around the Seychelles Islands using underwater visual census (UVC) in both 1994 (pre-bleaching) and 2005 (post-bleaching). Abundance data were collected for 129 species, which were assigned to six trait groups according to species' main diets: predators, invertivores, planktivores, grazing herbivores (grazers), scraping herbivores (scrapers), and corallivores [START_REF] Graham | Predicting climate-driven regime shifts versus rebound potential in coral reefs[END_REF]. Because dominant species can bias group dynamics (as outlined above), all species abundances were log10(x+1) transformed before analyses. Standard data transformations such as log and Hellinger can strongly alleviate the influence of dominant species; however, data transformations cannot entirely resolve the issues outlined in the introduction, as species' abundances often vary by several orders of magnitude. The TR index was then calculated and trait group rankings were compared with the rankings from the absolute value of slope and PCA loadings.

Real-world example 2: long-term changes in North Sea fish communities

We next applied the TR index to long-term fish community data in the southern North Sea, again examining which diet groups were most responsive to environmental changes through time. The southern North Sea has experienced significant community change in the last thirty years due to sea surface warming, with marked increases in warm-adapted species [START_REF] Dulvy | Climate change and deepening of the North Sea fish assemblage: a biotic indicator of warming seas[END_REF][START_REF] Engelhard | Ecotypes as a concept for exploring responses to climate change in fish assemblages[END_REF][START_REF] Cheung | Signature of ocean warming in global fisheries catch[END_REF]. Fish abundance data have been collected annually since 1983 across the entire North Sea during the fisheries monitoring campaign the International Bottom Trawl Survey (Verin 1992). Here we included data for the southern North Sea (area approximately south of the 50-m depth contour; [START_REF] Pecuchet | From traits to life-history strategies: Deconstructing fish community composition across European seas[END_REF]McLean et al. 2018a) ranging from 1983 to 2015 for 110 species. Species were assigned to five trait groups according to their main diets: piscivores, benthopiscivores, carcinophages (crab-eating), benthivores, and planktivores. All species abundances were log10(x+1) transformed before analyses. We then calculated and compared the TR trait group rankings against rankings of the absolute value of slope and PCA loadings.

Results

Simulated case study

Trait group #4 was ranked as the group with the greatest contribution to temporal community dynamics, i.e. the most responsive trait, by both the slope of trait group abundance and by PCA loadings (Fig. 2). However, further examination revealed that this pattern was driven by the abundance of the single dominant species (#5) (Fig. 1d). Using the TR index, however, group #4 dropped from most responsive to second, while group #2 rose from third to first (Fig. 2). While group #2 did not have the greatest change in overall abundance, this group included nearly half the species, all of which decreased in abundance (Fig. 1b). These results highlight the potential discrepancy between standard community-level methods and methods that consider interspecific differences. Here, by considering the response of each species within a trait group rather than the total abundance of the group itself, we found that group #2 was much more representative of community responses as all species within this group had the same dynamics (i.e., decreased in abundance).

Reef fish responses to coral bleaching

All six trait groups decreased in abundance between 1994 and 2005 following the wide-spread coral bleaching event. The absolute value of slope ranked corallivores as the trait group with the greatest contribution to community responses (i.e., the most responsive trait), followed closely by invertivores, planktivores, and grazers, while scrapers and predators had weak responses. PCA loadings, on the other hand, ranked invertivores and grazers as the most responsive groups, while corallivores and planktivores had lesser and nearly equal rankings, and predators and scrapers again had weak responses (Fig. 3). Using the TR index, corallivores were ranked as the most responsive group, substantially above all other groups in relative importance, while invertivores, grazers, and planktivores all dropped markedly and had similar responses (Fig. 3). While both slope and the TR index ranked corallivores as the most responsive trait group, the relative importance of corallivores in comparison to invertivores and planktivores was much higher for the TR index. In contrast, PCA loadings originally ranked invertivores and grazers as the most responsive groups based on their prevalence and dominant abundances; however, following massive loss of live corals, corallivores were clearly most impacted, as all species were similarly impacted despite their lesser abundances.

Long-term changes in North Sea fish communities

All five trait groups increased in abundance over time. Using slope and PCA loadings, planktivores were ranked as the trait group contributing most to community responses in the southern North Sea, followed closely by benthivores, with piscivores, benthopiscivores, and lastly carcinophages having lower contributions (Fig. 4). Using the TR index, planktivores remained the most responsive group; however benthivores dropped substantially, from second to fourth, while benthopiscivores rose from fourth to second (Fig. 4). Carcinophages also rose from fifth to third, while piscivores dropped to last. Thus, when considering species-specific responses, benthopiscivores were much more responsive to long-term environmental changes in the southern North Sea than benthivores, and carcinophages were more responsive than piscivores.

Discussion

Our results draw attention to the danger of statistically examining trait dynamics without considering interspecific differences, especially when communities are composed of few dominant and many rare species. Here, we show that using different methods to examine the same trends can lead to markedly different rankings of the trait groups that are most responsive to environmental changes. Incorporating basic concepts like species dominance and response consistency among trait group members lead to different results than standard community-level methods and highlighted the importance of considering species-specific responses when analyzing trait dynamics.

While rarely discussed in current literature, ignoring the potential impacts of individual species responses, notably dominant species and species with inconsistent dynamics, can greatly bias statistical results and remains a prevalent issue in trait-based studies. Numerous studies examining temporal changes in communities' trait structures use methods such as PCA, redundancy analysis (RDA), or RLQ analysis (co-inertia analysis of environmental (R), species (L), and trait (Q) matrices), which are all heavily influenced by dominant species. Additionally, while we examined trait groups according to categorical traits, applying such methods to community-weighted mean trait values rather than trait groups does not relieve the issue, as major changes in trait dominance can be entirely driven by single species (Bello et al. 2007[START_REF] De Bello | Hierarchical effects of environmental filters on the functional structure of plant communities: a case study in the French Alps[END_REF][START_REF] Nickerson | Sensitivity of a fish time-series analysis to guild construction: a case study of the Mullica River-Great Bay ecosystem[END_REF]. While recent approaches have been developed to identify the contribution of different species to changes in a single community-weighted mean trait (e.g., temperature preference) [START_REF] Princé | Climate change in our backyards: the reshuffling of North America's winter bird communities[END_REF][START_REF] Gaüzère | A framework for estimating species-specific contributions to community indicators[END_REF], this issue remains unresolved for multi-trait approaches. Here, for simplicity, we examined changes in multiple trait groups within the single trait 'diet,' however, integrating multiple traits is necessary to fully characterize community responses to environmental change [START_REF] Lefcheck | Choosing and using multiple traits in functional diversity research[END_REF]. Studies examining fish community dynamics generally integrate several traits such as habitat use, diet, body size, and reproductive mode [START_REF] Frainer | Climate-driven changes in functional biogeography of Arctic marine fish communities[END_REF][START_REF] Pecuchet | Spatial distribution of life-history traits and their response to environmental gradients across multiple marine taxa[END_REF][START_REF] Mclean | Functional reorganization of marine fish nurseries under climate warming[END_REF].

Identifying the traits that are most responsive to environmental changes (rather than identifying the species that contribute most to changes in a single trait) in such multi-trait studies is substantially more difficult, as multi-trait dynamics are clearly blurred by interspecific differences.

Furthermore, choosing and assigning traits to different species can have a major impact on results depending on the dominance and dynamics of the species. For example, when a dominant species is both a planktivore and a piscivore depending on ontogeny and resource availability, if the species is classified as a piscivore and has major changes in abundance, the overall conclusion will be that piscivores are heavily impacted by disturbance, even though this result was driven by a single opportunistic species. While seemingly intuitive, such issues remain widespread in trait-based studies and their potential consequences are rarely considered.

A central goal of trait-based ecology is to understand how organisms respond to environmental gradients, notably to anticipate future biodiversity changes [START_REF] Keddy | Assembly and response rules: two goals for predictive community ecology[END_REF][START_REF] Weiher | Assembly Rules, Null Models, and Trait Dispersion: New Questions from Old Patterns[END_REF][START_REF] Mcgill | Rebuilding community ecology from functional traits[END_REF][START_REF] Winemiller | Functional traits, convergent evolution, and periodic tables of niches[END_REF]. As human impacts continue to change the global environment, understanding how different trait groups will respond is critical to planning how we will adapt conservation and management efforts to maintain ecosystem services [START_REF] Vitousek | Human domination of Earth's ecosystems[END_REF][START_REF] Hulme | Relative impacts of human-induced climate change and natural climate variability[END_REF][START_REF] Edwards | Impact of climate change on marine pelagic phenology and trophic mismatch[END_REF][START_REF] Thuiller | Using niche-based modelling to assess the impact of climate change on tree functional diversity in Europe[END_REF][START_REF] Poloczanska | Global imprint of climate change on marine life[END_REF]. As the power of trait-based ecology lies in understanding fundamental trait-environment relationships, we must consider ecological implications, like species-specific responses, to a greater extent in statistical methods. The greatest potential danger lies in misidentifying traits that are most responsive to environmental changes, especially for resource management. For instance, in the artificial example, standard methods identified trait group #4 as the most responsive, which could lead to the conclusion that group #4 is the most characteristic of the community response. Thus, resource managers might mistakenly believe that environmental changes most prominently impact communities through decreases in species in group #4, when in fact decreases in species in group #2 are much more representative. By misidentifying trait-environment relationships driven by dominant species, resource managers could be ill-prepared for sudden changes in community structure driven by rare species. In our reef fish example, an ecosystem at the forefront of climatic disturbance [START_REF] Graham | Predicting climate-driven regime shifts versus rebound potential in coral reefs[END_REF][START_REF] Hughes | Spatial and temporal patterns of mass bleaching of corals in the Anthropocene[END_REF]), standard statistical methods (i.e., PCA) could support the conclusion that invertivores are the most responsive trophic group to coral bleaching, leading to potential misallocation of resources, when in reality corallivores are much more responsive and present a more critical management target. In the southern North Sea, an ecosystem highly impacted by climate warming [START_REF] Dulvy | Climate change and deepening of the North Sea fish assemblage: a biotic indicator of warming seas[END_REF][START_REF] Engelhard | Ecotypes as a concept for exploring responses to climate change in fish assemblages[END_REF]McLean et al. 2018a), standard methods would conclude that benthopiscivorous species have been relatively unimportant to community dynamics through time and are thus unresponsive to sea surface warming, when in reality this group has shown consistent, positive responses. These examples highlight how our basic understanding of community responses to climate change can be compromised if we fail to consider the interspecific differences behind trait dynamics.

As our primary objective in this concept paper was not to develop a new method for examining trait dynamics, but to highlight potential issues arising from standard methods, we acknowledge that the index used here is both basic and imperfect, and alternatives with other ecological criteria and different mathematical structures are feasible. For example, while our index was based on consistency among group members using Kendall's coefficient of concordance, this approach cannot account for competition among species within groups, or functional replacement by unaffected species within the same group (i.e., via functional redundancy). However, we reconcile that groups containing species that show inconsistent environmental responses (i.e., some decrease while others increase) due to competitive release or functional replacement are likely not the most environmentally-responsive groups given that some species suffer while others benefit. Rather, other traits may better explain why species increased or decreased in abundance, and groups where nearly all species are similarly affected are likely more responsive. Kendall's concordance may also not be well adapted for hyperdiverse regions because too many species packed within few groups could mask the responses of highly impacted group members. Moreover, we also suggest examining each of the three indicators composing the TR index, as similar TR values among groups can hide different response patterns (e.g., small changes in abundance with high Kendall's concordance and vice versa). We therefore encourage others to propose additional ecological criteria relevant to examining trait dynamics and to develop alternative methods that build on the concepts presented here. Furthermore, with the goal of accurately identifying trait group responses to environmental change, additional approaches focusing on the underlying mechanisms of trait responses will greatly increase our understanding of trait-environment relationships. Laboratory studies examining how different trait groups, and their constituent species, respond to environmental variation like sea-surface warming can more concretely determine which traits are truly most sensitive to environmental changes, and identify the physiological characteristics linking these traits [START_REF] Ospina | Effect of body size on reef fish tolerance to extreme low and high temperatures[END_REF][START_REF] Sandblom | Temperature acclimation rate of aerobic scope and feeding metabolism in fishes: implications in a thermally extreme future[END_REF][START_REF] Verberk | Field and laboratory studies reveal interacting effects of stream oxygenation and warming on aquatic ectotherms[END_REF][START_REF] Messmer | Global warming may disproportionately affect larger adults in a predatory coral reef fish[END_REF]. Such understanding will be critical for anticipating the ecological impacts of global environmental change.

The examples in this concept paper bring to light a specific case in prioritizing trait group responsiveness, but also draw attention to the larger issue of framing data analyses and

FiguresFig. 1

 1 Figures

Fig. 2

 2 Fig. 2 Comparison of slope, PCA loadings, and the TR index for assessing the contributions of individual trait groups to the temporal responses of an artificial community of ten species comprising four trait groups.

Fig. 3

 3 Fig. 3 Comparison of slope, PCA loadings, and the TR index for assessing the contributions of reef-fish trait groups to community responses following mass coral mortality due to coralbleaching.

Fig. 4

 4 Fig. 4 Comparison of slope, PCA loadings, and the TR index for assessing the contributions of trait groups to long-term community responses in the outhern North Sea.

Acknowledgements

This study was supported by Électricité de France (RESTICLIM and ECLIPSE project), IFREMER (ECLIPSE project), Région Hauts-de-France and the Foundation for Research on Biodiversity (ECLIPSE project, contract no. astre 2014-10824).

interpretations in ecological contexts. While many powerful tools are readily available to contemporary ecologists, the corresponding results are only as good as the interpretations they permit. As trait-based ecology continues to expand, it is important that we consider the ecological contexts of methods and results in order to generate trait-environmental relationships that accurately reflect community dynamics, a critical step for better understanding ecosystem functioning.

Compliance with Ethical Standards

The authors declare no conflict of interest. All applicable international, national and/or institutional guidelines for sampling, care and experimental use of organisms for the study were followed.


Giuseppe Antonio Pierro

Roberto Tonelli

Michele Marchesi

An Organized Repository of Ethereum Smart Contracts Source Code and Metrics

Many empirical software engineering studies show that there is a great need for repositories where source code is acquired, filtered and classified. During the last few years, Ethereum block explorer services have emerged as a popular project to explore and search Ethereum blockchain data such as transactions, addresses, tokens, smart-contracts' source code, prices and other activities taking place on the Ethereum blockchain. Despite the availability of this kind of services, retrieving specific information useful to empirical software engineering studies, such as the study of smart-contracts' software metrics, might requires many sub-tasks, such as searching specific transactions in a block, parsing files in HTML format and filtering the smart-contracts to remove duplicated code or unused smart-contracts. In this paper we afford this problem creating Smart Corpus', a Corpus of Smart Contracts in an organized, reasoned, and up to date repository where Solidity source code and other metadata about Ethereum smart contracts can easily and systematically be retrieved. We present the Smart Corpus' design and its initial implementation and we show how the data-set of smart contracts' source code in a variety of programming languages can be queried and processed, to get useful information on smart contracts and their software metrics. The Smart Corpus aims to create a smart-contracts' repository where smart contracts data (source code, ABI and byte-code) are freely and immediately available and also classified based on the main software metrics identified in the scientific literature. Smart-contracts source code has been validated by EtherScan and each contract comes with its own associated software metrics as computed by the freely available software PASO. Moreover, the Smart Corpus can be easily extended, as the number of new smart-contracts increases day by day.

I. INTRODUCTION

With the advent of blockchain technology as a mainstream technological innovation many researchers and software developers started investigating the new possibilities for software products relying on such infrastructure. Second generation blockchains offer the possibility to code the so called smart-contracts in a Turing complete programming language where all the main operations of traditional software systems can be carried on. The paradigmatic reference is the Ethereum blockchain which offers the possibility to deploy and execute decentralized applications (dApps) which are mainly coded in Solidity, presently the most adopted programming language [START_REF] Peter | A systematic analysis of real-world energy blockchain initiatives[END_REF].

Coding smart-contracts which run in a blockchain environment has its peculiarities and constraints and differs from coding in traditional out-of-chain contexts. One of the major differences is the immutability of deployed code, so that if bugs or bad smells are introduced into a smart-contract these cannot be fixed afterwards with patches. Another contract must be deployed in substitution of the former and users must be well advised not to use the wrong code. Another main issue is the interaction with the blockchain by means of transactions where information exchange can occur only between blockchain internal components. Furthermore, memory occupation on blockchain typically has a cost that developers want to reduce and chaining all the blocks poses limits to the reasonable space available for each smart-contract imposing practical constraints to source code size.

This new programming paradigm poses major challenges also to expert developers so that famous failures are commonly found in blockchain software (2; 3). The novelty of the paradigm largely contributes to these faults, since developers do not have historical records or examples where to learn from previous code, as it happens in traditional software coding, where software reuse and coding by imitation are reference practices to help in coding better quality software. Another issue is the lack of reference measures, such as quality, complexity or coupling metrics, which are extensively used in out-of-chain software production to keep software projects under control [START_REF] Ibba | Initial coin offerings and agile practices[END_REF].

The situation is slowly changing for what concerns historical records (even if history is quite recent) of software code, since the Ethereum blockchain can now count on up to 1.5 million deployed smart-contracts, which have been used and running in the last few years. Access to the source code of this body of smart-contracts is still a challenge since the transparency and the open access granted by the public blockchains regards only data registered in the blocks, where only contracts' byte-code is available.

To access the smart-contracts' source code, the developers must resort to other means or to code repositories, such as the classical GitHub or similar resources. Fortunately, in the last few years, EtherScan 1 and other web sites have started providing smart-contracts checking as a service, so that Ethereum developers can submit their source code to be analyzed and the source code is made available afterword by the website. However, there is an odd side of the medal for many reasons: the access to this body of knowledge is far from easy and far from fast; it is not structured and organized; the smart-contracts metrics are not available and must be computed separately. All these tasks can and need to be automatized, to save developers' time and work, as well as computational resources. Indeed, in the last few years, a number of research papers have been published reporting findings based on smart-contracts' source code, mined from GitHub or some Ethereum block explorer such as EtherScan (5; 6; 7; 8). However, when conducting this kind of empirical research on smart-contracts with data from Ethereum blockchain, the tasks above mentioned need to be carried out by the developers themselves. The first task is the downloading of the smart-contracts' source code to be analyzed. One way to download smart-contracts' source code data is to inspect open-source software (OSS) project repositories such as GitHub [START_REF] Jaccheri | Open source software: A source of possibilities for software engineering education and empirical software engineering[END_REF].

Another way to perform this task is to use some Ethereum block explorer. These web services allow users to find the desired information by directly accessing the Ethereum blocks, by using a unique identifier or sequentially searching several blocks [START_REF] Bragagnolo | Ethereum query language[END_REF]. Some of these Ethereum block explorers provide RESTful Web services, which allow the users to obtain a JSON format payload containing various data. These data may be related to a current or past state of the Ethereum blockchain: an example may be the list of transaction addresses included in a given block of the Ethereum blockchain. This activity might be tedious and time-consuming [START_REF] Zhou | Open source software reliability model: An empirical approach[END_REF], when conducted by a single user/developer/researcher. Furthermore, the obtained smartcontracts' data-set can consist of duplicated smart contracts, i.e. smart-contracts having different addresses but with the same code.

In this work we tackle these problems and propose an organized, easy to use, large and available software repository for Ethereum smart-contracts source code and metrics where users, researchers, blockchain start-ups and developers can take advantage of the body of knowledge collected during the last few years. This paper thus proposes Smart Corpus, a repository that provides the users with an interface, which allows to search and download smart contracts' source code. The user interface is available at the following online address: https://aphd.github.io/smac-corpus/. The main challenge of the implementation lies in the fact that the Ethereum blockchain stores a massive amount of heterogeneous data, smart-contracts included, which enormously grow in time. For this reason, Smart Corpus was designed to be scalable, by adopting the latest cutting-edge technology, such as document-oriented database, graph query language and serverless computing platform [START_REF] Kratzke | Volunteer down: How covid-19 created the largest idling supercomputer on earth[END_REF].

II. RELATED WORK A. Previous Literature on Software Corpus Analysis

Gabel and Su [START_REF] Gabel | A study of the uniqueness of source code[END_REF] built and studied a corpus of open source software written in three of the most widely used languages: C, C++, and Java. The corpus contains six thousand software projects corresponding to 430 million lines of source code. The authors measured the degree to which each project of the corpus can be "assembled" solely from portions of the corpus, thus providing a precise measure of "uniqueness". Their primary contribution is to provide a quantitative answer to the following question: how unique is software? Our work also aims to answer this question, because many smart contracts written in the Solidity language have code that is a replication of other smart contracts, although presenting different addresses, as we will see in Section III-B. Our goal is therefore to answer the question: how unique are smart contracts written in Solidity? in order to provide a corpus that is composed by smart contracts which can be distinguished from each other.

Tempero and co-authors (14) presented the "Qualitas Corpus", a curated collection of open-source Java systems. The corpus reduced the time needed to find, collect, and organize the necessary source code sets to the time needed to download the corpus. The metadata provided with the corpus explicitly indicates the metrics calculated to identify the main features of the source code: the number of code lines, the number of classes, etc. Our work also aims to present a curated collection of smart-contracts equipped with a set of metadata with the aim of allowing experts in the blockchain field to perform static analysis.

B. Static Analysis on Smart Contract Code

There is a number of scientific publications having as objective the analysis of the smart-contracts' source code, also testifying the scientific community's interest in advancing the knowledge about the characteristics of smart-contracts' code structure.

Hegedus [START_REF] Hegedus | Towards analyzing the complexity landscape of solidity based ethereum smart contracts[END_REF] developed a metric calculator for Solidity code, inspired by the work by Tonelli and collaborators [START_REF] Tonelli | Smart contracts software metrics: a first study[END_REF]. The metric calculator uses a parser to generate an abstract syntax tree (AST), on which it computes various software metrics, such as the number of code lines for each smart-contract, the Cyclomatic Complexity, the number of functions, the number of parameters for each function. This command-line tool is written in Java and is available on GitHub without license indication since February 2018 2 . By using this tool, he calculated and published software metrics results for 10,206 Solidity smart-contracts source code files written in Solidity languages. Our work also aims to calculate a set of metadata on the smart-contracts corpus by using a similar software.

Pinna and colleagues ( 16) performed a static analysis on 10,174 smart-contracts, deployed in the Ethereum blockchain. The authors showed that some metrics related to smart contracts, such as the number of transactions and the balances follow power-law distributions. Also, they reported that software code metrics in Solidity have (on average) lower values but higher variance than metrics values in other programming languages for standard softwares. Our work is inspired by their research as Smart Corpus is characterized by (some of) the metrics they defined, as we will explain in Section III-C.

Pierro and Tonelli [START_REF] Antonio | Paso. In Conference Proceedings on Object-Oriented Programming Systems, Languages, and Applications[END_REF] pointed out that even the most experienced users, as software developers of smart contracts are, need to be helped to analyze smart contracts and write a more reliable and secure code. For this reason, an open-source platform 3 , called PASO, was proposed as an aid for experts in smart-contracts' static analysis. Their work focused on Ethereum blockchain and smart-contracts written in Solidity. The platform PASO facilitates the debugging of smart-contracts by providing software metrics commonly used to comply with coding guidelines.

C. Related Projects

Other projects, similar to Smart Corpus, have been previously developed, to online access smart-contracts' code deployed in the Ethereum blockchain platform. The projects present specific features and limitations which are summarized in Table I. • The smart contracts' source code collected in GitHub typically has not a direct reference to smart contracts deployed on the blockchain through an Ethereum address, therefore it is hard to find out whether it has been really tested or used on the blockchain. • GitHub does not implement a search engine to filter smart-contracts based on particular software metrics, such as the number of modifiers or payables. This is due to the fact that some metrics are specific to the type of language employed to write smart-contracts, i.e. Solidity. • In GitHub there is no information on smart-contracts' use in a real blockchain scenario, on the number of transactions invoking smart-contracts, or the number of tokens associated with each smart contract. • GitHub does not provide smart contracts ABI or Opcode. It is highly probable that the users, especially if they are developers or researchers, want to access smart-contracts' source code choosing the features implemented in Smart Corpus, on the basis of its specific software metrics and its real usage on the blockchain.

2) Ethereum Block Explorers: Ethereum block explorers are platforms that allow the users to explore and search the Ethereum blockchain for transactions, addresses, tokens and other activities taking place on the Ethereum blockchain [START_REF] Bistarelli | Analysis of ethereum smart contracts and opcodes[END_REF]. Unlike GitHub, the Ethereum block explorers allow accessing only Ethereum data used in the Ethereum blockchain and thus smart contracts' real use-cases. To date, in the market, there are different Ethereum block explorers, as for instance:

• Ethplorer4 provides an API to access many Ethereum data, such as the balances for specified token, the description of a specific address but it does not allow to access to the smart contracts' code. The full documentation of the Ethpoler API is available at the following address 5 . The Requests to API are limited to 5 per second, 50/min, 200/hour, 2000/24hours, 3000/week. • EtherChain6 is an explorer for the Ethereum blockchain. Unlike Ethplorer, it claims to provide smart contract code, even though it actually displays the contract byte-code and the Constructor arguments, for a specific smart contract's address.

EtherChain provides API just to access the Oracle gas price predictions 7 , but not the Ethreum data. If the users want to gather Ethereum data from EtherChain, they need to parser the HTML code.

• BlockScout 8 provides an API to access the Ethereum data. It claims to have an API to access only the source code of few verified smart contracts. Anyway the addresses list of the verified smart contracts is not available in BlockScout. • EtherScan allows to explore and search the Ethereum blockchain for smart-contracts. However, when downloading the smart-contracts' source code, the block explorer presents some limitation. First, smart-contracts' data and number are huge (on the Giga scale, based on our estimation), but there is a limited API rate of 100 submissions per day per user to retrieve just a smart contract, making the complete download of the data an impossible endeavour 9 . Second, the EtherScan's API does not provide facilities to obtain a list of the smart-contracts's address, as the existing API calls mainly allow navigation from one block to another. Third, a researcher cannot directly and easily explore the smart-contract's source code, but rather has to first inspect any block in Ethereum and then look for all the transactions that involve an address associated with the smart-contract.

III. RESEARCH METHODOLOGY

Smart Corpus has been designed to provide the users with a reasoned repository, i.e. a repository which is not just a web space where to collect them but also and mainly a service to help the researchers to filter and analyze the Smart contracts' source code. To this aim, Smart Corpus has been planned to perform four main automatic operations on Smart contracts' source code (data): 1) Data Retrieving, 2) Data Cleaning, 3) Data Modelling, 4) Data Querying. Figure 1 shows the Smart Corpus's pipeline of the operations. We collected smart-contracts' source code, smart-contracts' application binary interface (ABI) and smart-contracts' byte-code through the EtherScan web site, which makes available the source code of a subset of verified smart-contracts deployed on the Etehreum blockchain, though in a laborious way. We instead made this task easier and automatic via a retrieving data script available at the following address 10 . During this phase the blockchain blocks are automatically inspected. Each block is formed by a list of transactions between two different blockchain addresses, which can refer to a wallet or to a smart-contract. The script looks for addresses that refer to a smart-contract and when the source code is available, it downloads the smart-contract's source code, the ABI and the byte-code. The data coming from the source code are not immediately available as they are embedded in the HTML code of the web page provided by EtherScan. Therefore, the script removes the HTML tags and stores the code cleaned up.

Figure 2a shows how Smart Corpus finds the smart-contracts' list in a given block. Figure 2b shows the HTML page where the smart contract code is available. The HTML page containing the smart contract code and the HTML tags is downloaded. Figure 2c shows the HTML code that will be processed to remove the HTML tags and save just the Solidity source code of the smart-contract. 7 The smart-contracts' code is stored in the filesystem of the Smart Corpus server. Due to the quota limits on queries per second (EtherScan web site allows few connections per second), Smart Corpus contains only a portion of all available smart contracts. However, the retrieving data phase is continuously collecting data, starting from December 10, 2019. To date, thirty thousand of smart-contracts (source code, ABI and byte-code) have been downloaded and made available through Smart Corpus.

B. Cleaning Data

Each smart-contract in the Ethereum blockchain is distinguished from any other smart-contract as it is identified by a unique address, i.e. a hash of 160 bits, and its byte-code is stored on the blockchain [START_REF] Shyam | Towards a metrics suite for object oriented design[END_REF]. Indeed, each time a smart-contract is deployed in the network, either in the main or in the test network, a unique address is associated with the smart-contract even in the case the source code of two or more smart-contracts is the same. However, this is a problem for the analysis of the software metrics, because the smart-contracts are distinguished only on the basis of their address and not of their content. Therefore, Smart Corpus eliminates double contracts in order to provide a clean smart-contracts' corpus, where to perform the analysis. To this aim, duplicate smart-contracts have been defined on the basis of their content, i.e. having the same code despite presenting different address.

C. Modelling Data

Unlike the tools discussed in the related work Section II, Smart Corpus associates different metrics (intrinsic metrics and extrinsic metrics) to the smart-contracts, aiming to facilitate the selection of a smart-contracts' set that meets precise requirements. The metrics associated with the smart-contracts are then stored in a document-oriented database. Figure 3 shows the database schema of a smart contract. Fig. 3: Smart-Corpus's database schema 1) Smart Contracts' Intrinsic Metrics: The smart contracts' intrinsic metrics are smart-contracts' software metrics which depend on internal properties of the smart contracts' code, such as the number of lines of code, modifiers, payable, etc. Table II shows the smart-contracts' intrinsic software metrics. 2) Smart Contract Extrinsic Metric: The smart-contracts' extrinsic metrics are properties depending on external factors rather than the code itself, such as the number of transactions executed to the smart-contracts or the number of tokens associated with the smart contracts. Table III shows the smart-contracts' extrinsic metrics.

TABLE III: Smart-contracts' extrinsic metrics

Name Description

Transactions "Transactions" represents the total number of transactions generated by the smart contract (sent or received). Balance "Balance" is the amount of crypto coins associated with a smart-contract address. EtherValue "EtherValue" is the dollar value associated with a smart-contract address. Token "Token" is the value for each token associated with a smart-contract address. Last seen "Last seen" is the timestamp of the last time the smart-contract was used (sent or received). First seen "First seen" is the timestamp of the first time the smart-contract was used (sent or received).

D. Filtered Data

The smart contracts' source code is stored in a file system and is organized in folders and subfolders to ease the navigation. Figure 4 shows the sub-directory structure. The first leaf corresponds to the first two letters of the smart contract address and then each directory contains the file having as name the full address of the smart contract and three different extensions, respectively .sol for the Solidity source code, .abi for the ABI, and .bytecode for the byte code. The metadata (both the intrinsic and extrinsic metrics) are stored in a document-oriented database: MongoDB [START_REF] Chodorow | MongoDB: The Definitive Guide[END_REF]. The choice to use a Document-oriented database instead of a relational database such as Mysql is based on:

• Relational databases are prone to deterioration when data-sets overcome a size threshold, while a document-oriented database such as MongoDB comes with inbuilt load balancer, which makes it a better solution in applications with high data load [START_REF] Diogo | Consistency models of nosql databases[END_REF]. We update MongoDB each day to generate the data archive. • Unlike relational databases where data is stored in rows and columns, document oriented databases store data in documents.

The documents typically use a structure similar to JSON (JavaScript Object Notation), they indeed provide a natural way to model data that is closely aligned with object oriented programming. Each document is considered as an object in object oriented programming, similarly each document is a JSON in document-oriented database. The concept of schema in document databases is dynamic: every document might contain a different number of fields. This is useful when modeling unstructured and polymorphic data. Also, document databases allow robust queries: any combination of fields in the document can be combined for querying data [START_REF] Baker Effendi | Suitability of graph database technology for the analysis of spatio-temporal data[END_REF].

E. User Interface

The Smart Corpus' graphical user interface (GUI) allows users to access the smart-contracts' repository. There are two way to access the smart-contracts' repository: through the "HTML user interface" and through a "GraphiQL application", both of them via a Web browser.

1) Smart Corpus HTML user interface: The Smart Corpus HTML user interface is publicly available since January 2020 11 . Figure 6 shows the different components of the GUI.

• At the top, the user can find the form where to filter the smart-contracts. The form is made of a number of drop-down lists, each one corresponding to a different metric and a submit button to perform the research. The GUI form allows the user to inspect smart contracts based on some metadata, such as the "pragma version", and software metrics, such as the numbers of "modifiers" and/or the numbers of "payable". • Below the form, the smart contracts filtered by the user are displayed. For readability reasons, only a part of the smartcontracts metrics are presented in the table layout format. Each column header in the table indicates the name of a metric associated to smart-contracts. While the HTML-GUI displays just some metrics, the user can access to all the metrics and to the smart-contracts' source code by selecting the checkbox displayed on the right of the smart-contract address and clicking on the red button "download". The user can also access the original repository where the smart-contract was retrieved, i.e. the EtherScan service. 2) Smart Corpus GraphQL application: Graph Query Language (GQL) is a full data query language to implement webbased services, centered on high-level abstractions, such as schemas, types, queries, and mutations. GQL is a domain-specific language internally developed in Facebook from 2012 onward and publicly announced in 2015, with the release of a draft language specification. The language was conceived with the following goals:

• To reduce possible overload of data transfer relative to REST-like web service models, in terms of both the amount of data unnecessarily transferred, and the number of separate queries required to do it. • To reduce the potential of errors caused by invalid queries on the part of the client. In particular, with the GQL application, the user can execute "type introspection", i.e. the user can examine the type or properties of an object at runtime. For example, thanks to the introspection queries the user can find out both the intrinsic and the extrinsic metrics associated with a specific smart-contract while typing the query. Figure 5 shows an example query and its result. Smart Corpus GQL application, unlike the Smart Corpus HTML user interface is still in development and testing phase. However, the Smart Corpus GQL application source code is publicly available and can be downloaded and deployed on any platform having the software requirements specified in its documentation 12 .

F. Use Case

A use case for Smart Corpus might concern a researcher interested in the static analysis of smart contracts. For example, the researcher might be interested in performing an analysis of smart-contracts written with a particular version of the Solidity language, 6.0, and having at least a payable function in the smart-contract. The research of smart contracts that meets these requirements would be very expensive in terms of time, work and computational resources, using a service like EtherScan. Instead, thanks to the Smart Corpus, the user needs to perform only a few steps, as described below:

• connect to the service through the link: https://aphd.github.io/smac-corpus/ • select the option "version 6.0" from the drop-down menu entitled "pragma version".

• select the option "greater than zero" from the drop-down menu entitled "number of payables".

• submit the form by clicking on the button "submit". After few seconds, depending on the number of smart-contracts that meet the requirements specified by the user, the smartcontracts' addresses and the metrics values will be displayed in a table layout format ready to be downloaded. The Smart Corpus has been in use for 10 months, since December 2019 and 100K smart contracts have been downloaded via the user interface. Until the paper was written (October 2020), Smart Corpus is a curated corpus of 30K smart-contracts's source codes, ABI and byte-codes with related metadata and software metrics. As the time passes, the Smart Corpus is continuously increasing at a rate of 100 smart contracts per day. Figure 7 shows the number of smart-contracts' source codes, ABI and byte-codes retrieved per day since the Smart Corpus was deployed for the first time. For each smart contract Smart Corpus computed extrinsic and intrinsic metrics, as described in Sections III-C2 and III-C1. Summing up, the Smart Corpus has two GUIs to access data, the HTML GUI and the GraphQL interface. The HTML GUI is described in Section III-E1, while the GraphQL interface is described in Section III-E2. The GraphQL interface gives blockchain researchers the ability to request for exactly what they need. The user can directly access the results via GraphQL interface, as shown in Figure 5.

Unlike the existing repositories (see Section II-C2) which make available the source code in a laborious way, Smart Corpus instead made this task easier and faster. Indeed, one of the advantages of using Smart Corpus lies in the fact that it can reduce the costs in performing the smart contract static analysis. For example, it can be used to easily analyze design and programming patterns for the smart contract programming language.

Even though Smart-Corpus service has been working for a few months and has not been advertised yet, it has already collected 30K smart-contracts, thus providing an interesting and helpful future venue for researchers and software developers interested in the Blockchain. Moreover, Smart Corpus allows to analyze how the industry companies use the Solidity programming language to solve concrete problems in different application areas, such as Healthcare, Insurance, Transportation, Government, Entertainment and Energy.

V. CONCLUSIONS AND FUTURE WORKS

In this paper, we described the Smart Corpus project, an effort to bring smart contracts data (source codes, ABIs and byte-codes) to the hands of the research community, providing help for reproducible research and a less time-consuming way to gather data and perform static analysis. The project has already stored several megabytes of data, which correspond to about thirty thousand of smart contracts. This work corresponds to 10 months of data retrieving that are made available to the blockchain scientific community and the blockchain developers in a few seconds. The Smart Corpus data-set has strong potential to provide an interesting venue for research in many software engineering areas including, but not limited to, the best practices for Solidity software development, distributed collaboration, and code paternity and attribution. The Smart Corpus project is in its initial stage of development, but it can already provide useful insight for researchers on smart contracts' coding and everyday use in the blockchain. The corpus will continue to be expanded in content and in the provision of intrinsic and extrinsic metrics, this becoming more and more representative of the Solidity code actually used in the blockchain community. APPENDIX Listing 1 displays a GQL query that returns the smart-contracts's address having more than 20 methods defined in a contract. Listing 2 displays the query results in the JSON format. The query output, in addition to the smart-contract's address, 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 1,

Fig. 1 :

 1 Fig. 1: Smac-Corpus's pipeline model

Fig. 2 :

 2 Fig. 2: Data Retrieving Pipeline. The figures 2a, 2b, 2c shows three different phases to retrieve the smart contracts.

Fig. 4 :

 4 Fig. 4: Smart-contracts' directory structure.

Fig. 5 :

 5 Fig. 5: Example with the use of variables to filter a query result with GraphQL.

Fig. 6 :

 6 Fig. 6: Smart Corpus's User Interface

Fig. 7 :

 7 Fig. 7: Number of smart-contracts' collected in Smart Corpus.

{

  " d a t a " : { " m e t r i c s " : [ { " c o n t r a c t A d d r e s s " : " 0 x 5 3 6 c 7 e f e e b f f 0 a n s a c t i o n s " : 639 , " b a l a n c e " : 0 E t h e r } ] } }

TABLE I :

 I Projects' list, main features and limitations

	Project's name	Home Page	REST API URL	Limitations

TABLE II :

 II Smart-contracts' intrinsic metrics

	Name	Description
	Pragma	"Pragma" indicates version indicates which version of Solidity compiler is used to prevent
		issues with future compiler versions.
	SLOC	"SLOC" indicates the number of lines in a smart-contracts' source code.
	Modifiers	"Modifiers" indicates the number of function modifiers in a smart-contract.
	Payable	"Payable" indicates the number of payable functions in a smart-contract.
	Mapping	"Mapping" indicates the number of variables of mapping types in a smart-contract.
	Address	"Address" indicates the number of variables of address types in a smart-contract.

https://etherscan.io/

https://github.com/chicxurug/SolMet-Solidity-parser

https://aphd.github.io/paso/

https://ethplorer.io/

https://github.com/EverexIO/Ethplorer/wiki/Ethplorer-API

https://etherchain.org/

https://aphd.github.io/smac-corpus/

https://github.com/aphd/smac-corpus-api

} }

Listing 3 displays a GQL query that returns some extrinsic metrics of a specific smart-contracts's address. Listing 4 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, the amount of crypto coins associated with the smart-contract's address specified by the query 3,


Laurent Desbat
email: laurent.desbat@univ-grenoble-alpes.fr

Simon Rit

Rolf Clackdoyle

Patrice Jalade

Julien Ribouton

Patrick Pittet

Geometric tomography for measuring rectangular radiotherapy fields from six projections

Quality assurance (QA) of x-ray radiotherapy is crucial but the dosimetry of small fields is still a challenge. We are investigating the use of scintillating parallel fibers which measure the integral dose along a line, thus providing a onedimensional (1D) parallel projection of the dose of the x-ray field in a plane of a tissue equivalent medium. By stacking a few layers of scintillating fibers, each with a different orientation, one obtains a sinogram of the dose of the x-ray field sampled with a few angles and sub-millimetric resolution of each projection. We propose a geometric approach based on projections moments to identify the few parameters defining the irradiation field (e.g., center, radius, orientation, width, length and intensity for a rectangle). The order-0 moment of at least one projection provides an estimate of the integral dose. The order-1 moments of at least two projections gives the center of mass, i.e., order-1 moments of the dose map. The order-2 moments of at least three projections identify order-2 moments of the dose map. In the specific case of a uniform rectangular field, we show that the length, the width and the orientation of the rectangle can be derived from the order-2 moments of the dose map. The formulas are extended to the case of a non-uniform field due to a lateral Gaussian penumbra. Our approach is validated on simulated data of rectangular fields with increasing levels of noise and it demonstrates an accurate, robust and rapid estimation of the rectangle parameters from six projections only. A proof of concept experiment with scintillating fibers imaged with a sCMOS camera irradiated under a 30 × 30 mm 2 square field of a 6 MV linear accelerator gave, from six projections, 31.7 × 31.4 mm 2 without accounting for the penumbra and 28.6 × 28.3 mm 2 with an estimated σ = 4 mm penumbra.

I. INTRODUCTION

Q UALITY assurance (QA) of x-ray radiotherapy is crucial but the dosimetry of small fields is still a challenge. Reference measurements are currently obtained with passive dosimeters, e.g., gafchromic films [START_REF]Dosimétrie des mini-faisceaux -Mise à jour du protocole dosimétrique de détermination des FOC dans les mini-faisceaux utilisés en radiothérapie[END_REF]. These techniques require long processing time and cannot be used immediately before a treatment fraction, which would be preferable, e.g., for stereotactic treatments with a few high dose fractions. There is currently no obvious alternative device which could rapidly measure the dose, particularly when the linear accelerator is combined with a magnetic resonance imager (MRI-linac).

We are investigating the use of scintillating fibers which measure the integral dose along a line, thus providing a onedimensional (1D) parallel projection of the dose of the x-ray field in a plane of a tissue equivalent medium, see Fig. 1.Unlike solid state detectors, these fibers are tissue equivalent. By stacking a few layers of scintillating fibers, each with a different orientation, one obtains a sinogram of the dose of the x-ray field which can then be reconstructed. A similar concept has been developed previously in [START_REF] Goulet | High resolution 2D dose measurement device based on a few long scintillating fibers and tomographic reconstruction[END_REF] with a rotation sytem. Without rotation, hardware constraints will limit the sinograms to a few projection angles with sub-millimetric resolution of each projection.

Convex bodies and polygons may be identified from a few xray projections with geometric tomography [START_REF] Gardner | Geometric Tomography[END_REF]. Our approach is designed for the QA of simple radiotherapy fields. We propose a moment-based method to identify the few parameters defining the irradiation field (e.g., center, orientation, width, length and intensity for a rectangle) and then we verify in the projections that the estimated parameters are consistent with all the collected projection data.

II. THEORY

We assume that the scintillating fibers yield measurements of the parallel projection p, see Fig. 2, equivalently the Radon transform Rf , of f , see [START_REF] Natterer | The Mathematics of Computerized Tomography[END_REF],

p φ (s) . . = p(φ, s) . . = Rf (φ, s) . . = R f (s θ φ + l ζ φ ) dl (1)
where φ ∈ [0, π), s ∈ R, θ φ = (cos φ, sin φ), ζ φ = (-sin φ, cos φ), for a limited number of angles φ n , n = 1, . . . , n φ and a relatively large number of samples of s n , n = 1, . . . , n s .

A. Moments of f from moments of its projections p Let Π n (φ) be the moment of order n ∈ N of the projection p φ ,

Π n (φ) = R s n p φ (s) ds.
(

) 2
The order-0 moment Π 0 (φ) is the mass of f (independenly of φ) or, in our context, the integral dose.

Π 0 (φ) = R p φ (s) ds = R 2 f (s θ φ +l ζ φ ) dl ds = R 2 f ( x) d x.
It can be robustly estimated from all projections as

A 0,0 = n φ m=1 Π 0 (φ m ) n φ . (3)
The order-1 moment can be used to estimate the center of mass c ∈ R 2 of f . One can show that

c • θ φ = Π 1 (φ) A 0,0 , (4)
978-1-7281-4164-0/19/$31.00 c 2019 IEEE i.e. that Π1(φ) A0,0 is the projection of c onto the axis of direction θ φ . If at least two projections are known at different angle directions φ 1 , φ 2 , the center of mass c of f can be estimated by solving the linear system

   c • θ φ1 = Π1(φ1) A0,0 c • θ φ2 = Π1(φ2) A0,0 .
If more than two projection angles are measured, c can be estimated more robustly in the least squares sense. The order-2 moment, shifted using c, can then be used to calculate order-2 moments of f

R s -c • θ φ 2 p φ (s) ds = cos 2 φA 2,0 + 2 cos φ sin φA 1,1 + sin 2 φA 0,2 (5)
where

A i,j . . = R 2 x i 1 x j 2 f ( x + c) d x.
If we can compute R s -c φ 2 p φ (s) ds for three different projection angles, Eq. ( 5) yields a 3 × 3 linear system with a unique solution for A 2,0 , A 1,1 and A 0,2 . If more projections are measured, a least squares estimation can be used.

B. Estimation of a rectangle field

The previous section provides robust estimators of moments of the sought f . We now examine how to estimate a rectangular field from these moments, assuming first no penumbra of the x-ray field. The unknowns are its center of mass c, its length l, its width w, its orientation α and the dose d in every point of the rectangle. Their estimation uses the (symmetric

) covariance matrix M = 1 A 0,0 A 2,0 A 1,1 A 1,1 A 0,2
which can be diagonalized in an orthonormal basis

v 1 , v 2 such that M v 1 = λ 1 v 1 and M v 2 = λ 2 v 2 with λ 1 ≥ λ 2 > 0. It can then be shown that l = √ 12λ 1 , w = √ 12λ 2
, α is the angle between the vector (1, 0) and v 1 and d = A 0,0 /hl.

Megavoltage x-ray rectangular fields are blurred by the transport of electrons and it is common to model this penumbra by a Gaussian convolution (see, e.g., the margin recipe in [START_REF] Van Herk | Biologic and physical fractionation effects of random geometric errors[END_REF]). If the penumbra is characterized by a standard deviation σ, then the length and the width are l = 12(λ 1 -σ 2 ), w = 12(λ 2 -σ 2 ). Calculation of the other parameters is the same.

III. EXPERIMENTS A. Simulations

Following the design of an initial prototype, we simulated 6 views equally distributed over π, 128 pixels per view and 0.4 mm pixel spacing. Projections of 1000 random rectangles were simulated and the parameters were automatically estimated. The sampling was uniformly distributed in the interval [START_REF]Dosimétrie des mini-faisceaux -Mise à jour du protocole dosimétrique de détermination des FOC dans les mini-faisceaux utilisés en radiothérapie[END_REF]10] for the dose level d, [-5, 5] mm for the two coordinates of the center of mass c, [15, 20] mm for the length l, [START_REF] Van Herk | Biologic and physical fractionation effects of random geometric errors[END_REF]15] mm for the width w and [-90, 90] degrees for the orientation α. The experiment was reproduced with several levels of multiplicative random Gaussian noise in the sinogram.

B. Real data

Preliminary data were measured using a scintillating fiber detector (SciFi) designed for the LHCb experiment [START_REF] Hochev | SciFi: a large scintillating fibre tracker for LHCb[END_REF]. The detector was irradiated with a 6 MV linear accelerator using a 30 × 30 mm 2 field. The scintillating signal at the detector's output was captured using a sCMOS camera achieving a 22 µm effective pixel resolution. The signal across the detector was averaged in the beam direction to yield a 1D projection. Several orientations were recorded by rotating the head of the linear accelerator in 30 or 15 degree steps. The estimation of the field was first realized assuming no penumbra. In a second step, we estimated the penumbra by using the σ value of a Gaussian convolution that yielded the best fit of the projections in the least squares sense with Nelder-Mead downhill simplex descent. Only the length and the width are reported since the position and the pixel values of the camera were not calibrated in this proof-of-concept.

IV. RESULTS

Table I demonstrates sub-millimetric estimation of the rectangle parameters even in the presence of noise.

) 0% 0.00 (0.02) -0.00 (0.01) -0.00 (0.03) 0.00 (0.04) -0.00 (0.02) 5% 0.00 (0.05) 0.00 (0.02) 0.00 (0.06) -0.00 (0.07) 0.01 (0.25) 10% 0.00 (0.10) 0.00 (0.04) 0.00 (0.11) -0.00 (0.12) -0.00 (0.50) 20% 0.01 (0.19) 0.00 (0.08) -0.01 (0.20) 0.00 (0.22) 0.01 (0.98) 50% 0.07 (0.56) -0.00 (0.19) -0.00 (0.48) -0.04 (0.55) -0.11 (2.41) Fig. 3 shows the 6 raw projections (30 degree step) before processing and after a 0.7 mm smoothing. They were used to estimate the parameters of the rectangle. The estimation gave l=31.7 mm and w=31.4 mm without penumbra and l=28.6 mm and w=28.3 mm with the estimated σ=4 mm penumbra. Using 12 projections (15 degree step), we improved the estimation with l=29.6 mm, w=29.2 mm and σ=3.4 mm, see Fig. 4.

V. DISCUSSION AND CONCLUSIONS

We have proposed a procedure for robust and accurate estimation of the parameters of a rectangular field from at least three projections. This approach is also much faster than iterative reconstruction algorithms used in previous similar works [START_REF] Goulet | High resolution 2D dose measurement device based on a few long scintillating fibers and tomographic reconstruction[END_REF]. Other shapes depending on a very few parameters could also be considered, e.g., disks, but the moment-based approach is probably not suited to more complex field shapes such as the ones obtained with multileaf collimators [START_REF] Soussen | Polygonal and polyhedral contour reconstruction in computed tomography[END_REF].

A proof-of-concept experiment demonstrated the accuracy of the method on real data. Improving the pre-processing of the measurements with flat field and dark field corrections and pre-characterizing the penumbra should also improve the quantification. For QA, the final result should be validated by comparing the estimated sinogram with the measurements as in Fig. 3

Fig. 1 . 1 Fig. 2 .

 112 Fig. 1. Schematic view of the QA system based on scintillating wave-guides (integrating the dose).

Fig. 3 .

 3 Fig. 3. Six measured and estimated profiles of a 30 × 30 mm 2 square field on a clinical linear accelerator. Top: smoothed data. Middle: projection profiles of the estimated square without a penumbra model. Down: projection profiles of the estimated square with a penumbra model

Fig. 4 .

 4 Fig. 4. Twelve measured and estimated profiles of a 30 × 30 mm 2 square field on a clinical linear accelerator. Top: smoothed data. Middle: projection profiles of the estimated square without a penumbra model. Down: projection profiles of the estimated square with a penumbra model

ACKNOWLEDGMENT

This work is supported by ITMO Cancer AVIESAN (Alliance Nationale pour les Sciences de la Vie et de la Santé, National Alliance for Life Sciences & Health) within the framework of the Cancer Plan.