Jason Stallings
Jay Hill
Nick McDonnough
Jason Noble
A distributed, public ledger of transactions stored in immutable, increments called "blocks." In order to create a block, a computational challenge must be completed which is time consuming to compute, but quick to verify. The process of generating new blocks is called "mining." Each block contains data that represents a set of transactions.
Builds on the ideas of the Bitcoin blockchain and adds the Ethereum Virtual Machine (EVM) which allows smart contracts to be stored on the blockchain and executed as transactions.
pragma solidity ^0.4.4;
contract Blog {
address owner;
// Constructor.
function Blog() { owner = msg.sender; }
// Function to kill the contract.
function kill() { if (msg.sender == owner) selfdestruct(owner); }
struct BlogPost {
bytes32 title;
// Dynamic length strings are hard in Solidity, so we have to use a byte array.
bytes32[32] content;
address author;
}
BlogPost[] public BlogPosts;
function addBlogPost(bytes32 title, bytes32[32] content) public returns (uint) {
return BlogPosts.push(BlogPost(title, content, msg.sender)) - 1;
}
function getBlogPostsCount() public constant returns(uint) {
return BlogPosts.length;
}
function getBlogPostTitle(uint index) public returns(bytes32) {
return BlogPosts[index].title;
}
function getBlogPostContent(uint index) public returns(bytes32[32]) {
return BlogPosts[index].content;
}
function getBlogPostAuthor(uint index) public returns(address) {
return BlogPosts[index].author;
}
}
100% coverage!
InterPlanetary FileSystem - https://ipfs.io/
IPFS is a distributed file system that seeks to connect all computing devices with the same system of files. In some ways, this is similar to the original aims of the Web, but IPFS is actually more similar to a single bittorrent swarm exchanging git objects.
React.js application built with TypeScript that interacts with our Ethereum smart contract, implemented in Solidity using the truffle framework.