@@ -830,6 +830,25 @@ are located in storage, even though they also have type ``uint[]``. However,
830
830
if ``d `` was assigned, we would need to clear knowledge about ``array `` and
831
831
vice-versa.
832
832
833
+ Contract Balance
834
+ ================
835
+
836
+ A contract may be deployed with funds sent to it, if ``msg.value `` > 0 in the
837
+ deployment transaction.
838
+ However, the contract's address may already have funds before deployment,
839
+ which are kept by the contract.
840
+ Therefore, the SMTChecker assumes that ``address(this).balance >= msg.value ``
841
+ in the constructor in order to be consistent with the EVM rules.
842
+ The contract's balance may also increase without triggering any calls to the
843
+ contract, if
844
+
845
+ - ``selfdestruct `` is executed by another contract with the analyzed contract
846
+ as the target of the remaining funds,
847
+ - the contract is the coinbase (i.e., ``block.coinbase ``) of some block.
848
+
849
+ To model this properly, the SMTChecker assumes that at every new transaction
850
+ the contract's balance may grow by at least ``msg.value ``.
851
+
833
852
**********************
834
853
Real World Assumptions
835
854
**********************
@@ -841,3 +860,7 @@ push: If the ``push`` operation is applied to an array of length 2^256 - 1, its
841
860
length silently overflows.
842
861
However, this is unlikely to happen in practice, since the operations required
843
862
to grow the array to that point would take billions of years to execute.
863
+ Another similar assumption taken by the SMTChecker is that an address' balance
864
+ can never overflow.
865
+
866
+ A similar idea was presented in `EIP-1985 <https://eips.ethereum.org/EIPS/eip-1985 >`_.
0 commit comments