Skip to content

Commit

Permalink
structure of a contract started
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Azoulay committed Oct 13, 2018
1 parent 63f3e9c commit 9e73d2e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/installing-solidity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Un exemple de pré-version : ``0.4.9-nightly.2017.1.17+commit.6ecb4aaa3.Emscript
Informations importantes concernant le versionnage
==================================================

Après la sortie d'une version, le niveau de version du correctif est incrémenté, parce que nous supposons que seulement les changements de niveau patch suivent. Lorsque les modifications sont fusionnées, la version doit être supprimée en fonction des éléments suivants et la gravité du changement. Enfin, une version est toujours basée sur la nigthly actuelle, mais sans le spécificateur ``prerelease``.
Après la sortie d'une version, la version de correctif est incrémentée, parce que nous supposons que seulement les changements de niveau patch suivent. Lorsque les modifications sont fusionnées, la version doit être supprimée en fonction des éléments suivants et la gravité du changement. Enfin, une version est toujours basée sur la nigthly actuelle, mais sans le spécificateur ``prerelease``.

Exemple :

Expand Down
51 changes: 20 additions & 31 deletions docs/structure-of-a-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,24 @@

.. _contract_structure:

***********************
Structure of a Contract
***********************
**********************
Structure d'un Contrat
**********************

Contracts in Solidity are similar to classes in object-oriented languages.
Each contract can contain declarations of :ref:`structure-state-variables`, :ref:`structure-functions`,
:ref:`structure-function-modifiers`, :ref:`structure-events`, :ref:`structure-struct-types` and :ref:`structure-enum-types`.
Furthermore, contracts can inherit from other contracts.
Les contrats dans Solidity sont similaires à des classes dans les langages orientés objet.
Chaque contrat peut contenir des déclarations de :ref:`structure-state-variables`, :ref:`structure-fonctions`, :ref:`structure-fonction-modificateurs`, :ref:`structure-events`, :ref:`structure-struct-types` et :ref:`structure-enum-types`.
De plus, les contrats peuvent hériter d'autres contrats.

There are also special kinds of contracts called :ref:`libraries<libraries>` and :ref:`interfaces<interfaces>`.
Il existe également des types de contrats spéciaux appelés :ref:`librairies<libraries>` et :ref:`interfaces<interfaces>`.

The section about :ref:`contracts<contracts>` contains more details than this section,
which serves to provide a quick overview.
La section sur les :ref:`contrats<contracts>` contient plus de détails que cette section, qui sert à donner un bref aperçu.

.. _structure-state-variables:

State Variables
===============
Variables d'État
================

State variables are variables whose values are permanently stored in contract
storage.
Les variables d'état sont des variables dont les valeurs sont stockées en permanence dans la mémoire du contrat.

::

Expand All @@ -33,38 +30,33 @@ storage.
// ...
}

See the :ref:`types` section for valid state variable types and
:ref:`visibility-and-getters` for possible choices for
visibility.
Voir la section :ref:`types` pour les types de variables d'état valides et :ref:`visibility-and-getters` pour les choix possibles de visibilité.

.. _structure-functions:

Functions
Fonctions
=========

Functions are the executable units of code within a contract.
Les fonctions sont les unités exécutables du code d'un contrat.

::

pragma solidity >=0.4.0 <0.6.0;

contract SimpleAuction {
function bid() public payable { // Function
function bid() public payable { // Fonction
// ...
}
}

:ref:`function-calls` can happen internally or externally
and have different levels of :ref:`visibility<visibility-and-getters>`
towards other contracts.
Les :ref:`function-calls` peuvent se produire en interne ou en externe et avoir différents niveaux de :ref:`visibilité<visibility-and-getters>` vers d'autres contrats.

.. _structure-function-modifiers:

Function Modifiers
==================

Function modifiers can be used to amend the semantics of functions in a declarative way
(see :ref:`modifiers` in the contracts section).
Function modifiers can be used to amend the semantics of functions in a declarative way (see :ref:`modifiers` in the contracts section).

::

Expand Down Expand Up @@ -106,16 +98,14 @@ Events are convenience interfaces with the EVM logging facilities.
}
}

See :ref:`events` in contracts section for information on how events are declared
and can be used from within a dapp.
See :ref:`events` in contracts section for information on how events are declared and can be used from within a dapp.

.. _structure-struct-types:

Struct Types
=============

Structs are custom defined types that can group several variables (see
:ref:`structs` in types section).
Structs are custom defined types that can group several variables (see :ref:`structs` in types section).

::

Expand All @@ -135,8 +125,7 @@ Structs are custom defined types that can group several variables (see
Enum Types
==========

Enums can be used to create custom types with a finite set of 'constant values' (see
:ref:`enums` in types section).
Enums can be used to create custom types with a finite set of 'constant values' (see :ref:`enums` in types section).

::

Expand Down

0 comments on commit 9e73d2e

Please sign in to comment.