Skip to content

Instantly share code, notes, and snippets.

@noman-land
Last active September 19, 2018 19:46
Show Gist options
  • Save noman-land/64db658bbfa15c1d487ea1544c8e2d88 to your computer and use it in GitHub Desktop.
Save noman-land/64db658bbfa15c1d487ea1544c8e2d88 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.24;
contract IdeaRegistry {
struct Idea {
address owner;
uint[] links;
}
mapping(uint => Idea) registry;
function registerIdea(uint ideaHash, uint[] links) public {
require(registry[ideaHash].owner == address(0));
registry[ideaHash] = Idea(msg.sender, links);
}
function getIdea(uint ideaId) public view returns(uint[]) {
return registry[ideaId].links;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment