{ "contractName": "ITokenLocking", "abi": [ { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "colonyNetwork", "type": "address" } ], "name": "ColonyNetworkSet", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "token", "type": "address" }, { "indexed": true, "internalType": "address", "name": "lockedBy", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "lockCount", "type": "uint256" } ], "name": "TokenLocked", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "UserTokenClaimed", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "UserTokenDeposited", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "address", "name": "recipient", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "UserTokenTransferred", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "lockId", "type": "uint256" } ], "name": "UserTokenUnlocked", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "user", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "UserTokenWithdrawn", "type": "event" }, { "inputs": [ { "internalType": "address", "name": "_colonyNetwork", "type": "address" } ], "name": "setColonyNetwork", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "getColonyNetwork", "outputs": [ { "internalType": "address", "name": "networkAddress", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" } ], "name": "lockToken", "outputs": [ { "internalType": "uint256", "name": "lockCount", "type": "uint256" } ], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_lockId", "type": "uint256" } ], "name": "unlockTokenForUser", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_lockId", "type": "uint256" } ], "name": "incrementLockCounterTo", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "bool", "name": "_force", "type": "bool" } ], "name": "deposit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "deposit", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_recipient", "type": "address" } ], "name": "depositFor", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_recipient", "type": "address" }, { "internalType": "bool", "name": "_force", "type": "bool" } ], "name": "transfer", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "bool", "name": "_force", "type": "bool" } ], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_recipient", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "reward", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_token", "type": "address" } ], "name": "approveStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_token", "type": "address" } ], "name": "obligateStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_token", "type": "address" } ], "name": "deobligateStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" }, { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_recipient", "type": "address" } ], "name": "transferStake", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" } ], "name": "getTotalLockCount", "outputs": [ { "internalType": "uint256", "name": "lockCount", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_user", "type": "address" } ], "name": "getUserLock", "outputs": [ { "components": [ { "internalType": "uint256", "name": "lockCount", "type": "uint256" }, { "internalType": "uint256", "name": "balance", "type": "uint256" }, { "internalType": "uint256", "name": "DEPRECATED_timestamp", "type": "uint256" }, { "internalType": "uint256", "name": "pendingBalance", "type": "uint256" } ], "internalType": "struct TokenLockingDataTypes.Lock", "name": "lock", "type": "tuple" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_token", "type": "address" } ], "name": "getTotalObligation", "outputs": [ { "internalType": "uint256", "name": "obligation", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_obligator", "type": "address" } ], "name": "getApproval", "outputs": [ { "internalType": "uint256", "name": "approval", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_user", "type": "address" }, { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_obligator", "type": "address" } ], "name": "getObligation", "outputs": [ { "internalType": "uint256", "name": "approval", "type": "uint256" } ], "stateMutability": "view", "type": "function" } ], "devdoc": { "kind": "dev", "methods": { "approveStake(address,uint256,address)": { "details": "Can only be called by a colony or colonyNetwork", "params": { "_amount": "Amount of that colony's internal token up to which we are willing to be obligated.", "_token": "The colony's internal token address", "_user": "Address of the user that is allowing their holdings to be staked by the caller" } }, "deobligateStake(address,uint256,address)": { "params": { "_amount": "Amount of colony's internal token we are deobligating.", "_token": "The colony's internal token address", "_user": "Address of the account we are deobligating." } }, "deposit(address,uint256)": { "params": { "_amount": "Amount to deposit", "_token": "Address of the token to deposit" } }, "deposit(address,uint256,bool)": { "params": { "_amount": "Amount to deposit", "_force": "Pass true to forcibly unlock the token", "_token": "Address of the token to deposit" } }, "depositFor(address,uint256,address)": { "params": { "_amount": "Amount to deposit", "_recipient": "User to receive the tokens", "_token": "Address of the token to deposit" } }, "getApproval(address,address,address)": { "params": { "_obligator": "The address that has been approved to obligate the funds.", "_token": "The token for which the user has provided the approval.", "_user": "Address of the account that has approved _approvee to obligate their funds." }, "returns": { "approval": "The total amount for this obligation" } }, "getColonyNetwork()": { "returns": { "networkAddress": "ColonyNetwork address" } }, "getObligation(address,address,address)": { "params": { "_obligator": "The address that obligated the funds (and therefore can slash or return them).", "_token": "The token for which the user has provided the approval.", "_user": "Address of the account that has had their funds obligated." }, "returns": { "approval": "The total amount for this obligation" } }, "getTotalLockCount(address)": { "params": { "_token": "Address of the token" }, "returns": { "lockCount": "Global token lock count" } }, "getTotalObligation(address,address)": { "params": { "_token": "The token for which the user is obligated.", "_user": "Address of the obligated account." }, "returns": { "obligation": "The total amount this user is obligated" } }, "getUserLock(address,address)": { "params": { "_token": "Address of the token", "_user": "Address of the user" }, "returns": { "lock": "Lock object containing: `lockCount` User's token lock count, `balance` User's deposited amount, `DEPRECATED_timestamp` Timestamp of deposit (deprecated) `pendingBalance` Tokens that have been sent to them, but are inaccessible until all locks are cleared and then these tokens are claimed" } }, "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" }, "returns": { "lockCount": "Updated total token lock count" } }, "obligateStake(address,uint256,address)": { "params": { "_amount": "Amount of the colony's internal token we are obligating.", "_token": "The colony's internal token address", "_user": "Address of the account we are obligating." } }, "reward(address,uint256)": { "details": "It's a NOOP. You don't need to call this, and if you write a contract that does it will break in the future.", "params": { "_amount": "The amount to reward", "_recipient": "The address to receive the reward" } }, "setColonyNetwork(address)": { "details": "ColonyNetwork is used for checking if sender is a colony created on colony network.", "params": { "_colonyNetwork": "Address of the ColonyNetwork" } }, "transfer(address,uint256,address,bool)": { "params": { "_amount": "Amount to transfer", "_force": "Pass true to forcibly unlock the token", "_recipient": "User to receive the tokens", "_token": "Address of the token to transfer" } }, "transferStake(address,uint256,address,address)": { "params": { "_amount": "Amount of colony's internal token we are taking.", "_recipient": "Recipient of the slashed tokens", "_token": "The colony's internal token address", "_user": "Address of the account we are taking." } }, "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" } }, "withdraw(address,uint256,bool)": { "params": { "_amount": "Amount to withdraw", "_force": "Pass true to forcibly unlock the token", "_token": "Address of the token to withdraw from" } } }, "version": 1 }, "userdoc": { "kind": "user", "methods": { "approveStake(address,uint256,address)": { "notice": "Allow the colony to obligate some amount of tokens as a stake." }, "deobligateStake(address,uint256,address)": { "notice": "Deobligate the user some amount of tokens, releasing the stake. Can only be called by a colony or colonyNetwork." }, "deposit(address,uint256)": { "notice": "DEPRECATED Deposit `_amount` of deposited 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." }, "deposit(address,uint256,bool)": { "notice": "Deposit `_amount` of colony tokens. Before calling this function user has to allow that their tokens can be transferred by token locking contract." }, "depositFor(address,uint256,address)": { "notice": "Deposit `_amount` of colony tokens in the recipient's account. Goes into pendingBalance if token is locked." }, "getApproval(address,address,address)": { "notice": "See how much an address has approved another address to obligate on their behalf." }, "getColonyNetwork()": { "notice": "Get ColonyNetwork address." }, "getObligation(address,address,address)": { "notice": "See how much a user is currently obligated by another." }, "getTotalLockCount(address)": { "notice": "Get global lock count for a specific token." }, "getTotalObligation(address,address)": { "notice": "See the total amount of a user's obligation." }, "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." }, "obligateStake(address,uint256,address)": { "notice": "Obligate the user some amount of tokens as a stake. Can only be called by a colony or colonyNetwork." }, "reward(address,uint256)": { "notice": "This function is deprecated and only exists to aid upgrades." }, "setColonyNetwork(address)": { "notice": "Set the ColonyNetwork contract address." }, "transfer(address,uint256,address,bool)": { "notice": "Transfer tokens to a recipient's pending balance. Can only be called if user tokens are not locked." }, "transferStake(address,uint256,address,address)": { "notice": "Transfer some amount of staked tokens. Can only be called by a colony or colonyNetwork." }, "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": "DEPRECATED Withdraw `_amount` of deposited tokens. Can only be called if user tokens are not locked." }, "withdraw(address,uint256,bool)": { "notice": "Withdraw `_amount` of deposited tokens. Can only be called if user tokens are not locked." } }, "version": 1 } }