Commit e8d5b0a0 authored by Jared Pereira's avatar Jared Pereira

add contracts

parent fea58462
pragma solidity ^0.4.16;
interface Room {
function getPermissions(address) constant returns(bytes32);
}
contract univeralRoom is Room{
function getPermissions(address) constant returns (bytes32) {
return (0x1);
}
}
pragma solidity ^0.4.16;
import './Room.sol';
contract Token{
mapping (address => uint256) balances;
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
contract TokenRoom is Room {
Token token;
uint threshold;
function tokenRoom(address _token, uint _threshold){
token = Token(_token);
threshold = _threshold;
}
function getPermissions(address user) constant returns(bytes32){
if(token.balanceOf(user) >= threshold) {
return (0x1);
}
else{
return (0x0);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment