-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maximilian Meister <[email protected]>
- Loading branch information
1 parent
eaa31a2
commit ef3bf99
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
pragma solidity ^0.4.8; | ||
|
||
contract mortal { | ||
address public owner; | ||
|
||
function mortal() { | ||
owner = msg.sender; | ||
} | ||
|
||
modifier onlyOwner { | ||
if (msg.sender != owner) throw; | ||
_; | ||
} | ||
|
||
function kill() onlyOwner { | ||
suicide(owner); | ||
} | ||
} | ||
|
||
contract Blockshaper is mortal { | ||
mapping(address=>Video) public videos; | ||
|
||
event broadcasted(address from, string url); | ||
|
||
struct Video { | ||
string name; | ||
bool active; | ||
uint8 length; | ||
string webmUrl; | ||
uint lastUpdate; | ||
} | ||
|
||
function broadcast(address _userAddress, string _name, bool _active, uint8 _videoLength, string _webmUrl) { | ||
if (_userAddress != msg.sender) throw; | ||
videos[_userAddress] = Video({ | ||
name: _name, | ||
active: _active, | ||
length: _videoLength, | ||
webmUrl: _webmUrl, | ||
lastUpdate: now | ||
}); | ||
broadcasted(_userAddress, _webmUrl); | ||
} | ||
} |