Source Code
Multichain Info
N/A
Latest 25 from a total of 256 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Get Reward | 32714079 | 40 hrs ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 32431256 | 8 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 32289866 | 12 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 32088289 | 18 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 32008952 | 20 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 31886473 | 22 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 31719598 | 26 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 31633912 | 28 days ago | IN | 0 APE | 0.00899912 | ||||
| Get Reward | 31338581 | 34 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 31300117 | 34 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 31055028 | 39 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30991233 | 40 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30907732 | 41 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30884238 | 42 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30829940 | 43 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30803867 | 43 days ago | IN | 0 APE | 0.0076081 | ||||
| Get Reward | 30395735 | 49 days ago | IN | 0 APE | 0.00190233 | ||||
| Get Reward | 30383227 | 49 days ago | IN | 0 APE | 0.00190235 | ||||
| Get Reward | 30019024 | 51 days ago | IN | 0 APE | 0.00190233 | ||||
| Get Reward | 29284384 | 57 days ago | IN | 0 APE | 0.00190233 | ||||
| Get Reward | 28858521 | 62 days ago | IN | 0 APE | 0.00190235 | ||||
| Get Reward | 28630387 | 64 days ago | IN | 0 APE | 0.00190233 | ||||
| Get Reward | 28213539 | 68 days ago | IN | 0 APE | 0.00190233 | ||||
| Get Reward | 27983149 | 69 days ago | IN | 0 APE | 0.00190235 | ||||
| Get Reward | 27638417 | 72 days ago | IN | 0 APE | 0.00190233 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x16cEB752...b8e8B5750 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StakingReward
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "openzeppelin-contracts/contracts/access/Ownable.sol";
import "openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import "openzeppelin-contracts/contracts/utils/Pausable.sol";
import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
import "./interfaces/IStakingReward.sol";
contract StakingReward is Ownable, Pausable, ReentrancyGuard, IStakingReward {
using SafeERC20 for IERC20;
/// @notice The staking token address
address public immutable stakingToken;
/// @notice The reward token address
address public immutable rewardsToken;
/// @notice The helper contract address
address public helperContract;
/// @notice The period finish timestamp
uint256 public periodFinish;
/// @notice The reward rate
uint256 public rewardRate;
/// @notice The rewards duration
uint256 public rewardsDuration;
/// @notice The last time the reward was applicable
uint256 public lastUpdateTime;
/// @notice The reward per token stored
uint256 public rewardPerTokenStored;
/// @notice The mapping of user reward per token paid
mapping(address => uint256) public rewardPerTokenPaid;
/// @notice The mapping of user rewards
mapping(address => uint256) public rewards;
/// @notice The total supply of the staking token
uint256 private _totalSupply;
/// @notice The mapping of user balances
mapping(address => uint256) private _balances;
constructor(address _stakingToken, address _rewardsToken, address _admin) Ownable(_admin) {
stakingToken = _stakingToken;
rewardsToken = _rewardsToken;
}
/* ========== VIEWS ========== */
/**
* @notice Return the total amount of the staking token staked in the contract.
* @return The total supply
*/
function totalSupply() external view returns (uint256) {
return _totalSupply;
}
/**
* @notice Return user balance of the staking token staked in the contract.
* @return The user balance
*/
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
/**
* @notice Return the last time reward is applicable.
* @return The last applicable timestamp
*/
function lastTimeRewardApplicable() public view returns (uint256) {
return block.timestamp < periodFinish ? block.timestamp : periodFinish;
}
/**
* @notice Return the reward token amount per staking token.
* @return The reward token amount
*/
function rewardPerToken() public view returns (uint256) {
if (_totalSupply == 0) {
return rewardPerTokenStored;
}
// rewardPerTokenStored + [(lastTimeRewardApplicable - lastUpdateTime) * rewardRate / _totalSupply]
return
rewardPerTokenStored + (((lastTimeRewardApplicable() - lastUpdateTime) * rewardRate * 1e18) / _totalSupply);
}
/**
* @notice Return the reward token amount a user earned.
* @param account The user address
* @return The reward token amount
*/
function earned(address account) public view returns (uint256) {
// rewards + (rewardPerToken - rewardPerTokenPaid) * _balances
return (_balances[account] * (rewardPerToken() - rewardPerTokenPaid[account])) / 1e18 + rewards[account];
}
/**
* @notice Return the reward token for duration.
* @return The reward token amount
*/
function getRewardForDuration() external view returns (uint256) {
return rewardRate * rewardsDuration;
}
/**
* @notice Return the staking token.
* @return The staking token
*/
function getStakingToken() external view returns (address) {
return address(stakingToken);
}
/* ========== MUTATIVE FUNCTIONS ========== */
/**
* @notice Stake the staking token.
* @param account The user address
* @param amount The amount of the staking token
*/
function stake(address account, uint256 amount)
external
nonReentrant
whenNotPaused
updateReward(account)
isAuthorized(account)
{
require(amount > 0, "invalid amount");
_totalSupply = _totalSupply + amount;
_balances[account] = _balances[account] + amount;
IERC20(stakingToken).safeTransferFrom(msg.sender, address(this), amount);
emit Staked(account, amount);
}
/**
* @notice Withdraw the staked token.
* @param account The user address
* @param amount The amount of the staking token
*/
function withdraw(address account, uint256 amount)
public
nonReentrant
updateReward(account)
isAuthorized(account)
{
require(amount > 0, "invalid amount");
_totalSupply = _totalSupply - amount;
_balances[account] = _balances[account] - amount;
IERC20(stakingToken).safeTransfer(msg.sender, amount);
emit Withdrawn(account, amount);
}
/**
* @notice Claim rewards for the message sender.
* @param account The user address
*/
function getReward(address account) public nonReentrant updateReward(account) isAuthorized(account) {
uint256 reward = rewards[account];
if (reward > 0) {
rewards[account] = 0;
IERC20(rewardsToken).safeTransfer(account, reward);
emit RewardPaid(account, reward);
}
}
/* ========== RESTRICTED FUNCTIONS ========== */
/**
* @notice Set new reward amount.
* @dev Make sure the admin deposits `reward` of reward tokens into the contract before calling this function.
* @param reward The reward amount
*/
function notifyRewardAmount(uint256 reward) external onlyOwner updateReward(address(0)) {
if (block.timestamp >= periodFinish) {
rewardRate = reward / rewardsDuration;
} else {
uint256 remaining = periodFinish - block.timestamp;
uint256 leftover = remaining * rewardRate;
rewardRate = (reward + leftover) / rewardsDuration;
}
// Ensure the provided reward amount is not more than the balance in the contract.
// This keeps the reward rate in the right range, preventing overflows due to
// very high values of rewardRate in the earned and rewardsPerToken functions;
// Reward + leftover must be less than 2^256 / 10^18 to avoid overflow.
uint256 balance = IERC20(rewardsToken).balanceOf(address(this));
require(rewardRate <= balance / rewardsDuration, "reward rate too high");
lastUpdateTime = block.timestamp;
periodFinish = block.timestamp + rewardsDuration;
emit RewardAdded(reward);
}
/**
* @notice Seize the accidentally deposited tokens.
* @dev Thes staking tokens cannot be seized.
* @param tokenAddress The token address
* @param tokenAmount The token amount
*/
function recoverToken(address tokenAddress, uint256 tokenAmount) external onlyOwner {
require(tokenAddress != address(stakingToken), "cannot withdraw staking token");
IERC20(tokenAddress).safeTransfer(owner(), tokenAmount);
emit Recovered(tokenAddress, tokenAmount);
}
/**
* @notice Set the rewards duration.
* @param duration The new duration
*/
function setRewardsDuration(uint256 duration) external onlyOwner {
require(block.timestamp > periodFinish, "previous rewards not complete");
rewardsDuration = duration;
emit RewardsDurationUpdated(rewardsDuration);
}
/**
* @notice Set the helper contract.
* @param helper The helper contract address
*/
function setHelperContract(address helper) external onlyOwner {
helperContract = helper;
emit HelperUpdated(helper);
}
/**
* @notice Pause the staking.
*/
function pause() external onlyOwner {
_pause();
}
/**
* @notice Unpause the staking.
*/
function unpause() external onlyOwner {
_unpause();
}
/* ========== MODIFIERS ========== */
/**
* @notice Update the reward for the user.
* @param account The user address
*/
modifier updateReward(address account) {
rewardPerTokenStored = rewardPerToken();
lastUpdateTime = lastTimeRewardApplicable();
if (account != address(0)) {
rewards[account] = earned(account);
rewardPerTokenPaid[account] = rewardPerTokenStored;
}
_;
}
/**
* @notice Check if the caller is authorized.
* @param account The user address
*/
modifier isAuthorized(address account) {
require(msg.sender == account || msg.sender == helperContract, "unauthorized");
_;
}
/* ========== EVENTS ========== */
event RewardAdded(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event RewardsDurationUpdated(uint256 newDuration);
event Recovered(address token, uint256 amount);
event HelperUpdated(address helper);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev 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.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/ReentrancyGuard.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If EIP-1153 (transient storage) is available on the chain you're deploying at,
* consider using {ReentrancyGuardTransient} instead.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IStakingReward {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function lastTimeRewardApplicable() external view returns (uint256);
function rewardPerToken() external view returns (uint256);
function earned(address account) external view returns (uint256);
function getRewardForDuration() external view returns (uint256);
function getStakingToken() external view returns (address);
function stake(address account, uint256 amount) external;
function withdraw(address account, uint256 amount) external;
function getReward(address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}{
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_stakingToken","type":"address"},{"internalType":"address","name":"_rewardsToken","type":"address"},{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"helper","type":"address"}],"name":"HelperUpdated","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":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"RewardsDurationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getRewardForDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"helperContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reward","type":"uint256"}],"name":"notifyRewardAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewardPerTokenPaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"helper","type":"address"}],"name":"setHelperContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"duration","type":"uint256"}],"name":"setRewardsDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","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":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x60c06040523480156200001157600080fd5b50604051620013e6380380620013e68339810160408190526200003491620000fa565b806001600160a01b0381166200006457604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006f816200008d565b5050600180556001600160a01b039182166080521660a05262000144565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620000f557600080fd5b919050565b6000806000606084860312156200011057600080fd5b6200011b84620000dd565b92506200012b60208501620000dd565b91506200013b60408501620000dd565b90509250925092565b60805160a05161125262000194600039600081816103df015281816105a90152610aa20152600081816102cd0152818161033301528181610853015281816108d70152610ddd01526112526000f3fe608060405234801561001057600080fd5b50600436106101d95760003560e01c80638da5cb5b11610104578063c8f33c91116100a2578063df136d6511610071578063df136d6514610401578063ebe2b12b1461040a578063f2fde38b14610413578063f3fef3a31461042657600080fd5b8063c8f33c91146103b6578063cc1a378f146103bf578063cd3daf9d146103d2578063d1af0c7d146103da57600080fd5b8063adc9772e116100de578063adc9772e1461036a578063b29a81401461037d578063c00007b014610390578063c5639cc6146103a357600080fd5b80638da5cb5b146103205780639f9106d114610331578063a5dc9e1b1461035757600080fd5b80635c975abb1161017c57806372f702f31161014b57806372f702f3146102c85780637b0a47ee1461030757806380faa57d146103105780638456cb591461031857600080fd5b80635c975abb1461025a578063653a8da11461027757806370a0823114610297578063715018a6146102c057600080fd5b80631c1f78eb116101b85780631c1f78eb1461022c578063386a9525146102345780633c6b16ab1461023d5780633f4ba83a1461025257600080fd5b80628cc262146101de5780630700037d1461020457806318160ddd14610224575b600080fd5b6101f16101ec366004611103565b610439565b6040519081526020015b60405180910390f35b6101f1610212366004611103565b60096020526000908152604090205481565b600a546101f1565b6101f16104b6565b6101f160055481565b61025061024b366004611125565b6104cd565b005b6102506106c6565b600054600160a01b900460ff1660405190151581526020016101fb565b6101f1610285366004611103565b60086020526000908152604090205481565b6101f16102a5366004611103565b6001600160a01b03166000908152600b602052604090205490565b6102506106d8565b6102ef7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101fb565b6101f160045481565b6101f16106ea565b610250610701565b6000546001600160a01b03166102ef565b7f00000000000000000000000000000000000000000000000000000000000000006102ef565b6002546102ef906001600160a01b031681565b61025061037836600461113e565b610711565b61025061038b36600461113e565b6108cd565b61025061039e366004611103565b6109c2565b6102506103b1366004611103565b610b1c565b6101f160065481565b6102506103cd366004611125565b610b79565b6101f1610c07565b6102ef7f000000000000000000000000000000000000000000000000000000000000000081565b6101f160075481565b6101f160035481565b610250610421366004611103565b610c68565b61025061043436600461113e565b610ca3565b6001600160a01b0381166000908152600960209081526040808320546008909252822054670de0b6b3a76400009061046f610c07565b610479919061117e565b6001600160a01b0385166000908152600b602052604090205461049c9190611191565b6104a691906111a8565b6104b091906111ca565b92915050565b60006005546004546104c89190611191565b905090565b6104d5610e3f565b60006104df610c07565b6007556104ea6106ea565b6006556001600160a01b038116156105315761050581610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b600354421061054f5760055461054790836111a8565b600455610591565b60004260035461055f919061117e565b90506000600454826105719190611191565b60055490915061058182866111ca565b61058b91906111a8565b60045550505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156105f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061c91906111dd565b90506005548161062c91906111a8565b60045411156106795760405162461bcd60e51b81526020600482015260146024820152730e4caeec2e4c840e4c2e8ca40e8dede40d0d2ced60631b60448201526064015b60405180910390fd5b42600681905560055461068b916111ca565b6003556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b6106ce610e3f565b6106d6610e6c565b565b6106e0610e3f565b6106d66000610ec1565b600060035442106106fc575060035490565b504290565b610709610e3f565b6106d6610f11565b610719610f54565b610721610f7e565b8161072a610c07565b6007556107356106ea565b6006556001600160a01b0381161561077c5761075081610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b82336001600160a01b038216148061079e57506002546001600160a01b031633145b6107ba5760405162461bcd60e51b8152600401610670906111f6565b600083116107fb5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610670565b82600a5461080991906111ca565b600a556001600160a01b0384166000908152600b60205260409020546108309084906111ca565b6001600160a01b038086166000908152600b602052604090209190915561087b907f000000000000000000000000000000000000000000000000000000000000000016333086610fa9565b836001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d846040516108b691815260200190565b60405180910390a250506108c960018055565b5050565b6108d5610e3f565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316036109565760405162461bcd60e51b815260206004820152601d60248201527f63616e6e6f74207769746864726177207374616b696e6720746f6b656e0000006044820152606401610670565b61097c61096b6000546001600160a01b031690565b6001600160a01b0384169083611016565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a15050565b6109ca610f54565b806109d3610c07565b6007556109de6106ea565b6006556001600160a01b03811615610a25576109f981610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b81336001600160a01b0382161480610a4757506002546001600160a01b031633145b610a635760405162461bcd60e51b8152600401610670906111f6565b6001600160a01b0383166000908152600960205260409020548015610b0d576001600160a01b03808516600090815260096020526040812055610ac9907f0000000000000000000000000000000000000000000000000000000000000000168583611016565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610b0491815260200190565b60405180910390a25b505050610b1960018055565b50565b610b24610e3f565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f20e752df2d1d9e69c7eb8f9e96973ff9b6f881a03503a3b5cac668cafb9a1ac8906020015b60405180910390a150565b610b81610e3f565b6003544211610bd25760405162461bcd60e51b815260206004820152601d60248201527f70726576696f75732072657761726473206e6f7420636f6d706c6574650000006044820152606401610670565b60058190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d390602001610b6e565b6000600a54600003610c1a575060075490565b600a54600454600654610c2b6106ea565b610c35919061117e565b610c3f9190611191565b610c5190670de0b6b3a7640000611191565b610c5b91906111a8565b6007546104c891906111ca565b610c70610e3f565b6001600160a01b038116610c9a57604051631e4fbdf760e01b815260006004820152602401610670565b610b1981610ec1565b610cab610f54565b81610cb4610c07565b600755610cbf6106ea565b6006556001600160a01b03811615610d0657610cda81610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b82336001600160a01b0382161480610d2857506002546001600160a01b031633145b610d445760405162461bcd60e51b8152600401610670906111f6565b60008311610d855760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610670565b82600a54610d93919061117e565b600a556001600160a01b0384166000908152600b6020526040902054610dba90849061117e565b6001600160a01b038086166000908152600b6020526040902091909155610e04907f0000000000000000000000000000000000000000000000000000000000000000163385611016565b836001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5846040516108b691815260200190565b6000546001600160a01b031633146106d65760405163118cdaa760e01b8152336004820152602401610670565b610e7461104c565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610f19610f7e565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea43390565b600260015403610f7757604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600054600160a01b900460ff16156106d65760405163d93c066560e01b815260040160405180910390fd5b6040516001600160a01b0384811660248301528381166044830152606482018390526110109186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611076565b50505050565b6040516001600160a01b0383811660248301526044820183905261104791859182169063a9059cbb90606401610fde565b505050565b600054600160a01b900460ff166106d657604051638dfc202b60e01b815260040160405180910390fd5b600080602060008451602086016000885af180611099576040513d6000823e3d81fd5b50506000513d915081156110b15780600114156110be565b6001600160a01b0384163b155b1561101057604051635274afe760e01b81526001600160a01b0385166004820152602401610670565b80356001600160a01b03811681146110fe57600080fd5b919050565b60006020828403121561111557600080fd5b61111e826110e7565b9392505050565b60006020828403121561113757600080fd5b5035919050565b6000806040838503121561115157600080fd5b61115a836110e7565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104b0576104b0611168565b80820281158282048414176104b0576104b0611168565b6000826111c557634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156104b0576104b0611168565b6000602082840312156111ef57600080fd5b5051919050565b6020808252600c908201526b1d5b985d5d1a1bdc9a5e995960a21b60408201526060019056fea2646970667358221220affa16329a2727fa5e0446f6ce995cce0f9d0b2d9dd7033b0fa1e8a2c463a63664736f6c63430008180033000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc884000000000000000000000000dc60c24de182b07cb3f3a9269f120d8c15c4b38100000000000000000000000003ad7ede9c5fc581b0b03e0ca1ac0ebfd29b1e65
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101d95760003560e01c80638da5cb5b11610104578063c8f33c91116100a2578063df136d6511610071578063df136d6514610401578063ebe2b12b1461040a578063f2fde38b14610413578063f3fef3a31461042657600080fd5b8063c8f33c91146103b6578063cc1a378f146103bf578063cd3daf9d146103d2578063d1af0c7d146103da57600080fd5b8063adc9772e116100de578063adc9772e1461036a578063b29a81401461037d578063c00007b014610390578063c5639cc6146103a357600080fd5b80638da5cb5b146103205780639f9106d114610331578063a5dc9e1b1461035757600080fd5b80635c975abb1161017c57806372f702f31161014b57806372f702f3146102c85780637b0a47ee1461030757806380faa57d146103105780638456cb591461031857600080fd5b80635c975abb1461025a578063653a8da11461027757806370a0823114610297578063715018a6146102c057600080fd5b80631c1f78eb116101b85780631c1f78eb1461022c578063386a9525146102345780633c6b16ab1461023d5780633f4ba83a1461025257600080fd5b80628cc262146101de5780630700037d1461020457806318160ddd14610224575b600080fd5b6101f16101ec366004611103565b610439565b6040519081526020015b60405180910390f35b6101f1610212366004611103565b60096020526000908152604090205481565b600a546101f1565b6101f16104b6565b6101f160055481565b61025061024b366004611125565b6104cd565b005b6102506106c6565b600054600160a01b900460ff1660405190151581526020016101fb565b6101f1610285366004611103565b60086020526000908152604090205481565b6101f16102a5366004611103565b6001600160a01b03166000908152600b602052604090205490565b6102506106d8565b6102ef7f000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc88481565b6040516001600160a01b0390911681526020016101fb565b6101f160045481565b6101f16106ea565b610250610701565b6000546001600160a01b03166102ef565b7f000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc8846102ef565b6002546102ef906001600160a01b031681565b61025061037836600461113e565b610711565b61025061038b36600461113e565b6108cd565b61025061039e366004611103565b6109c2565b6102506103b1366004611103565b610b1c565b6101f160065481565b6102506103cd366004611125565b610b79565b6101f1610c07565b6102ef7f000000000000000000000000dc60c24de182b07cb3f3a9269f120d8c15c4b38181565b6101f160075481565b6101f160035481565b610250610421366004611103565b610c68565b61025061043436600461113e565b610ca3565b6001600160a01b0381166000908152600960209081526040808320546008909252822054670de0b6b3a76400009061046f610c07565b610479919061117e565b6001600160a01b0385166000908152600b602052604090205461049c9190611191565b6104a691906111a8565b6104b091906111ca565b92915050565b60006005546004546104c89190611191565b905090565b6104d5610e3f565b60006104df610c07565b6007556104ea6106ea565b6006556001600160a01b038116156105315761050581610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b600354421061054f5760055461054790836111a8565b600455610591565b60004260035461055f919061117e565b90506000600454826105719190611191565b60055490915061058182866111ca565b61058b91906111a8565b60045550505b6040516370a0823160e01b81523060048201526000907f000000000000000000000000dc60c24de182b07cb3f3a9269f120d8c15c4b3816001600160a01b0316906370a0823190602401602060405180830381865afa1580156105f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061c91906111dd565b90506005548161062c91906111a8565b60045411156106795760405162461bcd60e51b81526020600482015260146024820152730e4caeec2e4c840e4c2e8ca40e8dede40d0d2ced60631b60448201526064015b60405180910390fd5b42600681905560055461068b916111ca565b6003556040518381527fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9060200160405180910390a1505050565b6106ce610e3f565b6106d6610e6c565b565b6106e0610e3f565b6106d66000610ec1565b600060035442106106fc575060035490565b504290565b610709610e3f565b6106d6610f11565b610719610f54565b610721610f7e565b8161072a610c07565b6007556107356106ea565b6006556001600160a01b0381161561077c5761075081610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b82336001600160a01b038216148061079e57506002546001600160a01b031633145b6107ba5760405162461bcd60e51b8152600401610670906111f6565b600083116107fb5760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610670565b82600a5461080991906111ca565b600a556001600160a01b0384166000908152600b60205260409020546108309084906111ca565b6001600160a01b038086166000908152600b602052604090209190915561087b907f000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc88416333086610fa9565b836001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d846040516108b691815260200190565b60405180910390a250506108c960018055565b5050565b6108d5610e3f565b7f000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc8846001600160a01b0316826001600160a01b0316036109565760405162461bcd60e51b815260206004820152601d60248201527f63616e6e6f74207769746864726177207374616b696e6720746f6b656e0000006044820152606401610670565b61097c61096b6000546001600160a01b031690565b6001600160a01b0384169083611016565b604080516001600160a01b0384168152602081018390527f8c1256b8896378cd5044f80c202f9772b9d77dc85c8a6eb51967210b09bfaa28910160405180910390a15050565b6109ca610f54565b806109d3610c07565b6007556109de6106ea565b6006556001600160a01b03811615610a25576109f981610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b81336001600160a01b0382161480610a4757506002546001600160a01b031633145b610a635760405162461bcd60e51b8152600401610670906111f6565b6001600160a01b0383166000908152600960205260409020548015610b0d576001600160a01b03808516600090815260096020526040812055610ac9907f000000000000000000000000dc60c24de182b07cb3f3a9269f120d8c15c4b381168583611016565b836001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610b0491815260200190565b60405180910390a25b505050610b1960018055565b50565b610b24610e3f565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f20e752df2d1d9e69c7eb8f9e96973ff9b6f881a03503a3b5cac668cafb9a1ac8906020015b60405180910390a150565b610b81610e3f565b6003544211610bd25760405162461bcd60e51b815260206004820152601d60248201527f70726576696f75732072657761726473206e6f7420636f6d706c6574650000006044820152606401610670565b60058190556040518181527ffb46ca5a5e06d4540d6387b930a7c978bce0db5f449ec6b3f5d07c6e1d44f2d390602001610b6e565b6000600a54600003610c1a575060075490565b600a54600454600654610c2b6106ea565b610c35919061117e565b610c3f9190611191565b610c5190670de0b6b3a7640000611191565b610c5b91906111a8565b6007546104c891906111ca565b610c70610e3f565b6001600160a01b038116610c9a57604051631e4fbdf760e01b815260006004820152602401610670565b610b1981610ec1565b610cab610f54565b81610cb4610c07565b600755610cbf6106ea565b6006556001600160a01b03811615610d0657610cda81610439565b6001600160a01b0382166000908152600960209081526040808320939093556007546008909152919020555b82336001600160a01b0382161480610d2857506002546001600160a01b031633145b610d445760405162461bcd60e51b8152600401610670906111f6565b60008311610d855760405162461bcd60e51b815260206004820152600e60248201526d1a5b9d985b1a5908185b5bdd5b9d60921b6044820152606401610670565b82600a54610d93919061117e565b600a556001600160a01b0384166000908152600b6020526040902054610dba90849061117e565b6001600160a01b038086166000908152600b6020526040902091909155610e04907f000000000000000000000000cb193de9c28d275bbdb9603ca2421e6f12bfc884163385611016565b836001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5846040516108b691815260200190565b6000546001600160a01b031633146106d65760405163118cdaa760e01b8152336004820152602401610670565b610e7461104c565b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610f19610f7e565b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea43390565b600260015403610f7757604051633ee5aeb560e01b815260040160405180910390fd5b6002600155565b600054600160a01b900460ff16156106d65760405163d93c066560e01b815260040160405180910390fd5b6040516001600160a01b0384811660248301528381166044830152606482018390526110109186918216906323b872dd906084015b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611076565b50505050565b6040516001600160a01b0383811660248301526044820183905261104791859182169063a9059cbb90606401610fde565b505050565b600054600160a01b900460ff166106d657604051638dfc202b60e01b815260040160405180910390fd5b600080602060008451602086016000885af180611099576040513d6000823e3d81fd5b50506000513d915081156110b15780600114156110be565b6001600160a01b0384163b155b1561101057604051635274afe760e01b81526001600160a01b0385166004820152602401610670565b80356001600160a01b03811681146110fe57600080fd5b919050565b60006020828403121561111557600080fd5b61111e826110e7565b9392505050565b60006020828403121561113757600080fd5b5035919050565b6000806040838503121561115157600080fd5b61115a836110e7565b946020939093013593505050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104b0576104b0611168565b80820281158282048414176104b0576104b0611168565b6000826111c557634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156104b0576104b0611168565b6000602082840312156111ef57600080fd5b5051919050565b6020808252600c908201526b1d5b985d5d1a1bdc9a5e995960a21b60408201526060019056fea2646970667358221220affa16329a2727fa5e0446f6ce995cce0f9d0b2d9dd7033b0fa1e8a2c463a63664736f6c63430008180033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.