mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add "pragma solidity ^0.4.0;" to code examples
This commit is contained in:
@@ -51,6 +51,8 @@ complete contract):
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.0;
|
||||
|
||||
// THIS CONTRACT CONTAINS A BUG - DO NOT USE
|
||||
contract Fund {
|
||||
/// Mapping of ether shares of the contract.
|
||||
@@ -73,6 +75,8 @@ outlined further below:
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.0;
|
||||
|
||||
contract Fund {
|
||||
/// Mapping of ether shares of the contract.
|
||||
mapping(address => uint) shares;
|
||||
@@ -149,6 +153,8 @@ Never use tx.origin for authorization. Let's say you have a wallet contract like
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.0;
|
||||
|
||||
contract TxUserWallet {
|
||||
address owner;
|
||||
|
||||
@@ -166,6 +172,8 @@ Now someone tricks you into sending ether to the address of this attack wallet:
|
||||
|
||||
::
|
||||
|
||||
pragma solidity ^0.4.0;
|
||||
|
||||
contract TxAttackWallet {
|
||||
address owner;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user