Honey Locker
What is it?
This allows teams and users to lock their liquidity, forever or not, without having to renounce the benefits they yield through staking them into various protocols. A new locker is deployed for each user. Lockers accept multiple LP deposits, or users can choose to create multiple lockers to segregate deposits.
Interface
interface IHoneyLocker {
/// @notice Initializes the HoneyLocker contract
/// @param _owner The address of the contract owner
/// @param _honeyQueen The address of the HoneyQueen contract
/// @param _referral The address for referral
/// @param _unlocked Whether the contract should enforce restrictions
function initialize(address _owner, address _honeyQueen, address _referral, bool _unlocked) external;
/// @notice Executes a wildcard function call to an allowed target contract
/// @param _contract The address of the target contract
/// @param data The calldata for the function call
function wildcard(address _contract, bytes calldata data) external;
/// @notice Stakes LP tokens in a staking contract
/// @param _LPToken The address of the LP token
/// @param _stakingContract The address of the staking contract
/// @param _amount The amount of LP tokens to stake
/// @param data The calldata for the stake function
function stake(address _LPToken, address _stakingContract, uint256 _amount, bytes memory data) external;
/// @notice Unstakes LP tokens from a staking contract
/// @param _LPToken The address of the LP token
/// @param _stakingContract The address of the staking contract
/// @param _amount The amount of LP tokens to unstake
/// @param data The calldata for the unstake function
function unstake(address _LPToken, address _stakingContract, uint256 _amount, bytes memory data) external;
/// @notice Burns BGT tokens for BERA and withdraws BERA
/// @param _amount The amount of BGT to burn
function burnBGTForBERA(uint256 _amount) external;
/// @notice Withdraws LP tokens after expiration
/// @param _LPToken The address of the LP token
/// @param _amount The amount of LP tokens to withdraw
function withdrawLPToken(address _LPToken, uint256 _amount) external;
/// @notice Migrates LP tokens to a new HoneyLocker
/// @param _LPTokens An array of LP token addresses
/// @param _amountsOrIds An array of amounts or IDs corresponding to the LP tokens
/// @param _newHoneyLocker The address of the new HoneyLocker
function migrate(address[] calldata _LPTokens, uint256[] calldata _amountsOrIds, address payable _newHoneyLocker) external;
/// @notice Claims rewards from a staking contract
/// @param _stakingContract The address of the staking contract
/// @param data The calldata for the claim rewards function
function claimRewards(address _stakingContract, bytes memory data) external;
/// @notice Deposits and locks LP tokens
/// @param _LPToken The address of the LP token
/// @param _amountOrId The amount or ID of the LP token
/// @param _expiration The expiration timestamp for the lock
function depositAndLock(address _LPToken, uint256 _amountOrId, uint256 _expiration) external;
/// @notice Delegates BGT tokens to a validator
/// @param _amount The amount of BGT to delegate
/// @param _validator The address of the validator
function delegateBGT(uint128 _amount, address _validator) external;
/// @notice Cancels a queued boost for BGT delegation
/// @param _amount The amount of BGT to cancel
/// @param _validator The address of the validator
function cancelQueuedBoost(uint128 _amount, address _validator) external;
/// @notice Drops a boost for BGT delegation
/// @param _amount The amount of BGT to drop
/// @param _validator The address of the validator
function dropBoost(uint128 _amount, address _validator) external;
/// @notice Withdraws BERA from the contract
/// @param _amount The amount of BERA to withdraw
function withdrawBERA(uint256 _amount) external;
/// @notice Withdraws ERC20 tokens from the contract
/// @param _token The address of the ERC20 token
/// @param _amount The amount of tokens to withdraw
function withdrawERC20(address _token, uint256 _amount) external;
/// @notice Withdraws ERC721 tokens from the contract
/// @param _token The address of the ERC721 token
/// @param _id The ID of the token to withdraw
function withdrawERC721(address _token, uint256 _id) external;
/// @notice Withdraws ERC1155 tokens from the contract
/// @param _token The address of the ERC1155 token
/// @param _id The ID of the token to withdraw
/// @param _amount The amount of tokens to withdraw
/// @param data Additional data for the transfer
function withdrawERC1155(address _token, uint256 _id, uint256 _amount, bytes calldata data) external;
/// @notice Activates a boost for a validator
/// @param _validator The address of the validator
function activateBoost(address _validator) external;
}
ABI
Show
[
{ "type": "receive", "stateMutability": "payable" },
{
"type": "function",
"name": "activateBoost",
"inputs": [
{ "name": "_validator", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "burnBGTForBERA",
"inputs": [
{ "name": "_amount", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "cancelOwnershipHandover",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "cancelQueuedBoost",
"inputs": [
{ "name": "_amount", "type": "uint128", "internalType": "uint128" },
{ "name": "_validator", "type": "address", "internalType": "addrews" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "claimRewards",
"inputs": [
{
"name": "_stakingContract",
"type": "address",
"internalType": "address"
},
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "completeOwnershipHandover",
"inputs": [
{ "name": "pendingOwner", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "delegateBGT",
"inputs": [
{ "name": "_amount", "type": "uint128", "internalType": "uint128" },
{ "name": "_validator", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "depositAndLock",
"inputs": [
{ "name": "_LPToken", "type": "address", "internalType": "address" },
{ "name": "_amountOrId", "type": "uint256", "internalType": "uint256" },
{ "name": "_expiration", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "dropBoost",
"inputs": [
{ "name": "_amount", "type": "uint128", "internalType": "uint128" },
{ "name": "_validator", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "expirations",
"inputs": [
{ "name": "LPToken", "type": "address", "internalType": "address" }
],
"outputs": [
{ "name": "expiration", "type": "uint256", "internalType": "uint256" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "initialize",
"inputs": [
{ "name": "_owner", "type": "address", "internalType": "address" },
{ "name": "_honeyQueen", "type": "address", "internalType": "address" },
{ "name": "_referral", "type": "address", "internalType": "address" },
{ "name": "_unlocked", "type": "bool", "internalType": "bool" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "isERC721",
"inputs": [
{ "name": "_token", "type": "address", "internalType": "address" }
],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "migrate",
"inputs": [
{
"name": "_LPTokens",
"type": "address[]",
"internalType": "address[]"
},
{
"name": "_amountsOrIds",
"type": "uint256[]",
"internalType": "uint256[]"
},
{
"name": "_newHoneyLocker",
"type": "address",
"internalType": "address payable"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "onERC1155BatchReceived",
"inputs": [
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "uint256[]", "internalType": "uint256[]" },
{ "name": "", "type": "uint256[]", "internalType": "uint256[]" },
{ "name": "", "type": "bytes", "internalType": "bytes" }
],
"outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }],
"stateMutability": "pure"
},
{
"type": "function",
"name": "onERC1155Received",
"inputs": [
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "uint256", "internalType": "uint256" },
{ "name": "", "type": "uint256", "internalType": "uint256" },
{ "name": "", "type": "bytes", "internalType": "bytes" }
],
"outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }],
"stateMutability": "pure"
},
{
"type": "function",
"name": "onERC721Received",
"inputs": [
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "address", "internalType": "address" },
{ "name": "", "type": "uint256", "internalType": "uint256" },
{ "name": "", "type": "bytes", "internalType": "bytes" }
],
"outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }],
"stateMutability": "pure"
},
{
"type": "function",
"name": "owner",
"inputs": [],
"outputs": [
{ "name": "result", "type": "address", "internalType": "address" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "ownershipHandoverExpiresAt",
"inputs": [
{ "name": "pendingOwner", "type": "address", "internalType": "address" }
],
"outputs": [
{ "name": "result", "type": "uint256", "internalType": "uint256" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "referral",
"inputs": [],
"outputs": [{ "name": "", "type": "address", "internalType": "address" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "renounceOwnership",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "requestOwnershipHandover",
"inputs": [],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "stake",
"inputs": [
{ "name": "_LPToken", "type": "address", "internalType": "address" },
{
"name": "_stakingContract",
"type": "address",
"internalType": "address"
},
{ "name": "_amount", "type": "uint256", "internalType": "uint256" },
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "staked",
"inputs": [
{ "name": "LPToken", "type": "address", "internalType": "address" },
{
"name": "stakingContract",
"type": "address",
"internalType": "address"
}
],
"outputs": [
{ "name": "balance", "type": "uint256", "internalType": "uint256" }
],
"stateMutability": "view"
},
{
"type": "function",
"name": "transferOwnership",
"inputs": [
{ "name": "newOwner", "type": "address", "internalType": "address" }
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "function",
"name": "unlocked",
"inputs": [],
"outputs": [{ "name": "", "type": "bool", "internalType": "bool" }],
"stateMutability": "view"
},
{
"type": "function",
"name": "unstake",
"inputs": [
{ "name": "_LPToken", "type": "address", "internalType": "address" },
{
"name": "_stakingContract",
"type": "address",
"internalType": "address"
},
{ "name": "_amount", "type": "uint256", "internalType": "uint256" },
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "wildcard",
"inputs": [
{ "name": "_contract", "type": "address", "internalType": "address" },
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawBERA",
"inputs": [
{ "name": "_amount", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawERC1155",
"inputs": [
{ "name": "_token", "type": "address", "internalType": "address" },
{ "name": "_id", "type": "uint256", "internalType": "uint256" },
{ "name": "_amount", "type": "uint256", "internalType": "uint256" },
{ "name": "data", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawERC20",
"inputs": [
{ "name": "_token", "type": "address", "internalType": "address" },
{ "name": "_amount", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawERC721",
"inputs": [
{ "name": "_token", "type": "address", "internalType": "address" },
{ "name": "_id", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "withdrawLPToken",
"inputs": [
{ "name": "_LPToken", "type": "address", "internalType": "address" },
{ "name": "_amount", "type": "uint256", "internalType": "uint256" }
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Deposited",
"inputs": [
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Initialized",
"inputs": [
{
"name": "owner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "LockedUntil",
"inputs": [
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "expiration",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Migrated",
"inputs": [
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "oldLocker",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newLocker",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipHandoverCanceled",
"inputs": [
{
"name": "pendingOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipHandoverRequested",
"inputs": [
{
"name": "pendingOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
"inputs": [
{
"name": "oldOwner",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "newOwner",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "RewardsClaimed",
"inputs": [
{
"name": "stakingContract",
"type": "address",
"indexed": false,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Staked",
"inputs": [
{
"name": "stakingContract",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Unstaked",
"inputs": [
{
"name": "stakingContract",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Withdrawn",
"inputs": [
{
"name": "token",
"type": "address",
"indexed": true,
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"indexed": false,
"internalType": "uint256"
}
],
"anonymous": false
},
{ "type": "error", "name": "AlreadyInitialized", "inputs": [] },
{ "type": "error", "name": "CannotBeLPToken", "inputs": [] },
{ "type": "error", "name": "ClaimRewardsFailed", "inputs": [] },
{ "type": "error", "name": "ExpirationNotMatching", "inputs": [] },
{ "type": "error", "name": "HasToBeLPToken", "inputs": [] },
{ "type": "error", "name": "MigrationNotEnabled", "inputs": [] },
{ "type": "error", "name": "NewOwnerIsZeroAddress", "inputs": [] },
{ "type": "error", "name": "NoHandoverRequest", "inputs": [] },
{ "type": "error", "name": "NotExpiredYet", "inputs": [] },
{ "type": "error", "name": "SelectorNotAllowed", "inputs": [] },
{ "type": "error", "name": "StakeFailed", "inputs": [] },
{ "type": "error", "name": "TargetContractNotAllowed", "inputs": [] },
{ "type": "error", "name": "TokenBlocked", "inputs": [] },
{ "type": "error", "name": "Unauthorized", "inputs": [] },
{ "type": "error", "name": "UnstakeFailed", "inputs": [] },
{ "type": "error", "name": "WildcardFailed", "inputs": [] }
]