function unlock(address addr, uint index) public {
        require(addr == msg.sender);
        
        var lock = lockRecordMap[addr][index];
        require(lock.amount > 0 && !lock.completed);

        var during = now - lock.time;
        var reward = _calcReward(during, lock.amount);

        token t = token(tokenAddr);
        t.transferFrom(owner, addr, lock.amount + reward);

        lock.completed = true;

        Unlock(addr, index, lock.amount, reward);        
    }