Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
HogVault
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IStrategy} from "../interfaces/IStrategy.sol"; /** * @dev Implementation of a vault to deposit funds for yield optimizing. * This is the contract that receives funds and that users interface with. * The yield optimizing strategy itself is implemented in a separate 'Strategy.sol' contract. */ contract HogVault is ERC20, Ownable, ReentrancyGuard { using SafeERC20 for IERC20; using SafeMath for uint256; struct StratCandidate { address implementation; uint proposedTime; } // The last proposed strategy to switch to. StratCandidate public stratCandidate; // The strategy currently in use by the vault. address public strategy; /** * @dev The stretegy's initialization status. Gives deployer 20 minutes after contract * construction (constructionTime) to set the strategy implementation. */ bool public initialized = false; uint public constructionTime; // The token the vault accepts and looks to maximize. IERC20 public token; // The minimum time it has to pass before a strat candidate can be approved. uint256 public immutable approvalDelay; /** * + WEBSITE DISCLAIMER + * While we have taken precautionary measures to protect our users, * it is imperative that you read, understand and agree to the disclaimer below: * * Using our platform may involve financial risk of loss. * Never invest more than what you can afford to lose. * Never invest in a HoG Vault with tokens you don't trust. * Never invest in a HoG Vault with tokens whose rules for minting you don’t agree with. * Ensure the accuracy of the contracts for the tokens in the HoG Vault. * Ensure the accuracy of the contracts for the HoG Vault and Strategy you are depositing in. * Check our documentation regularly for additional disclaimers and security assessments. * ...and of course: DO YOUR OWN RESEARCH!!! * * By accepting these terms, you agree that Hand of God, or any parties * affiliated with the deployment and management of these vaults or their attached strategies * are not liable for any financial losses you might incur as a direct or indirect * result of investing in any of the pools on the platform. */ mapping (address => bool) public hasReadAndAcceptedTerms; /** * @dev simple mappings used to determine PnL denominated in LP tokens, * as well as keep a generalized history of a user's protocol usage. */ mapping (address => uint) public cumulativeDeposits; mapping (address => uint) public cumulativeWithdrawals; event NewStratCandidate(address implementation); event UpgradeStrat(address implementation); event TermsAccepted(address user); event DepositsIncremented(address user, uint amount, uint total); event WithdrawalsIncremented(address user, uint amount, uint total); /** * @dev Sets the value of {token} to the token that the vault will * hold as underlying value. It initializes the vault's own 'moo' token. * This token is minted when someone does a deposit. It is burned in order * to withdraw the corresponding portion of the underlying assets. * @param _token the token to maximize. * @param _name the name of the vault token. * @param _symbol the symbol of the vault token. * @param _approvalDelay the delay before a new strat can be approved. */ constructor ( address _token, string memory _name, string memory _symbol, uint256 _approvalDelay ) public ERC20( string(_name), string(_symbol) ) { token = IERC20(_token); approvalDelay = _approvalDelay; constructionTime = block.timestamp; } /** * @dev Connects the vault to its initial strategy. One use only. * @notice deployer has only 20 minutes after construction to connect the initial strategy. * @param _strategy the vault's initial strategy */ function initialize(address _strategy) public onlyOwner returns (bool) { require(!initialized, "Contract is already initialized."); require(block.timestamp <= (constructionTime + 1200), "initialization period over, use timelock"); strategy = _strategy; initialized = true; return true; } /** * @dev Gives user access to the client * @notice this does not affect vault permissions, and is read from client-side */ function agreeToTerms() public returns (bool) { require(!hasReadAndAcceptedTerms[msg.sender], "you have already accepted the terms"); hasReadAndAcceptedTerms[msg.sender] = true; emit TermsAccepted(msg.sender); return true; } /** * @dev It calculates the total underlying value of {token} held by the system. * It takes into account the vault contract balance, the strategy contract balance * and the balance deployed in other contracts as part of the strategy. */ function balance() public view returns (uint) { return token.balanceOf(address(this)).add(IStrategy(strategy).balanceOf()); } /** * @dev Custom logic in here for how much the vault allows to be borrowed. * We return 100% of tokens for now. Under certain conditions we might * want to keep some of the system funds at hand in the vault, instead * of putting them to work. */ function available() public view returns (uint256) { return token.balanceOf(address(this)); } /** * @dev Function for various UIs to display the current value of one of our yield tokens. * Returns an uint256 with 18 decimals of how much underlying asset one vault share represents. */ function getPricePerFullShare() public view returns (uint256) { return totalSupply() == 0 ? 1e18 : balance().mul(1e18).div(totalSupply()); } /** * @dev A helper function to call deposit() with all the sender's funds. */ function depositAll() external { deposit(token.balanceOf(msg.sender)); } /** * @dev The entrypoint of funds into the system. People deposit with this function * into the vault. The vault is then in charge of sending funds into the strategy. * @notice the _before and _after variables are used to account properly for * 'burn-on-transaction' tokens. * @notice to ensure 'owner' can't sneak an implementation past the timelock, * it's set to true */ function deposit(uint _amount) public nonReentrant { require(_amount > 0, "please provide amount"); uint256 _pool = balance(); uint256 _before = token.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); uint256 _after = token.balanceOf(address(this)); _amount = _after.sub(_before); uint256 shares = 0; if (totalSupply() == 0) { shares = _amount; } else { shares = (_amount.mul(totalSupply())).div(_pool); } _mint(msg.sender, shares); earn(); incrementDeposits(_amount); } /** * @dev Function to send funds into the strategy and put them to work. It's primarily called * by the vault's deposit() function. */ function earn() public { uint _bal = available(); token.safeTransfer(strategy, _bal); IStrategy(strategy).deposit(); } /** * @dev A helper function to call withdraw() with all the sender's funds. */ function withdrawAll() external { withdraw(balanceOf(msg.sender)); } /** * @dev Function to exit the system. The vault will withdraw the required tokens * from the strategy and pay up the token holder. A proportional number of IOU * tokens are burned in the process. */ function withdraw(uint256 _shares) public nonReentrant { require(_shares > 0, "please provide amount"); uint256 r = (balance().mul(_shares)).div(totalSupply()); _burn(msg.sender, _shares); uint b = token.balanceOf(address(this)); if (b < r) { uint _withdraw = r.sub(b); IStrategy(strategy).withdraw(_withdraw); uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { r = b.add(_diff); } } token.safeTransfer(msg.sender, r); incrementWithdrawals(r); } /** * @dev Sets the candidate for the new strat to use with this vault. * @param _implementation The address of the candidate strategy. */ function proposeStrat(address _implementation) public onlyOwner { stratCandidate = StratCandidate({ implementation: _implementation, proposedTime: block.timestamp }); emit NewStratCandidate(_implementation); } /** * @dev It switches the active strat for the strat candidate. After upgrading, the * candidate implementation is set to the 0x00 address, and proposedTime to a time * happening in +100 years for safety. */ function upgradeStrat() public onlyOwner { require(stratCandidate.implementation != address(0), "There is no candidate"); require(stratCandidate.proposedTime.add(approvalDelay) < block.timestamp, "Delay has not passed"); emit UpgradeStrat(stratCandidate.implementation); IStrategy(strategy).retireStrat(); strategy = stratCandidate.implementation; stratCandidate.implementation = address(0); stratCandidate.proposedTime = 5000000000; earn(); } /* * @dev functions to increase user's cumulative deposits and withdrawals * @param _amount number of LP tokens being deposited/withdrawn */ function incrementDeposits(uint _amount) internal returns (bool) { uint initial = cumulativeDeposits[msg.sender]; uint newTotal = initial + _amount; cumulativeDeposits[msg.sender] = newTotal; emit DepositsIncremented(msg.sender, _amount, newTotal); return true; } function incrementWithdrawals(uint _amount) internal returns (bool) { uint initial = cumulativeWithdrawals[msg.sender]; uint newTotal = initial + _amount; cumulativeWithdrawals[msg.sender] = newTotal; emit WithdrawalsIncremented(msg.sender, _amount, newTotal); return true; } /** * @dev Rescues random funds stuck that the strat can't handle. * @param _token address of the token to rescue. */ function inCaseTokensGetStuck(address _token) external onlyOwner { require(_token != address(token), "!token"); uint256 amount = IERC20(_token).balanceOf(address(this)); IERC20(_token).safeTransfer(msg.sender, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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 v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @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 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; 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 require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // 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 v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * ==== Security Considerations * * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be * considered as an intention to spend the allowance in any specific way. The second is that because permits have * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be * generally recommended is: * * ```solidity * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} * doThing(..., value); * } * * function doThing(..., uint256 value) public { * token.safeTransferFrom(msg.sender, address(this), value); * ... * } * ``` * * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also * {SafeERC20-safeTransferFrom}). * * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so * contracts should have entry points that don't rely on permit. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. * * CAUTION: See Security Considerations above. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ 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 amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` 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 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 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 { using Address for address; /** * @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.encodeWithSelector(token.transfer.selector, 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.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 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. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @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. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @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). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } /** * @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 silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
pragma solidity ^0.8.0; interface IStrategy { //deposits all funds into the farm function deposit() external; //vault only - withdraws funds from the strategy function withdraw(uint256 _amount) external; //returns the balance of all tokens managed by the strategy function balanceOf() external view returns (uint256); //claims farmed tokens, distributes fees, and sells tokens to re-add to the LP & farm function harvest() external; //withdraws all tokens and sends them back to the vault function retireStrat() external; //pauses deposits, resets allowances, and withdraws all funds from farm function panic() external; //pauses deposits and resets allowances function pause() external; //unpauses deposits and maxes out allowances again function unpause() external; //updates Total Fee function updateTotalFee(uint _totalFee) external; //update Call Fee function updateCallFee(uint _callFee) external; //updates Treasury Fee function updateTreasuryFee(uint _treasuryFee) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint256","name":"_approvalDelay","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"}],"name":"DepositsIncremented","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"implementation","type":"address"}],"name":"NewStratCandidate","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":"user","type":"address"}],"name":"TermsAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"implementation","type":"address"}],"name":"UpgradeStrat","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"}],"name":"WithdrawalsIncremented","type":"event"},{"inputs":[],"name":"agreeToTerms","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"approvalDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"available","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"balance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"constructionTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cumulativeDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"cumulativeWithdrawals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"depositAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPricePerFullShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"hasReadAndAcceptedTerms","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"inCaseTokensGetStuck","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"initialize","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"name":"proposeStrat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stratCandidate","outputs":[{"internalType":"address","name":"implementation","type":"address"},{"internalType":"uint256","name":"proposedTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"strategy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeStrat","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_shares","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a06040526009805460ff60a01b1916905534801561001d57600080fd5b5060405161230138038061230183398101604081905261003c916101b3565b8282600361004a83826102cc565b50600461005782826102cc565b50505061007061006b6100a460201b60201c565b6100a8565b6001600655600b80546001600160a01b0319166001600160a01b039590951694909417909355505060805242600a5561038a565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261012157600080fd5b81516001600160401b0381111561013a5761013a6100fa565b604051601f8201601f19908116603f011681016001600160401b0381118282101715610168576101686100fa565b60405281815283820160200185101561018057600080fd5b60005b8281101561019f57602081860181015183830182015201610183565b506000918101602001919091529392505050565b600080600080608085870312156101c957600080fd5b84516001600160a01b03811681146101e057600080fd5b60208601519094506001600160401b038111156101fc57600080fd5b61020887828801610110565b604087015190945090506001600160401b0381111561022657600080fd5b61023287828801610110565b606096909601519497939650505050565b600181811c9082168061025757607f821691505b60208210810361027757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156102c757806000526020600020601f840160051c810160208510156102a45750805b601f840160051c820191505b818110156102c457600081556001016102b0565b50505b505050565b81516001600160401b038111156102e5576102e56100fa565b6102f9816102f38454610243565b8461027d565b6020601f82116001811461032d57600083156103155750848201515b600019600385901b1c1916600184901b1784556102c4565b600084815260208120601f198516915b8281101561035d578785015182556020948501946001909201910161033d565b508482101561037b5786840151600019600387901b60f8161c191681555b50505050600190811b01905550565b608051611f556103ac6000396000818161049e01526110cc0152611f556000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c8063a457c2d711610125578063d389800f116100ad578063e2d1e75c1161007c578063e2d1e75c14610499578063e6685244146104c0578063f06c5610146104c8578063f2fde38b146104d1578063fc0c546a146104e457600080fd5b8063d389800f14610463578063dd62ed3e1461046b578063de5f62681461047e578063def68a9c1461048657600080fd5b8063b3ca3188116100f4578063b3ca31881461040d578063b69ef8a81461042d578063b6b55f2514610435578063c4d66de814610448578063d17d35031461045b57600080fd5b8063a457c2d7146103b4578063a6c8220e146103c7578063a8c62e76146103e7578063a9059cbb146103fa57600080fd5b8063574445fb116101a857806376dfabb81161017757806376dfabb81461034157806377c7b8fc14610377578063853828b61461037f5780638da5cb5b1461038757806395d89b41146103ac57600080fd5b8063574445fb146102da5780635b12ff9b146102fd57806370a0823114610310578063715018a61461033957600080fd5b806323b872dd116101ef57806323b872dd146102885780632e1a7d4d1461029b578063313ce567146102b057806339509351146102bf57806348a0d754146102d257600080fd5b806306fdde0314610221578063095ea7b31461023f578063158ef93e1461026257806318160ddd14610276575b600080fd5b6102296104f7565b6040516102369190611d01565b60405180910390f35b61025261024d366004611d4b565b610589565b6040519015158152602001610236565b60095461025290600160a01b900460ff1681565b6002545b604051908152602001610236565b610252610296366004611d75565b6105a3565b6102ae6102a9366004611db2565b6105c7565b005b60405160128152602001610236565b6102526102cd366004611d4b565b6107f8565b61027a61081a565b6102526102e8366004611dcb565b600c6020526000908152604090205460ff1681565b6102ae61030b366004611dcb565b61088c565b61027a61031e366004611dcb565b6001600160a01b031660009081526020819052604090205490565b6102ae6108fb565b600754600854610358916001600160a01b03169082565b604080516001600160a01b039093168352602083019190915201610236565b61027a61090f565b6102ae61094c565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610236565b610229610965565b6102526103c2366004611d4b565b610974565b61027a6103d5366004611dcb565b600e6020526000908152604090205481565b600954610394906001600160a01b031681565b610252610408366004611d4b565b6109ef565b61027a61041b366004611dcb565b600d6020526000908152604090205481565b61027a6109fd565b6102ae610443366004611db2565b610aeb565b610252610456366004611dcb565b610caa565b610252610da7565b6102ae610e67565b61027a610479366004611de6565b610efc565b6102ae610f27565b6102ae610494366004611dcb565b610f95565b61027a7f000000000000000000000000000000000000000000000000000000000000000081565b6102ae611069565b61027a600a5481565b6102ae6104df366004611dcb565b611212565b600b54610394906001600160a01b031681565b60606003805461050690611e19565b80601f016020809104026020016040519081016040528092919081815260200182805461053290611e19565b801561057f5780601f106105545761010080835404028352916020019161057f565b820191906000526020600020905b81548152906001019060200180831161056257829003601f168201915b5050505050905090565b600033610597818585611288565b60019150505b92915050565b6000336105b18582856113ad565b6105bc858585611427565b506001949350505050565b6105cf6115cb565b6000811161061c5760405162461bcd60e51b81526020600482015260156024820152741c1b19585cd9481c1c9bdd9a591948185b5bdd5b9d605a1b60448201526064015b60405180910390fd5b600061064261062a60025490565b61063c846106366109fd565b90611624565b90611637565b905061064e3383611643565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610697573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bb9190611e53565b9050818110156107c85760006106d18383611772565b600954604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561071857600080fd5b505af115801561072c573d6000803e3d6000fd5b5050600b546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190611e53565b905060006107ad8285611772565b9050828110156107c4576107c1848261177e565b94505b5050505b600b546107df906001600160a01b0316338461178a565b6107e8826117ed565b5050506107f56001600655565b50565b60003361059781858561080b8383610efc565b6108159190611e82565b611288565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108879190611e53565b905090565b610894611868565b6040805180820182526001600160a01b038316808252426020928301819052600780546001600160a01b0319168317905560085591519182527f1aae2ec5647db56da2d513de40528ba3565c6057525637050660c4323bbac7df910160405180910390a150565b610903611868565b61090d60006118c2565b565b600061091a60025490565b1561093f5761088761092b60025490565b61063c670de0b6b3a76400006106366109fd565b50670de0b6b3a764000090565b3360009081526020819052604090205461090d906105c7565b60606004805461050690611e19565b600033816109828286610efc565b9050838110156109e25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610613565b6105bc8286868403611288565b600033610597818585611427565b6000610887600960009054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190611e53565b600b546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190611e53565b9061177e565b610af36115cb565b60008111610b3b5760405162461bcd60e51b81526020600482015260156024820152741c1b19585cd9481c1c9bdd9a591948185b5bdd5b9d605a1b6044820152606401610613565b6000610b456109fd565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb79190611e53565b600b54909150610bd2906001600160a01b0316333086611914565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f9190611e53565b9050610c4b8183611772565b93506000610c5860025490565b600003610c66575083610c80565b610c7d8461063c610c7660025490565b8890611624565b90505b610c8a338261194c565b610c92610e67565b610c9b85611a0b565b50505050506107f56001600655565b6000610cb4611868565b600954600160a01b900460ff1615610d0e5760405162461bcd60e51b815260206004820181905260248201527f436f6e747261637420697320616c726561647920696e697469616c697a65642e6044820152606401610613565b600a54610d1d906104b0611e82565b421115610d7d5760405162461bcd60e51b815260206004820152602860248201527f696e697469616c697a6174696f6e20706572696f64206f7665722c207573652060448201526774696d656c6f636b60c01b6064820152608401610613565b50600980546001600160a81b0319166001600160a01b03831617600160a01b17905560015b919050565b336000908152600c602052604081205460ff1615610e135760405162461bcd60e51b815260206004820152602360248201527f796f75206861766520616c726561647920616363657074656420746865207465604482015262726d7360e81b6064820152608401610613565b336000818152600c6020908152604091829020805460ff1916600117905590519182527fac268f7e07e832bf2aedd9f3ffd031ceb7a2b2553a288d8f509a34ee51f6b01f910160405180910390a150600190565b6000610e7161081a565b600954600b54919250610e91916001600160a01b0390811691168361178a565b600960009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ee157600080fd5b505af1158015610ef5573d6000803e3d6000fd5b5050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600b546040516370a0823160e01b815233600482015261090d916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f71573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104439190611e53565b610f9d611868565b600b546001600160a01b0390811690821603610fe45760405162461bcd60e51b815260206004820152600660248201526510ba37b5b2b760d11b6044820152606401610613565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f9190611e53565b90506110656001600160a01b038316338361178a565b5050565b611071611868565b6007546001600160a01b03166110c15760405162461bcd60e51b81526020600482015260156024820152745468657265206973206e6f2063616e64696461746560581b6044820152606401610613565b60085442906110f0907f000000000000000000000000000000000000000000000000000000000000000061177e565b106111345760405162461bcd60e51b815260206004820152601460248201527311195b185e481a185cc81b9bdd081c185cdcd95960621b6044820152606401610613565b6007546040516001600160a01b0390911681527f7f37d440e85aba7fbf641c4bda5ca4ef669a80bffaacde2aa8d9feb1b048c82c9060200160405180910390a1600960009054906101000a90046001600160a01b03166001600160a01b031663fb6177876040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111c457600080fd5b505af11580156111d8573d6000803e3d6000fd5b505060078054600980546001600160a01b03199081166001600160a01b03841617909155169055505064012a05f20060085561090d610e67565b61121a611868565b6001600160a01b03811661127f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b6107f5816118c2565b6001600160a01b0383166112ea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610613565b6001600160a01b03821661134b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610613565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006113b98484610efc565b9050600019811461142157818110156114145760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610613565b6114218484848403611288565b50505050565b6001600160a01b03831661148b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610613565b6001600160a01b0382166114ed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610613565b6001600160a01b038316600090815260208190526040902054818110156115655760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610613565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611421565b60026006540361161d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610613565b6002600655565b60006116308284611e95565b9392505050565b60006116308284611eac565b6001600160a01b0382166116a35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610613565b6001600160a01b038216600090815260208190526040902054818110156117175760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610613565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016113a0565b505050565b60006116308284611ece565b60006116308284611e82565b6040516001600160a01b03831660248201526044810182905261176d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a78565b336000908152600e6020526040812054816118088483611e82565b336000818152600e60209081526040918290208490558151928352820187905281018290529091507f9141e77ca2893646d48087b1b095075541605e9b87ca091e2057b651b1e62af2906060015b60405180910390a15060019392505050565b6005546001600160a01b0316331461090d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610613565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526114219085906323b872dd60e01b906084016117b6565b6001600160a01b0382166119a25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610613565b80600260008282546119b49190611e82565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b336000908152600d602052604081205481611a268483611e82565b336000818152600d60209081526040918290208490558151928352820187905281018290529091507f06a0895c1a837cd12ac50bcba0b79f680b66b790598e25e296d9e998e1b7520990606001611856565b6000611acd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b4d9092919063ffffffff16565b9050805160001480611aee575080806020019051810190611aee9190611ee1565b61176d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610613565b6060611b5c8484600085611b64565b949350505050565b606082471015611bc55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610613565b600080866001600160a01b03168587604051611be19190611f03565b60006040518083038185875af1925050503d8060008114611c1e576040519150601f19603f3d011682016040523d82523d6000602084013e611c23565b606091505b5091509150611c3487838387611c3f565b979650505050505050565b60608315611cae578251600003611ca7576001600160a01b0385163b611ca75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610613565b5081611b5c565b611b5c8383815115611cc35781518083602001fd5b8060405162461bcd60e51b81526004016106139190611d01565b60005b83811015611cf8578181015183820152602001611ce0565b50506000910152565b6020815260008251806020840152611d20816040850160208701611cdd565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610da257600080fd5b60008060408385031215611d5e57600080fd5b611d6783611d34565b946020939093013593505050565b600080600060608486031215611d8a57600080fd5b611d9384611d34565b9250611da160208501611d34565b929592945050506040919091013590565b600060208284031215611dc457600080fd5b5035919050565b600060208284031215611ddd57600080fd5b61163082611d34565b60008060408385031215611df957600080fd5b611e0283611d34565b9150611e1060208401611d34565b90509250929050565b600181811c90821680611e2d57607f821691505b602082108103611e4d57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611e6557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561059d5761059d611e6c565b808202811582820484141761059d5761059d611e6c565b600082611ec957634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561059d5761059d611e6c565b600060208284031215611ef357600080fd5b8151801515811461163057600080fd5b60008251611f15818460208701611cdd565b919091019291505056fea2646970667358221220e77bc6990be99769fe8a919331fbe52f3a0bec2fc3f960684c937e2ecd84a10c64736f6c634300081a0033000000000000000000000000784dd93f3c42dcbf88d45e6ad6d3cc20da169a60000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000000000015484f472d4f53204175746f636f6d706f756e64657200000000000000000000000000000000000000000000000000000000000000000000000000000000000008484f474f535f6163000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061021c5760003560e01c8063a457c2d711610125578063d389800f116100ad578063e2d1e75c1161007c578063e2d1e75c14610499578063e6685244146104c0578063f06c5610146104c8578063f2fde38b146104d1578063fc0c546a146104e457600080fd5b8063d389800f14610463578063dd62ed3e1461046b578063de5f62681461047e578063def68a9c1461048657600080fd5b8063b3ca3188116100f4578063b3ca31881461040d578063b69ef8a81461042d578063b6b55f2514610435578063c4d66de814610448578063d17d35031461045b57600080fd5b8063a457c2d7146103b4578063a6c8220e146103c7578063a8c62e76146103e7578063a9059cbb146103fa57600080fd5b8063574445fb116101a857806376dfabb81161017757806376dfabb81461034157806377c7b8fc14610377578063853828b61461037f5780638da5cb5b1461038757806395d89b41146103ac57600080fd5b8063574445fb146102da5780635b12ff9b146102fd57806370a0823114610310578063715018a61461033957600080fd5b806323b872dd116101ef57806323b872dd146102885780632e1a7d4d1461029b578063313ce567146102b057806339509351146102bf57806348a0d754146102d257600080fd5b806306fdde0314610221578063095ea7b31461023f578063158ef93e1461026257806318160ddd14610276575b600080fd5b6102296104f7565b6040516102369190611d01565b60405180910390f35b61025261024d366004611d4b565b610589565b6040519015158152602001610236565b60095461025290600160a01b900460ff1681565b6002545b604051908152602001610236565b610252610296366004611d75565b6105a3565b6102ae6102a9366004611db2565b6105c7565b005b60405160128152602001610236565b6102526102cd366004611d4b565b6107f8565b61027a61081a565b6102526102e8366004611dcb565b600c6020526000908152604090205460ff1681565b6102ae61030b366004611dcb565b61088c565b61027a61031e366004611dcb565b6001600160a01b031660009081526020819052604090205490565b6102ae6108fb565b600754600854610358916001600160a01b03169082565b604080516001600160a01b039093168352602083019190915201610236565b61027a61090f565b6102ae61094c565b6005546001600160a01b03165b6040516001600160a01b039091168152602001610236565b610229610965565b6102526103c2366004611d4b565b610974565b61027a6103d5366004611dcb565b600e6020526000908152604090205481565b600954610394906001600160a01b031681565b610252610408366004611d4b565b6109ef565b61027a61041b366004611dcb565b600d6020526000908152604090205481565b61027a6109fd565b6102ae610443366004611db2565b610aeb565b610252610456366004611dcb565b610caa565b610252610da7565b6102ae610e67565b61027a610479366004611de6565b610efc565b6102ae610f27565b6102ae610494366004611dcb565b610f95565b61027a7f000000000000000000000000000000000000000000000000000000000001518081565b6102ae611069565b61027a600a5481565b6102ae6104df366004611dcb565b611212565b600b54610394906001600160a01b031681565b60606003805461050690611e19565b80601f016020809104026020016040519081016040528092919081815260200182805461053290611e19565b801561057f5780601f106105545761010080835404028352916020019161057f565b820191906000526020600020905b81548152906001019060200180831161056257829003601f168201915b5050505050905090565b600033610597818585611288565b60019150505b92915050565b6000336105b18582856113ad565b6105bc858585611427565b506001949350505050565b6105cf6115cb565b6000811161061c5760405162461bcd60e51b81526020600482015260156024820152741c1b19585cd9481c1c9bdd9a591948185b5bdd5b9d605a1b60448201526064015b60405180910390fd5b600061064261062a60025490565b61063c846106366109fd565b90611624565b90611637565b905061064e3383611643565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610697573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bb9190611e53565b9050818110156107c85760006106d18383611772565b600954604051632e1a7d4d60e01b8152600481018390529192506001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561071857600080fd5b505af115801561072c573d6000803e3d6000fd5b5050600b546040516370a0823160e01b8152306004820152600093506001600160a01b0390911691506370a0823190602401602060405180830381865afa15801561077b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079f9190611e53565b905060006107ad8285611772565b9050828110156107c4576107c1848261177e565b94505b5050505b600b546107df906001600160a01b0316338461178a565b6107e8826117ed565b5050506107f56001600655565b50565b60003361059781858561080b8383610efc565b6108159190611e82565b611288565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108879190611e53565b905090565b610894611868565b6040805180820182526001600160a01b038316808252426020928301819052600780546001600160a01b0319168317905560085591519182527f1aae2ec5647db56da2d513de40528ba3565c6057525637050660c4323bbac7df910160405180910390a150565b610903611868565b61090d60006118c2565b565b600061091a60025490565b1561093f5761088761092b60025490565b61063c670de0b6b3a76400006106366109fd565b50670de0b6b3a764000090565b3360009081526020819052604090205461090d906105c7565b60606004805461050690611e19565b600033816109828286610efc565b9050838110156109e25760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610613565b6105bc8286868403611288565b600033610597818585611427565b6000610887600960009054906101000a90046001600160a01b03166001600160a01b031663722713f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190611e53565b600b546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190611e53565b9061177e565b610af36115cb565b60008111610b3b5760405162461bcd60e51b81526020600482015260156024820152741c1b19585cd9481c1c9bdd9a591948185b5bdd5b9d605a1b6044820152606401610613565b6000610b456109fd565b600b546040516370a0823160e01b81523060048201529192506000916001600160a01b03909116906370a0823190602401602060405180830381865afa158015610b93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb79190611e53565b600b54909150610bd2906001600160a01b0316333086611914565b600b546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f9190611e53565b9050610c4b8183611772565b93506000610c5860025490565b600003610c66575083610c80565b610c7d8461063c610c7660025490565b8890611624565b90505b610c8a338261194c565b610c92610e67565b610c9b85611a0b565b50505050506107f56001600655565b6000610cb4611868565b600954600160a01b900460ff1615610d0e5760405162461bcd60e51b815260206004820181905260248201527f436f6e747261637420697320616c726561647920696e697469616c697a65642e6044820152606401610613565b600a54610d1d906104b0611e82565b421115610d7d5760405162461bcd60e51b815260206004820152602860248201527f696e697469616c697a6174696f6e20706572696f64206f7665722c207573652060448201526774696d656c6f636b60c01b6064820152608401610613565b50600980546001600160a81b0319166001600160a01b03831617600160a01b17905560015b919050565b336000908152600c602052604081205460ff1615610e135760405162461bcd60e51b815260206004820152602360248201527f796f75206861766520616c726561647920616363657074656420746865207465604482015262726d7360e81b6064820152608401610613565b336000818152600c6020908152604091829020805460ff1916600117905590519182527fac268f7e07e832bf2aedd9f3ffd031ceb7a2b2553a288d8f509a34ee51f6b01f910160405180910390a150600190565b6000610e7161081a565b600954600b54919250610e91916001600160a01b0390811691168361178a565b600960009054906101000a90046001600160a01b03166001600160a01b031663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ee157600080fd5b505af1158015610ef5573d6000803e3d6000fd5b5050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600b546040516370a0823160e01b815233600482015261090d916001600160a01b0316906370a0823190602401602060405180830381865afa158015610f71573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104439190611e53565b610f9d611868565b600b546001600160a01b0390811690821603610fe45760405162461bcd60e51b815260206004820152600660248201526510ba37b5b2b760d11b6044820152606401610613565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f9190611e53565b90506110656001600160a01b038316338361178a565b5050565b611071611868565b6007546001600160a01b03166110c15760405162461bcd60e51b81526020600482015260156024820152745468657265206973206e6f2063616e64696461746560581b6044820152606401610613565b60085442906110f0907f000000000000000000000000000000000000000000000000000000000001518061177e565b106111345760405162461bcd60e51b815260206004820152601460248201527311195b185e481a185cc81b9bdd081c185cdcd95960621b6044820152606401610613565b6007546040516001600160a01b0390911681527f7f37d440e85aba7fbf641c4bda5ca4ef669a80bffaacde2aa8d9feb1b048c82c9060200160405180910390a1600960009054906101000a90046001600160a01b03166001600160a01b031663fb6177876040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111c457600080fd5b505af11580156111d8573d6000803e3d6000fd5b505060078054600980546001600160a01b03199081166001600160a01b03841617909155169055505064012a05f20060085561090d610e67565b61121a611868565b6001600160a01b03811661127f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610613565b6107f5816118c2565b6001600160a01b0383166112ea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610613565b6001600160a01b03821661134b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610613565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b60006113b98484610efc565b9050600019811461142157818110156114145760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610613565b6114218484848403611288565b50505050565b6001600160a01b03831661148b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610613565b6001600160a01b0382166114ed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610613565b6001600160a01b038316600090815260208190526040902054818110156115655760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610613565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611421565b60026006540361161d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610613565b6002600655565b60006116308284611e95565b9392505050565b60006116308284611eac565b6001600160a01b0382166116a35760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610613565b6001600160a01b038216600090815260208190526040902054818110156117175760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610613565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91016113a0565b505050565b60006116308284611ece565b60006116308284611e82565b6040516001600160a01b03831660248201526044810182905261176d90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611a78565b336000908152600e6020526040812054816118088483611e82565b336000818152600e60209081526040918290208490558151928352820187905281018290529091507f9141e77ca2893646d48087b1b095075541605e9b87ca091e2057b651b1e62af2906060015b60405180910390a15060019392505050565b6005546001600160a01b0316331461090d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610613565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6040516001600160a01b03808516602483015283166044820152606481018290526114219085906323b872dd60e01b906084016117b6565b6001600160a01b0382166119a25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610613565b80600260008282546119b49190611e82565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b336000908152600d602052604081205481611a268483611e82565b336000818152600d60209081526040918290208490558151928352820187905281018290529091507f06a0895c1a837cd12ac50bcba0b79f680b66b790598e25e296d9e998e1b7520990606001611856565b6000611acd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611b4d9092919063ffffffff16565b9050805160001480611aee575080806020019051810190611aee9190611ee1565b61176d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610613565b6060611b5c8484600085611b64565b949350505050565b606082471015611bc55760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610613565b600080866001600160a01b03168587604051611be19190611f03565b60006040518083038185875af1925050503d8060008114611c1e576040519150601f19603f3d011682016040523d82523d6000602084013e611c23565b606091505b5091509150611c3487838387611c3f565b979650505050505050565b60608315611cae578251600003611ca7576001600160a01b0385163b611ca75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610613565b5081611b5c565b611b5c8383815115611cc35781518083602001fd5b8060405162461bcd60e51b81526004016106139190611d01565b60005b83811015611cf8578181015183820152602001611ce0565b50506000910152565b6020815260008251806020840152611d20816040850160208701611cdd565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610da257600080fd5b60008060408385031215611d5e57600080fd5b611d6783611d34565b946020939093013593505050565b600080600060608486031215611d8a57600080fd5b611d9384611d34565b9250611da160208501611d34565b929592945050506040919091013590565b600060208284031215611dc457600080fd5b5035919050565b600060208284031215611ddd57600080fd5b61163082611d34565b60008060408385031215611df957600080fd5b611e0283611d34565b9150611e1060208401611d34565b90509250929050565b600181811c90821680611e2d57607f821691505b602082108103611e4d57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611e6557600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561059d5761059d611e6c565b808202811582820484141761059d5761059d611e6c565b600082611ec957634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561059d5761059d611e6c565b600060208284031215611ef357600080fd5b8151801515811461163057600080fd5b60008251611f15818460208701611cdd565b919091019291505056fea2646970667358221220e77bc6990be99769fe8a919331fbe52f3a0bec2fc3f960684c937e2ecd84a10c64736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000784dd93f3c42dcbf88d45e6ad6d3cc20da169a60000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000151800000000000000000000000000000000000000000000000000000000000000015484f472d4f53204175746f636f6d706f756e64657200000000000000000000000000000000000000000000000000000000000000000000000000000000000008484f474f535f6163000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _token (address): 0x784DD93F3c42DCbF88D45E6ad6D3CC20dA169a60
Arg [1] : _name (string): HOG-OS Autocompounder
Arg [2] : _symbol (string): HOGOS_ac
Arg [3] : _approvalDelay (uint256): 86400
-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 000000000000000000000000784dd93f3c42dcbf88d45e6ad6d3cc20da169a60
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000015180
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [5] : 484f472d4f53204175746f636f6d706f756e6465720000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [7] : 484f474f535f6163000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.