mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
commit
ee0ba31c2b
@ -4,10 +4,10 @@
|
|||||||
Contracts
|
Contracts
|
||||||
##########
|
##########
|
||||||
|
|
||||||
Contracts in Solidity what classes are in object oriented languages.
|
Contracts in Solidity are what classes are in object oriented languages. They
|
||||||
They persistent data in state variables and functions that can modify these variables.
|
contain persistent data in state variables and functions that can modify these
|
||||||
Calling a function on a different contract (instance) will perform an EVM
|
variables. Calling a function on a different contract (instance) will perform
|
||||||
function call and thus switch the context such that state variables are
|
an EVM function call and thus switch the context such that state variables are
|
||||||
inaccessible.
|
inaccessible.
|
||||||
|
|
||||||
.. index:: ! contract;creation
|
.. index:: ! contract;creation
|
||||||
@ -184,10 +184,9 @@ return parameter list for functions.
|
|||||||
uint public data;
|
uint public data;
|
||||||
}
|
}
|
||||||
|
|
||||||
Other contracts can call `c.data()` to retrieve the value of
|
Other contracts can call `c.data()` to retrieve the value of data in state
|
||||||
data in state storage, but are not able to call `f`.
|
storage, but are not able to call `f`. Contracts derived from `c` can call
|
||||||
Contracts derived from `c` can call `setData` to alter the
|
`setData` to alter the value of `data` (but only in their own state).
|
||||||
value of `data` (but only in their own state).
|
|
||||||
|
|
||||||
.. index:: ! accessor;function, ! function;accessor
|
.. index:: ! accessor;function, ! function;accessor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user