From 0e864467deb17f3b3ecb77d434ade46156a8ed50 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 20 May 2019 15:04:00 +0200 Subject: [PATCH] [Docs] Better explain the modular approach. --- docs/examples/modular.rst | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/examples/modular.rst b/docs/examples/modular.rst index ebde40592..928d473bc 100644 --- a/docs/examples/modular.rst +++ b/docs/examples/modular.rst @@ -4,10 +4,18 @@ Modular Contracts ***************** -A modular approach to building your contracts helps you prevent overflow risks -and unexpected tokens. In the example below, the contract uses the ``move`` method +A modular approach to building your contracts helps you reduce the complexity +and improve the readability which will help to identify bugs and vulnerabilities +during development and code review. +If you specify and control the behaviour or each module in isolation, the +interactions you have to consider are only those between the module specifications +and not every other moving part of the contract. +In the example below, the contract uses the ``move`` method of the ``Balances`` :ref:`library ` to check that balances sent between -addresses match what you expect. +addresses match what you expect. In this way, the ``Balances`` library +provides an isolated component that properly tracks balances of accounts. +It is easy to verify that the ``Balances`` library never produces negative balances or overflows +and the sum of all balances is an invariant across the lifetime of the contract. ::