diff --git a/contracts/DReddit.sol b/contracts/DReddit.sol new file mode 100644 index 0000000..0da55e4 --- /dev/null +++ b/contracts/DReddit.sol @@ -0,0 +1,22 @@ +pragma solidity ^0.5.0; + +contract DReddit { + + struct Post { + uint creationDate; + bytes description; + address owner; + } + + Post [] public posts; + + function createPost(bytes memory _description) public { + uint postId = posts.length++; + posts[postId] = Post({ + creationDate: block.timestamp, + description: _description, + owner: msg.sender + }); + } +} +