contract depositofferTokenAbstract
{
// TODO comment events

// Logged when funder exceeds the KYC limit
    event KYCAddress(address indexed _addr, bool indexed _kyc);

// Logged upon refund
    event Refunded(address indexed _addr, uint indexed _value);

// Logged when new owner accepts ownership
    event ChangedOwner(address indexed _from, address indexed _to);
    
// Logged when owner initiates a change of ownership
    event ChangeOwnerTo(address indexed _to);

// Logged when ICO ether funds are transferred to an address
    event FundsTransferred(address indexed _wallet, uint indexed _value);


    // This fuse blows upon calling abort() which forces a fail state
    bool public __abortFuse = true;
    
    // Set to true after the fund is swept to the fund wallet, allows token
    // transfers and prevents abort()
    bool public icoSuccessful;

    // Token conversion factors are calculated with decimal places at parity with ether
    uint8 public constant decimals = 18;

    // An address authorised to take ownership
    address public newOwner;
    
    // The deposito smart contract address
    address public deposito;
    
    // Total ether raised during funding
    uint public etherRaised;
    
    // Preauthorized tranch discount addresses
    // holder => discount
    mapping (address => bool) public kycAddresses;
    
    // Record of ether paid per address
    mapping (address => uint) public etherContributed;

    // Return `true` if MIN_FUNDS were raised
    function fundSucceeded() public constant returns (bool);
    
    // Return `true` if MIN_FUNDS were not raised before END_DATE
    function fundFailed() public constant returns (bool);

    // Returns USD raised for set ETH/USD rate
    function usdRaised() public constant returns (uint);

    // Returns an amount in eth equivilent to USD at the set rate
    function usdToEth(uint) public constant returns(uint);
    
    // Returns the USD value of ether at the set USD/ETH rate
    function ethToUsd(uint _wei) public constant returns (uint);

    // Returns token/ether conversion given ether value and address. 
    function ethToTokens(uint _eth)
        public constant returns (uint);

    // Processes a token purchase for a given address
    function proxyPurchase(address _addr) payable returns (bool);

    // Owner can move funds of successful fund to fundWallet 
    function finaliseICO() public returns (bool);
    
    // Registers a discounted address
    function addKycAddress(address _addr, bool _kyc)
        public returns (bool);

    // Refund on failed or aborted sale 
    function refund(address _addr) public returns (bool);

    // To cancel token sale prior to START_DATE
    function abort() public returns (bool);
    
    // Change the deposito backend contract address
    function changedeposito(address _addr) public returns (bool);
    
    // For owner to salvage tokens sent to contract
    function transferAnyERC20Token(address tokenAddress, uint amount)
        returns (bool);
}
/*-----------------------------------------------------------------------------\
 
 ## Conditional Entry Table
 
 Functions must throw on F conditions
 
 Conditional Entry Table (functions must throw on F conditions)
 
 renetry prevention on all public mutating functions
 Reentry mutex set in moveFundsToWallet(), refund()
 
 |function                |<START_DATE|<END_DATE |fundFailed  |fundSucceeded|icoSucceeded
 |------------------------|:---------:|:--------:|:----------:|:-----------:|:---------:|
 |()                      |KYC        |T         |F           |T            |F          |
 |abort()                 |T          |T         |T           |T            |F          |
 |proxyPurchase()         |KYC        |T         |F           |T            |F          |
 |addKycAddress()         |T          |T         |F           |T            |T          |
 |finaliseICO()           |F          |F         |F           |T            |T          |
 |refund()                |F          |F         |T           |F            |F          |
 |transfer()              |F          |F         |F           |F            |T          |
 |transferFrom()          |F          |F         |F           |F            |T          |
 |approve()               |F          |F         |F           |F            |T          |
 |changeOwner()           |T          |T         |T           |T            |T          |
 |acceptOwnership()       |T          |T         |T           |T            |T          |
 |changedeposito()          |T          |T         |T           |T            |T          |
 |destroy()               |F          |F         |!__abortFuse|F            |F          |
 |transferAnyERC20Tokens()|T          |T         |T           |T            |T          |
 
 \*----------------------------------------------------------------------------*/
function fundFailed() public constant returns (bool);

// Return `true` if MIN_FUNDS were not raised before END_DATE