contract TokenSalesInterface {

        struct SaleProxy {
                address payout;
                bool isProxy;
        }

        struct SaleStatus {
                bool founderClaim;
                uint256 releasedTokens;
                uint256 releasedBadges;
                uint256 claimers;
        }

        struct Info {
                uint256 totalWei;
                uint256 totalCents;
                uint256 realCents;
                uint256 amount;
        }

        struct SaleConfig {
                uint256 startDate;
                uint256 periodTwo;
                uint256 periodThree;
                uint256 endDate;
                uint256 goal;
                uint256 cap;
                uint256 badgeCost;
                uint256 founderAmount;
                address founderWallet;
        }

        struct Buyer {
                uint256 centsTotal;
                uint256 weiTotal;
                bool claimed;
        }

        Info saleInfo;
        SaleConfig saleConfig;
        SaleStatus saleStatus;

        address config;
        address owner;
        bool locked;

        uint256 public ethToCents;

        mapping(address => Buyer) buyers;
        mapping(address => SaleProxy) proxies;

        /// @notice Calculates the parts per billion 1⁄1,000,000,000 of `_a` to `_b`
        /// @param _a The antecedent
        /// @param _c The consequent
        /// @return Part per billion value
        function ppb(uint256 _a, uint256 _c) public constant returns(uint256 b);


        /// @notice Calculates the share from `_total` based on `_contrib`
        /// @param _contrib The contributed amount in USD
        /// @param _total The total amount raised in USD
        /// @return Total number of shares
        function calcShare(uint256 _contrib, uint256 _total) public constant returns(uint256 share);

        /// @notice Calculates the current USD cents value of `_wei`
        /// @param _wei the amount of wei
        /// @return The USD cents value
        function weiToCents(uint256 _wei) public constant returns(uint256 centsvalue);

        function proxyPurchase(address _user) returns(bool success);

        /// @notice Send msg.value purchase for _user.
        /// @param _user The account to be credited
        /// @return Success if purchase was accepted
        function purchase(address _user, uint256 _amount) private returns(bool success);

        /// @notice Get crowdsale information for `_user`
        /// @param _user The account to be queried
        /// @return `centstotal` the total amount of USD cents contributed
        /// @return `weitotal` the total amount in wei contributed
        /// @return `share` the current token shares earned
        /// @return `badges` the number of proposer badges earned
        /// @return `claimed` is true if the tokens and badges have been claimed
        function userInfo(address _user) public constant returns(uint256 centstotal, uint256 weitotal, uint256 share, uint badges, bool claimed);

        /// @notice Get the crowdsale information from msg.sender (see userInfo)
        function myInfo() public constant returns(uint256 centstotal, uint256 weitotal, uint256 share, uint badges, bool claimed);

        /// @notice get the total amount of wei raised for the crowdsale
        /// @return The amount of wei raised
        function totalWei() public constant returns(uint);

        /// @notice get the total USD value in cents raised for the crowdsale
        /// @return the amount USD cents
        function totalCents() public constant returns(uint);

        /// @notice get the current crowdsale information
        /// @return `startsale` The unix timestamp for the start of the crowdsale and the first period modifier
        /// @return `two` The unix timestamp for the start of the second period modifier
        /// @return `three` The unix timestamp for the start of the third period modifier
        /// @return `endsale` The unix timestamp of the end of crowdsale
        /// @return `totalwei` The total amount of wei raised
        /// @return `totalcents` The total number of USD cents raised
        /// @return `amount` The amount of DGD tokens available for the crowdsale
        /// @return `goal` The USD value goal for the crowdsale
        /// @return `famount` Founders endowment
        /// @return `faddress` Founder wallet address
        /*function getSaleInfo() public constant returns (uint256 startsale, uint256 two, uint256 three, uint256 endsale, uint256 totalwei, uint256 totalcents, uint256 amount, uint256 goal, uint256 famount, address faddress);*/

        function claimFor(address _user) returns(bool success);

        /// @notice Allows msg.sender to claim the DGD tokens and badges if the goal is reached or refunds the ETH contributed if goal is not reached at the end of the crowdsale
        function claim() returns(bool success);

        function claimFounders() returns(bool success);

        /// @notice See if the crowdsale goal has been reached
        function goalReached() public constant returns(bool reached);

        /// @notice Get the current sale period
        /// @return `saleperiod` 0 = Outside of the crowdsale period, 1 = First reward period, 2 = Second reward period, 3 = Final crowdsale period.
        function getPeriod() public constant returns(uint saleperiod);

        /// @notice Get the date for the start of the crowdsale
        /// @return `date` The unix timestamp for the start
        function startDate() public constant returns(uint date);

        /// @notice Get the date for the second reward period of the crowdsale
        /// @return `date` The unix timestamp for the second period
        function periodTwo() public constant returns(uint date);

        /// @notice Get the date for the final period of the crowdsale
        /// @return `date` The unix timestamp for the final period
        function periodThree() public constant returns(uint date);

        /// @notice Get the date for the end of the crowdsale
        /// @return `date` The unix timestamp for the end of the crowdsale
        function endDate() public constant returns(uint date);

        /// @notice Check if crowdsale has ended
        /// @return `ended` If the crowdsale has ended

        function isEnded() public constant returns(bool ended);

        /// @notice Send raised funds from the crowdsale to the DAO
        /// @return `success` if the send succeeded
        function sendFunds() public returns(bool success);

        //function regProxy(address _payment, address _payout) returns (bool success);
        function regProxy(address _payout) returns(bool success);

        function getProxy(address _payout) public returns(address proxy);

        function getPayout(address _proxy) public returns(address payout, bool isproxy);

        function unlock() public returns(bool success);

        function getSaleStatus() public constant returns(bool fclaim, uint256 reltokens, uint256 relbadges, uint256 claimers);

        function getSaleInfo() public constant returns(uint256 weiamount, uint256 cents, uint256 realcents, uint256 amount);

        function getSaleConfig() public constant returns(uint256 start, uint256 two, uint256 three, uint256 end, uint256 goal, uint256 cap, uint256 badgecost, uint256 famount, address fwallet);

        event Purchase(uint256 indexed _exchange, uint256 indexed _rate, uint256 indexed _cents);
        event Claim(address indexed _user, uint256 indexed _amount, uint256 indexed _badges);

}
function getPeriod() public constant returns(uint saleperiod);
/// @notice Get the current sale period
/// @return `saleperiod` 0 = Outside of the crowdsale period, 1 = First reward period, 2 = Second reward period, 3 = Final crowdsale period.