{
    "contractName": "ITokenLocking",
    "abi": [
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "colonyNetwork",
                    "type": "address"
                }
            ],
            "name": "ColonyNetworkSet",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "token",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "lockCount",
                    "type": "uint256"
                }
            ],
            "name": "TokenLocked",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "token",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "user",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "lockId",
                    "type": "uint256"
                }
            ],
            "name": "UserTokenUnlocked",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "token",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "user",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "amount",
                    "type": "uint256"
                },
                {
                    "indexed": false,
                    "name": "timestamp",
                    "type": "uint256"
                }
            ],
            "name": "UserTokenDeposited",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "token",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "user",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "amount",
                    "type": "uint256"
                }
            ],
            "name": "UserTokenWithdrawn",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "name": "miner",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "beneficiary",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "name": "tokensLost",
                    "type": "uint256"
                }
            ],
            "name": "ReputationMinerPenalised",
            "type": "event"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_colonyNetwork",
                    "type": "address"
                }
            ],
            "name": "setColonyNetwork",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [],
            "name": "getColonyNetwork",
            "outputs": [
                {
                    "name": "networkAddress",
                    "type": "address"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                }
            ],
            "name": "lockToken",
            "outputs": [
                {
                    "name": "lockCount",
                    "type": "uint256"
                }
            ],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                },
                {
                    "name": "_user",
                    "type": "address"
                },
                {
                    "name": "_lockId",
                    "type": "uint256"
                }
            ],
            "name": "unlockTokenForUser",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                },
                {
                    "name": "_lockId",
                    "type": "uint256"
                }
            ],
            "name": "incrementLockCounterTo",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                },
                {
                    "name": "_amount",
                    "type": "uint256"
                }
            ],
            "name": "deposit",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                },
                {
                    "name": "_amount",
                    "type": "uint256"
                }
            ],
            "name": "withdraw",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "name": "_stakers",
                    "type": "address[]"
                },
                {
                    "name": "_beneficiary",
                    "type": "address"
                },
                {
                    "name": "_amount",
                    "type": "uint256"
                }
            ],
            "name": "punishStakers",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                }
            ],
            "name": "getTotalLockCount",
            "outputs": [
                {
                    "name": "lockCount",
                    "type": "uint256"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "name": "_token",
                    "type": "address"
                },
                {
                    "name": "_user",
                    "type": "address"
                }
            ],
            "name": "getUserLock",
            "outputs": [
                {
                    "components": [
                        {
                            "name": "lockCount",
                            "type": "uint256"
                        },
                        {
                            "name": "balance",
                            "type": "uint256"
                        },
                        {
                            "name": "timestamp",
                            "type": "uint256"
                        }
                    ],
                    "name": "lock",
                    "type": "tuple"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        }
    ],
    "devdoc": {
        "methods": {
            "deposit(address,uint256)": {
                "params": {
                    "_amount": "Amount to deposit",
                    "_token": "Address of the token to deposit"
                }
            },
            "getColonyNetwork()": {
                "return": "networkAddress ColonyNetwork address"
            },
            "getTotalLockCount(address)": {
                "params": {
                    "_token": "Address of the token"
                },
                "return": "lockCount Global token lock count"
            },
            "getUserLock(address,address)": {
                "params": {
                    "_token": "Address of the token",
                    "_user": "Address of the user"
                },
                "return": "lock Lock object containing:   `lockCount` User's token lock count,   `amount` User's deposited amount,   `timestamp` Timestamp of deposit."
            },
            "incrementLockCounterTo(address,uint256)": {
                "params": {
                    "_lockId": "Id of the lock user wants to increment to",
                    "_token": "Address of the token we want to increment lock count for"
                }
            },
            "lockToken(address)": {
                "params": {
                    "_token": "Address of the token we want to lock"
                },
                "return": "lockCount Updated total token lock count"
            },
            "punishStakers(address[],address,uint256)": {
                "details": "While public, it can only be called successfully by the current ReputationMiningCycle.",
                "params": {
                    "_amount": "Amount of stake to slash",
                    "_beneficiary": "Address of beneficiary to receive forfeited stake",
                    "_stakers": "Array of the addresses of stakers to punish"
                }
            },
            "setColonyNetwork(address)": {
                "details": "ColonyNetwork is used for checking if sender is a colony created on colony network.",
                "params": {
                    "_colonyNetwork": "Address of the ColonyNetwork"
                }
            },
            "unlockTokenForUser(address,address,uint256)": {
                "params": {
                    "_lockId": "Id of the lock we want to increment to",
                    "_token": "Address of the token we want to unlock",
                    "_user": "Address of the user"
                }
            },
            "withdraw(address,uint256)": {
                "params": {
                    "_amount": "Amount to withdraw",
                    "_token": "Address of the token to withdraw from"
                }
            }
        }
    },
    "userdoc": {
        "methods": {
            "deposit(address,uint256)": {
                "notice": "Deposit `_amount` of colony tokens. Can only be called if user tokens are not locked. Before calling this function user has to allow that their tokens can be transferred by token locking contract."
            },
            "getColonyNetwork()": {
                "notice": "Get ColonyNetwork address."
            },
            "getTotalLockCount(address)": {
                "notice": "Get global lock count for a specific token."
            },
            "getUserLock(address,address)": {
                "notice": "Get user token lock info (lock count and deposited amount)."
            },
            "incrementLockCounterTo(address,uint256)": {
                "notice": "Increments sender's lock count to `_lockId`."
            },
            "lockToken(address)": {
                "notice": "Locks everyones' tokens on `_token` address."
            },
            "punishStakers(address[],address,uint256)": {
                "notice": "Function called to punish people who staked against a new reputation root hash that turned out to be incorrect."
            },
            "setColonyNetwork(address)": {
                "notice": "Set the ColonyNetwork contract address."
            },
            "unlockTokenForUser(address,address,uint256)": {
                "notice": "Increments the lock counter to `_lockId` for the `_user` if user's lock count is less than `_lockId` by 1. Can only be called by a colony."
            },
            "withdraw(address,uint256)": {
                "notice": "Withdraw `_amount` of deposited tokens. Can only be called if user tokens are not locked."
            }
        }
    }
}