2025-01-13 17:42:58 +08:00

544 lines
69 KiB
JSON

{
"address": "0xD7A603Da0A0c3f59d74956175bB545D356B9d24c",
"abi": [
{
"inputs": [
{
"internalType": "contract IERC20",
"name": "_stakingToken",
"type": "address"
},
{
"internalType": "uint256",
"name": "_startTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_endTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_maxStakeAmount",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "maxStakeAmount",
"type": "uint256"
}
],
"name": "MaxStakeAmountUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "startTime",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "PeriodUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "stakeId",
"type": "uint256"
}
],
"name": "StakeCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "Unlocked",
"type": "event"
},
{
"inputs": [],
"name": "endTime",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxStakeAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_maxStakeAmount",
"type": "uint256"
}
],
"name": "setMaxStakeAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_startTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_endTime",
"type": "uint256"
}
],
"name": "setTime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "stake",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "stakes",
"outputs": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stakeTime",
"type": "uint256"
},
{
"internalType": "bool",
"name": "unlocked",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "stakingToken",
"outputs": [
{
"internalType": "contract IERC20",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "startTime",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalStaked",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "unstake",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_user",
"type": "address"
}
],
"name": "userStakes",
"outputs": [
{
"components": [
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "stakeTime",
"type": "uint256"
},
{
"internalType": "bool",
"name": "unlocked",
"type": "bool"
}
],
"internalType": "struct SimpleStake.Stake[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x6f6d83ea5ca986b6fa7e73bd6adc2d4572e4745828033e3075a163695e74d6ce",
"receipt": {
"to": null,
"from": "0x50A8e60041A206AcaA5F844a1104896224be6F39",
"contractAddress": "0xD7A603Da0A0c3f59d74956175bB545D356B9d24c",
"transactionIndex": 0,
"gasUsed": "959802",
"logsBloom": "0x00000000000000000000000000000000000000000000000000800100000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000080000000000020000000000000000000000000200000000000020000000000000000000000000000",
"blockHash": "0x33c20faa31f6419c343f97bb9f6ecb9739de4cd14bea38dc22f82e6e3c330555",
"transactionHash": "0x6f6d83ea5ca986b6fa7e73bd6adc2d4572e4745828033e3075a163695e74d6ce",
"logs": [
{
"transactionIndex": 0,
"blockNumber": 47339099,
"transactionHash": "0x6f6d83ea5ca986b6fa7e73bd6adc2d4572e4745828033e3075a163695e74d6ce",
"address": "0xD7A603Da0A0c3f59d74956175bB545D356B9d24c",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x00000000000000000000000050a8e60041a206acaa5f844a1104896224be6f39"
],
"data": "0x",
"logIndex": 0,
"blockHash": "0x33c20faa31f6419c343f97bb9f6ecb9739de4cd14bea38dc22f82e6e3c330555"
}
],
"blockNumber": 47339099,
"cumulativeGasUsed": "959802",
"status": 1,
"byzantium": true
},
"args": [
"0xfa1223747bae6d519580c53Cbb9C11a45b13c6b7",
1736738872,
1736911672,
"20000000000000000000000000"
],
"numDeployments": 1,
"solcInputHash": "6ec485db727bae776671331125631f51",
"metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_stakingToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_maxStakeAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"maxStakeAmount\",\"type\":\"uint256\"}],\"name\":\"MaxStakeAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"endTime\",\"type\":\"uint256\"}],\"name\":\"PeriodUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stakeId\",\"type\":\"uint256\"}],\"name\":\"StakeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Unlocked\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"endTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxStakeAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_maxStakeAmount\",\"type\":\"uint256\"}],\"name\":\"setMaxStakeAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_endTime\",\"type\":\"uint256\"}],\"name\":\"setTime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"stakes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakeTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"stakingToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"startTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalStaked\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unstake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_user\",\"type\":\"address\"}],\"name\":\"userStakes\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stakeTime\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"internalType\":\"struct SimpleStake.Stake[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unstake()\":{\"details\":\"Unstake all stakes that have not been unlocked yet\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/staking/SimpleStake.sol\":\"SimpleStake\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[],\"viaIR\":true},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby disabling any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xba43b97fba0d32eb4254f6a5a297b39a19a247082a02d6e69349e071e2946218\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n _nonReentrantBefore();\\n _;\\n _nonReentrantAfter();\\n }\\n\\n function _nonReentrantBefore() private {\\n // On the first call to nonReentrant, _status will be _NOT_ENTERED\\n require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n }\\n\\n function _nonReentrantAfter() private {\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Returns true if the reentrancy guard is currently set to \\\"entered\\\", which indicates there is a\\n * `nonReentrant` function in the call stack.\\n */\\n function _reentrancyGuardEntered() internal view returns (bool) {\\n return _status == _ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * ==== Security Considerations\\n *\\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\\n * generally recommended is:\\n *\\n * ```solidity\\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\\n * doThing(..., value);\\n * }\\n *\\n * function doThing(..., uint256 value) public {\\n * token.safeTransferFrom(msg.sender, address(this), value);\\n * ...\\n * }\\n * ```\\n *\\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\\n * {SafeERC20-safeTransferFrom}).\\n *\\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\\n * contracts should have entry points that don't rely on permit.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n *\\n * CAUTION: See Security Considerations above.\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xb264c03a3442eb37a68ad620cefd1182766b58bee6cec40343480392d6b14d69\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20.sol\\\";\\nimport \\\"../extensions/IERC20Permit.sol\\\";\\nimport \\\"../../../utils/Address.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n /**\\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n /**\\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\\n */\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n /**\\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\\n }\\n\\n /**\\n * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful.\\n */\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\\n }\\n }\\n\\n /**\\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\\n * to be set to zero before setting it to a non-zero value, such as USDT.\\n */\\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\\n\\n if (!_callOptionalReturnBool(token, approvalCall)) {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\\n _callOptionalReturn(token, approvalCall);\\n }\\n }\\n\\n /**\\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\\n * Revert on invalid signature.\\n */\\n function safePermit(\\n IERC20Permit token,\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal {\\n uint256 nonceBefore = token.nonces(owner);\\n token.permit(owner, spender, value, deadline, v, r, s);\\n uint256 nonceAfter = token.nonces(owner);\\n require(nonceAfter == nonceBefore + 1, \\\"SafeERC20: permit did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n require(returndata.length == 0 || abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n *\\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\\n */\\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\\n // and not revert is the subcall reverts.\\n\\n (bool success, bytes memory returndata) = address(token).call(data);\\n return\\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\\n }\\n}\\n\",\"keccak256\":\"0xabefac93435967b4d36a4fabcbdbb918d1f0b7ae3c3d85bc30923b326c927ed1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n *\\n * Furthermore, `isContract` will also return true if the target contract within\\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\\n * which only has an effect at the end of a transaction.\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x006dd67219697fe68d7fbfdea512e7c4cb64a43565ed86171d67e844982da6fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n\\n function _contextSuffixLength() internal view virtual returns (uint256) {\\n return 0;\\n }\\n}\\n\",\"keccak256\":\"0xa92e4fa126feb6907daa0513ddd816b2eb91f30a808de54f63c17d0e162c3439\",\"license\":\"MIT\"},\"contracts/staking/SimpleStake.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.19;\\n\\nimport {IERC20} from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport {SafeERC20} from \\\"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\\\";\\nimport {ReentrancyGuard} from \\\"@openzeppelin/contracts/security/ReentrancyGuard.sol\\\";\\nimport {Ownable} from \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\n\\ncontract SimpleStake is Ownable, ReentrancyGuard {\\n using SafeERC20 for IERC20;\\n IERC20 public stakingToken;\\n uint256 public startTime;\\n uint256 public endTime;\\n uint256 public maxStakeAmount;\\n uint256 public totalStaked;\\n\\n struct Stake {\\n uint256 amount;\\n uint256 stakeTime;\\n bool unlocked;\\n }\\n\\n mapping(address account => Stake[] stakes) public stakes;\\n\\n event StakeCreated(address indexed user, uint256 amount, uint256 stakeId);\\n event Unlocked(address indexed user, uint256 amount);\\n event PeriodUpdated(uint256 startTime, uint256 endTime);\\n event MaxStakeAmountUpdated(uint256 maxStakeAmount);\\n\\n constructor(IERC20 _stakingToken, uint256 _startTime, uint256 _endTime, uint256 _maxStakeAmount) {\\n require(_endTime > _startTime, \\\"End time must be after start time\\\");\\n stakingToken = _stakingToken;\\n startTime = _startTime;\\n endTime = _endTime;\\n maxStakeAmount = _maxStakeAmount;\\n }\\n\\n function stake(uint256 _amount) public nonReentrant {\\n require(block.timestamp >= startTime, \\\"Staking has not started yet\\\");\\n require(block.timestamp <= endTime, \\\"Staking has ended\\\");\\n require(_amount > 0, \\\"Amount must be greater than 0\\\");\\n require(_amount <= maxStakeAmount, \\\"Amount exceeds max stake amount\\\");\\n require(totalStaked + _amount <= maxStakeAmount, \\\"Exceeds max stake amount\\\");\\n address user = _msgSender();\\n totalStaked += _amount;\\n stakingToken.safeTransferFrom(user, address(this), _amount);\\n\\n stakes[user].push(Stake(_amount, block.timestamp, false));\\n emit StakeCreated(user, _amount, stakes[user].length - 1);\\n }\\n\\n /**\\n * @dev Unstake all stakes that have not been unlocked yet\\n */\\n function unstake() public nonReentrant {\\n require(\\n block.timestamp > endTime,\\n \\\"Unlock time not reached\\\"\\n );\\n address user = _msgSender();\\n require(stakes[user].length > 0, \\\"No stakes to unstake\\\");\\n \\n uint256 totalAmount = 0;\\n for (uint256 i = 0; i < stakes[user].length; i++) {\\n Stake storage stakeInfo = stakes[user][i];\\n if (!stakeInfo.unlocked) {\\n totalAmount += stakeInfo.amount;\\n stakeInfo.unlocked = true;\\n }\\n }\\n require(totalAmount > 0, \\\"No stakes to unstake\\\");\\n totalStaked -= totalAmount;\\n emit Unlocked(user, totalAmount);\\n stakingToken.safeTransfer(user, totalAmount);\\n }\\n\\n function setTime(uint256 _startTime, uint256 _endTime) public onlyOwner {\\n require(_endTime > _startTime, \\\"End time must be after start time\\\");\\n startTime = _startTime;\\n endTime = _endTime;\\n emit PeriodUpdated(_startTime, _endTime);\\n }\\n\\n function setMaxStakeAmount(uint256 _maxStakeAmount) public onlyOwner {\\n maxStakeAmount = _maxStakeAmount;\\n emit MaxStakeAmountUpdated(_maxStakeAmount);\\n }\\n\\n function userStakes(address _user) public view returns (Stake[] memory) {\\n return stakes[_user];\\n }\\n}\\n\",\"keccak256\":\"0x1644c2e28f0bae4f430f422e475cd0bf89707610e12337e9ffc0287e68676ba2\",\"license\":\"MIT\"}},\"version\":1}",
"bytecode": "0x60803461012057601f610f1738819003918201601f19168301916001600160401b03831184841017610125578084926080946040528339810103126101205780516001600160a01b039190828116908190036101205760208201519060606040840151930151936000549060018060a01b0319913383821617600055604051913391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a360018055838511156100d457506002541617600255600355600455600555604051610ddb908161013c8239f35b62461bcd60e51b815260206004820152602160248201527f456e642074696d65206d7573742062652061667465722073746172742074696d6044820152606560f81b6064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6040608081526004908136101561001557600080fd5b600091823560e01c80632def6620146108205780633197cbb614610803578063584b62a1146107965780635d80ca3214610777578063715018a61461071a57806372f702f3146106f157806378e97925146106d2578063817b1cd2146106b35780638da5cb5b1461068b5780638da7ad231461057a578063a0355eca146104ce578063a694fc3a146101cd578063dcc2a55e146101805763f2fde38b146100bb57600080fd5b3461017c57602036600319011261017c576100d46109cc565b906100dd610a19565b6001600160a01b0391821692831561012a57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b503461017c57602036600319011261017c577f54eb4b63d48d1cd0b132ac5f8945d5e7fa77a2238e2bb533ef3ccb95e7be5d2c9160209135906101c1610a19565b8160055551908152a180f35b509190346104ca576020908160031936011261017c578335916101ee610ae8565b60035442106104885784544211610452578215610410576005548084116103cd576006549061021d8583610a71565b1161038a578361022c91610a71565b60065560025482516323b872dd60e01b8382015233602482015230604482015260648082018690528152906001600160a01b031660a0820167ffffffffffffffff8111838210176103775784526102839190610b3e565b33845260078152818420825161029881610a94565b848152828101428152848201928784528054906801000000000000000082101561036457906102cc916001820181556109e7565b929092610352579060029291518255516001820155019051151560ff80198354169116179055338452600781528184205490600019820191821161033f57825193845283015233917f072db3cafa6572052b0c3c566f5726ae74e0e6c44d5557b3523273a690aef83f9190a26001805580f35b634e487b7160e01b855260118652602485fd5b634e487b7160e01b8852878952602488fd5b634e487b7160e01b895260418a52602489fd5b634e487b7160e01b875260418852602487fd5b825162461bcd60e51b8152808701839052601860248201527f45786365656473206d6178207374616b6520616d6f756e7400000000000000006044820152606490fd5b825162461bcd60e51b8152808701839052601f60248201527f416d6f756e742065786365656473206d6178207374616b6520616d6f756e74006044820152606490fd5b8490606492519162461bcd60e51b8352820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152fd5b8490606492519162461bcd60e51b8352820152601160248201527014dd185ada5b99c81a185cc8195b991959607a1b6044820152fd5b8490606492519162461bcd60e51b8352820152601b60248201527f5374616b696e6720686173206e6f7420737461727465642079657400000000006044820152fd5b5080fd5b509190346104ca57806003193601126104ca5782356024356104ee610a19565b8181111561052d57807f5b873fc01d45058fe77f3883a91020f46d5a7385baac6ceab19748d1d0ae464a9495836003555582519182526020820152a180f35b825162461bcd60e51b8152602081870152602160248201527f456e642074696d65206d7573742062652061667465722073746172742074696d6044820152606560f81b6064820152608490fd5b508290346104ca576020908160031936011261017c576001600160a01b036105a06109cc565b168352600782528383209182549167ffffffffffffffff8311610678575092908451906105d2858260051b0183610ac6565b8082528482018094845285842084915b8383106106375750505050845193808501918186525180925285850193925b82811061060e5785850386f35b835180518652808301518684015287015115158786015260609094019392810192600101610601565b6003886001928b9a97989a5161064c81610a94565b85548152848601548382015260ff60028701541615158d820152815201920192019190969493966105e2565b634e487b7160e01b855260419052602484fd5b5050346104ca57816003193601126104ca57905490516001600160a01b039091168152602090f35b5050346104ca57816003193601126104ca576020906006549051908152f35b5050346104ca57816003193601126104ca576020906003549051908152f35b5050346104ca57816003193601126104ca5760025490516001600160a01b039091168152602090f35b8334610774578060031936011261077457610733610a19565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346104ca57816003193601126104ca576020906005549051908152f35b5050346104ca57806003193601126104ca576107b06109cc565b6001600160a01b0316825260076020528082208054602435939084101561077457506060926107de916109e7565b509081549160ff60026001830154920154169082519384526020840152151590820152f35b503461017c578260031936011261017c5760209250549051908152f35b508290346104ca57816003193601126104ca5761083b610ae8565b80544211156109895733825260079260209084825261085e818520541515610d62565b8391845b33865286825282862080548210156108d7578161087e916109e7565b506002810180549160ff8316156108b7575b50505060001981146108a457600101610862565b634e487b7160e01b865260118552602486fd5b60019192966108c7915490610a71565b9560ff1916179055878080610890565b50509294506108e7821515610d62565b60065482810390811161033f5760065580518281527f0f0bc5b519ddefdd8e5f9e6423433aa2b869738de2ae34d58ebc796fc749fa0d843392a260018060a01b03600254169181519363a9059cbb60e01b90850152336024850152604484015260448352608083019083821067ffffffffffffffff8311176109765761096f94955052610b3e565b6001805580f35b634e487b7160e01b855260418652602485fd5b606490602084519162461bcd60e51b8352820152601760248201527f556e6c6f636b2074696d65206e6f7420726561636865640000000000000000006044820152fd5b600435906001600160a01b03821682036109e257565b600080fd5b8054821015610a03576000526003602060002091020190600090565b634e487b7160e01b600052603260045260246000fd5b6000546001600160a01b03163303610a2d57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908201809211610a7e57565b634e487b7160e01b600052601160045260246000fd5b6060810190811067ffffffffffffffff821117610ab057604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610ab057604052565b600260015414610af9576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60018060a01b0316906040516040810167ffffffffffffffff9082811082821117610ab0576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15610c83573d928311610c6f5790610bd993929160405192610bcc88601f19601f8401160185610ac6565b83523d868885013e610c8e565b805191821591848315610c4b575b505050905015610bf45750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126104ca57820151908115158203610774575080388084610be7565b634e487b7160e01b85526041600452602485fd5b90610bd99392506060915b91929015610cf05750815115610ca2575090565b3b15610cab5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610d035750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610d49575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610d26565b15610d6957565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b657320746f20756e7374616b6560601b6044820152606490fdfea264697066735822122020569bf487ab94c68c3ee57d12c7fc4eb99082e11a76ec70b34bfd57d086f7d864736f6c63430008130033",
"deployedBytecode": "0x6040608081526004908136101561001557600080fd5b600091823560e01c80632def6620146108205780633197cbb614610803578063584b62a1146107965780635d80ca3214610777578063715018a61461071a57806372f702f3146106f157806378e97925146106d2578063817b1cd2146106b35780638da5cb5b1461068b5780638da7ad231461057a578063a0355eca146104ce578063a694fc3a146101cd578063dcc2a55e146101805763f2fde38b146100bb57600080fd5b3461017c57602036600319011261017c576100d46109cc565b906100dd610a19565b6001600160a01b0391821692831561012a57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8280fd5b503461017c57602036600319011261017c577f54eb4b63d48d1cd0b132ac5f8945d5e7fa77a2238e2bb533ef3ccb95e7be5d2c9160209135906101c1610a19565b8160055551908152a180f35b509190346104ca576020908160031936011261017c578335916101ee610ae8565b60035442106104885784544211610452578215610410576005548084116103cd576006549061021d8583610a71565b1161038a578361022c91610a71565b60065560025482516323b872dd60e01b8382015233602482015230604482015260648082018690528152906001600160a01b031660a0820167ffffffffffffffff8111838210176103775784526102839190610b3e565b33845260078152818420825161029881610a94565b848152828101428152848201928784528054906801000000000000000082101561036457906102cc916001820181556109e7565b929092610352579060029291518255516001820155019051151560ff80198354169116179055338452600781528184205490600019820191821161033f57825193845283015233917f072db3cafa6572052b0c3c566f5726ae74e0e6c44d5557b3523273a690aef83f9190a26001805580f35b634e487b7160e01b855260118652602485fd5b634e487b7160e01b8852878952602488fd5b634e487b7160e01b895260418a52602489fd5b634e487b7160e01b875260418852602487fd5b825162461bcd60e51b8152808701839052601860248201527f45786365656473206d6178207374616b6520616d6f756e7400000000000000006044820152606490fd5b825162461bcd60e51b8152808701839052601f60248201527f416d6f756e742065786365656473206d6178207374616b6520616d6f756e74006044820152606490fd5b8490606492519162461bcd60e51b8352820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152fd5b8490606492519162461bcd60e51b8352820152601160248201527014dd185ada5b99c81a185cc8195b991959607a1b6044820152fd5b8490606492519162461bcd60e51b8352820152601b60248201527f5374616b696e6720686173206e6f7420737461727465642079657400000000006044820152fd5b5080fd5b509190346104ca57806003193601126104ca5782356024356104ee610a19565b8181111561052d57807f5b873fc01d45058fe77f3883a91020f46d5a7385baac6ceab19748d1d0ae464a9495836003555582519182526020820152a180f35b825162461bcd60e51b8152602081870152602160248201527f456e642074696d65206d7573742062652061667465722073746172742074696d6044820152606560f81b6064820152608490fd5b508290346104ca576020908160031936011261017c576001600160a01b036105a06109cc565b168352600782528383209182549167ffffffffffffffff8311610678575092908451906105d2858260051b0183610ac6565b8082528482018094845285842084915b8383106106375750505050845193808501918186525180925285850193925b82811061060e5785850386f35b835180518652808301518684015287015115158786015260609094019392810192600101610601565b6003886001928b9a97989a5161064c81610a94565b85548152848601548382015260ff60028701541615158d820152815201920192019190969493966105e2565b634e487b7160e01b855260419052602484fd5b5050346104ca57816003193601126104ca57905490516001600160a01b039091168152602090f35b5050346104ca57816003193601126104ca576020906006549051908152f35b5050346104ca57816003193601126104ca576020906003549051908152f35b5050346104ca57816003193601126104ca5760025490516001600160a01b039091168152602090f35b8334610774578060031936011261077457610733610a19565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346104ca57816003193601126104ca576020906005549051908152f35b5050346104ca57806003193601126104ca576107b06109cc565b6001600160a01b0316825260076020528082208054602435939084101561077457506060926107de916109e7565b509081549160ff60026001830154920154169082519384526020840152151590820152f35b503461017c578260031936011261017c5760209250549051908152f35b508290346104ca57816003193601126104ca5761083b610ae8565b80544211156109895733825260079260209084825261085e818520541515610d62565b8391845b33865286825282862080548210156108d7578161087e916109e7565b506002810180549160ff8316156108b7575b50505060001981146108a457600101610862565b634e487b7160e01b865260118552602486fd5b60019192966108c7915490610a71565b9560ff1916179055878080610890565b50509294506108e7821515610d62565b60065482810390811161033f5760065580518281527f0f0bc5b519ddefdd8e5f9e6423433aa2b869738de2ae34d58ebc796fc749fa0d843392a260018060a01b03600254169181519363a9059cbb60e01b90850152336024850152604484015260448352608083019083821067ffffffffffffffff8311176109765761096f94955052610b3e565b6001805580f35b634e487b7160e01b855260418652602485fd5b606490602084519162461bcd60e51b8352820152601760248201527f556e6c6f636b2074696d65206e6f7420726561636865640000000000000000006044820152fd5b600435906001600160a01b03821682036109e257565b600080fd5b8054821015610a03576000526003602060002091020190600090565b634e487b7160e01b600052603260045260246000fd5b6000546001600160a01b03163303610a2d57565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b91908201809211610a7e57565b634e487b7160e01b600052601160045260246000fd5b6060810190811067ffffffffffffffff821117610ab057604052565b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff821117610ab057604052565b600260015414610af9576002600155565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b60018060a01b0316906040516040810167ffffffffffffffff9082811082821117610ab0576040526020938483527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858401526000808587829751910182855af1903d15610c83573d928311610c6f5790610bd993929160405192610bcc88601f19601f8401160185610ac6565b83523d868885013e610c8e565b805191821591848315610c4b575b505050905015610bf45750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b9193818094500103126104ca57820151908115158203610774575080388084610be7565b634e487b7160e01b85526041600452602485fd5b90610bd99392506060915b91929015610cf05750815115610ca2575090565b3b15610cab5790565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b825190915015610d035750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510610d49575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350610d26565b15610d6957565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b657320746f20756e7374616b6560601b6044820152606490fdfea264697066735822122020569bf487ab94c68c3ee57d12c7fc4eb99082e11a76ec70b34bfd57d086f7d864736f6c63430008130033",
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
},
"unstake()": {
"details": "Unstake all stakes that have not been unlocked yet"
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
},
"storageLayout": {
"storage": [
{
"astId": 7,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 123,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "_status",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 1048,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "stakingToken",
"offset": 0,
"slot": "2",
"type": "t_contract(IERC20)255"
},
{
"astId": 1050,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "startTime",
"offset": 0,
"slot": "3",
"type": "t_uint256"
},
{
"astId": 1052,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "endTime",
"offset": 0,
"slot": "4",
"type": "t_uint256"
},
{
"astId": 1054,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "maxStakeAmount",
"offset": 0,
"slot": "5",
"type": "t_uint256"
},
{
"astId": 1056,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "totalStaked",
"offset": 0,
"slot": "6",
"type": "t_uint256"
},
{
"astId": 1069,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "stakes",
"offset": 0,
"slot": "7",
"type": "t_mapping(t_address,t_array(t_struct(Stake)1063_storage)dyn_storage)"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_struct(Stake)1063_storage)dyn_storage": {
"base": "t_struct(Stake)1063_storage",
"encoding": "dynamic_array",
"label": "struct SimpleStake.Stake[]",
"numberOfBytes": "32"
},
"t_bool": {
"encoding": "inplace",
"label": "bool",
"numberOfBytes": "1"
},
"t_contract(IERC20)255": {
"encoding": "inplace",
"label": "contract IERC20",
"numberOfBytes": "20"
},
"t_mapping(t_address,t_array(t_struct(Stake)1063_storage)dyn_storage)": {
"encoding": "mapping",
"key": "t_address",
"label": "mapping(address => struct SimpleStake.Stake[])",
"numberOfBytes": "32",
"value": "t_array(t_struct(Stake)1063_storage)dyn_storage"
},
"t_struct(Stake)1063_storage": {
"encoding": "inplace",
"label": "struct SimpleStake.Stake",
"members": [
{
"astId": 1058,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "amount",
"offset": 0,
"slot": "0",
"type": "t_uint256"
},
{
"astId": 1060,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "stakeTime",
"offset": 0,
"slot": "1",
"type": "t_uint256"
},
{
"astId": 1062,
"contract": "contracts/staking/SimpleStake.sol:SimpleStake",
"label": "unlocked",
"offset": 0,
"slot": "2",
"type": "t_bool"
}
],
"numberOfBytes": "96"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
}
}