-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.sol
More file actions
32 lines (25 loc) · 813 Bytes
/
Transaction.sol
File metadata and controls
32 lines (25 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pragma solidity ^0.4.9;
contract Transaction {
// each contract has an ethereum address - it can be found with: address(this)
event SenderLogger(address);
event ValueLogger(uint);
address private owner;
modifier isOwner {
require(owner==msg.sender);
_;
}
modifier validValue {
require(msg.value >= 1);
_;
}
function Transaction() {
owner = msg.sender;
}
//payable is a modifier that can be added to any function
//payable is a reserved keyword that allows a contract to receive ether
// a contract can have exactly one unnamed function, it is default executed if contract is called w no parms
function () payable isOwner validValue {
SenderLogger(msg.sender);
ValueLogger(msg.value);
}
}