Contract 0x125A527949c4f6889C2D80ab0D95b17fE76357a3 7
Contract Overview
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xbb9d3f3a337007339a54fa75744c2d38b4d5d870508c25a9111d46380060088e | Set Vault | 36391720 | 506 days 2 hrs ago | 0xd83055eb9d43a7dac64c9ef3e117d43964dd01fe | IN | 0x125a527949c4f6889c2d80ab0d95b17fe76357a3 | 0 ETH | 0.00002476 | |
0x06756de24fdb99930321807a6d88bb0d5d4c862b1321faf59121e69951992f97 | Set Vault | 35195158 | 510 days 8 hrs ago | 0xd83055eb9d43a7dac64c9ef3e117d43964dd01fe | IN | 0x125a527949c4f6889c2d80ab0d95b17fe76357a3 | 0 ETH | 0.00001733 | |
0x0bc23c3ae817c76a245805ea5ab879002f10e9672911235a6eb4d7793ce77eb3 | 0x60806040 | 35194962 | 510 days 8 hrs ago | 0xd83055eb9d43a7dac64c9ef3e117d43964dd01fe | IN | Create: DpxEthStorage | 0 ETH | 0.00029522 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
DpxEthStorage
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing 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 v4.4.1 (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, _notEntered will be true 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; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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 v4.4.1 (token/ERC20/extensions/draft-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. */ 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]. */ 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.7.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-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; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } 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)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } 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"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } 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"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.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 * ==== * * [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://diligence.consensys.net/posts/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.5.11/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 v4.4.1 (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; } }
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.10; // Libs import {ReentrancyGuard} from "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; // Interfaces import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol"; /** * Olds unused user funds from LP vault. */ contract UserLPStorage is ReentrancyGuard, Ownable { using SafeERC20 for IERC20; uint256 public unusedDeposited; uint256 public unusedExited; IERC20 public lpToken; address public vault; constructor(address _lpToken) { lpToken = IERC20(_lpToken); } /** * Set vault that does the operations * @param _vault vault */ function setVault(address _vault) public onlyOwner { vault = _vault; } /** * Stores amount when the user signaled exit * @param _value amount to store */ function storeRefund(uint256 _value) public nonReentrant onlyVault { unusedExited += _value; lpToken.safeTransferFrom(vault, address(this), _value); emit StoredRefund(msg.sender, _value); } /** * Called when the user claims an exit. * @param _to user address * @param _value value sent to user */ function refundCustomer(address _to, uint256 _value) public nonReentrant onlyVault { if (_value > unusedExited) { revert NOT_ENOUGH_BALANCE(); } unusedExited -= _value; lpToken.safeTransfer(_to, _value); emit Refunded(msg.sender, _value, _to); } /** * Called when a user cancels a deposit. * @param _to user address * @param _value value sent to user */ function refundDeposit(address _to, uint256 _value) public nonReentrant onlyVault { if (_value > unusedDeposited) { revert NOT_ENOUGH_BALANCE(); } unusedDeposited -= _value; lpToken.safeTransfer(_to, _value); emit RefundedDeposit(msg.sender, _value, _to); } /** * Stores a user deposit before the funds are used next epoch. * @param _value value stored */ function storeDeposit(uint256 _value) public nonReentrant onlyVault { unusedDeposited += _value; lpToken.safeTransferFrom(vault, address(this), _value); emit StoredDeposit(msg.sender, _value); } /** * Sends all stored unused deposits to the vault (refunds are not sent) */ function depositToVault() public nonReentrant onlyVault { if (unusedDeposited != 0) { lpToken.safeTransfer(vault, unusedDeposited); emit DepositToVault(msg.sender, unusedDeposited); } unusedDeposited = 0; } /** * Sends a specific amount of deposits to the vault (refunds are not sent) * @param _value amount to send */ function depositToVault(uint256 _value) public nonReentrant onlyVault { if (_value > unusedDeposited) { revert NOT_ENOUGH_BALANCE(); } lpToken.safeTransfer(vault, _value); unusedDeposited -= _value; emit DepositToVault(msg.sender, _value); } function emergencyWithdraw(address _to) public onlyOwner { uint256 value = lpToken.balanceOf(address(this)); lpToken.safeTransfer(_to, value); } // ============================== Events ============================== /** * @notice Emmited when a refund is stored in this contract * @param _vault vault that stored * @param _value value that was stored */ event StoredRefund(address _vault, uint256 _value); /** * @notice Emmited when a deposit is stored in this contract * @param _vault vault that stored * @param _value value that was stored */ event StoredDeposit(address _vault, uint256 _value); /** * @notice Emmited when a claim is sent to the user * @param _vault vault that stored * @param _value value that was stored * @param _user user that received the funds */ event Refunded(address _vault, uint256 _value, address _user); /** * @notice Emmited when a deposit for a future epoch is sent to the user * @param _vault vault that stored * @param _value value that was stored * @param _user user that received the funds */ event RefundedDeposit(address _vault, uint256 _value, address _user); /** * @notice Emmited when the vault requests funds for next epoch * @param _vault vault that stored * @param _value value that was stored */ event DepositToVault(address _vault, uint256 _value); // ============================== Modifiers ============================== modifier onlyVault() { if (msg.sender != vault) { revert Only_Vault(); } _; } // ============================== Erors ============================== error Only_Vault(); // Only vault error NOT_ENOUGH_BALANCE(); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import {UserLPStorage} from "../UserLPStorage.sol"; contract DpxEthStorage is UserLPStorage { constructor(address _lpToken) UserLPStorage(_lpToken) {} }
{ "remappings": [ "ds-test/=lib/solmate/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": { "src/adapters/Curve2PoolAdapter.sol": { "Curve2PoolAdapter": "0xaE026E73a9F802fc2d26f3A5E394a22A00189505" }, "src/adapters/GmxAdapter.sol": { "GmxAdapter": "0x405775bE91Aab1D06a3aFBB5A1a6D2A5cf7F5D2a" }, "src/adapters/SsovAdapter.sol": { "SsovAdapter": "0xaa6348BfedFa57Ce6DB54529074905897B3d5D47" }, "src/adapters/SushiAdapter.sol": { "SushiAdapter": "0xf9D9f8d9141A59b5E6AD3A88f35b5010EDad71A2" }, "src/libraries/LPStrategyLib.sol": { "LPStrategyLib": "0xb330A28C8518c4095C8411191120D1739C2d8f60" }, "src/libraries/OneInchZapLib.sol": { "OneInchZapLib": "0x46be03489b730EA8a38E4383FA2AAbC0C9419fA5" } } }
[{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NOT_ENOUGH_BALANCE","type":"error"},{"inputs":[],"name":"Only_Vault","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"DepositToVault","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":"_vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"address","name":"_user","type":"address"}],"name":"Refunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"},{"indexed":false,"internalType":"address","name":"_user","type":"address"}],"name":"RefundedDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"StoredDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"StoredRefund","type":"event"},{"inputs":[],"name":"depositToVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"depositToVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"refundCustomer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"refundDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_vault","type":"address"}],"name":"setVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"storeDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"storeRefund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unusedDeposited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unusedExited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051610e79380380610e7983398101604081905261002f916100b6565b60016000558061003e33610064565b600480546001600160a01b0319166001600160a01b0392909216919091179055506100e6565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156100c857600080fd5b81516001600160a01b03811681146100df57600080fd5b9392505050565b610d84806100f56000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80636ff1c9bc1161009757806397495c721161006657806397495c72146101cc578063b0462296146101df578063f2fde38b146101f2578063fbfa77cf1461020557600080fd5b80636ff1c9bc14610197578063715018a6146101aa578063822313da146101b25780638da5cb5b146101bb57600080fd5b80634444ccae116100d35780634444ccae1461013e5780635215d054146101465780635fcbd285146101595780636817031b1461018457600080fd5b80630706835a146100fa5780631543a2d71461011657806315e8f69e1461012b575b600080fd5b61010360025481565b6040519081526020015b60405180910390f35b610129610124366004610bee565b610218565b005b610129610139366004610c18565b6102f7565b6101296103a6565b610129610154366004610bee565b610451565b60045461016c906001600160a01b031681565b6040516001600160a01b03909116815260200161010d565b610129610192366004610c31565b61051e565b6101296101a5366004610c31565b610548565b6101296105dc565b61010360035481565b6001546001600160a01b031661016c565b6101296101da366004610c18565b6105ee565b6101296101ed366004610c18565b61068c565b610129610200366004610c31565b61074c565b60055461016c906001600160a01b031681565b6102206107c7565b6005546001600160a01b0316331461024b5760405163106216eb60e31b815260040160405180910390fd5b60035481111561026e5760405163119563e560e31b815260040160405180910390fd5b80600360008282546102809190610c69565b909155505060045461029c906001600160a01b03168383610821565b60408051338152602081018390526001600160a01b038416918101919091527fb44b3631755227290f8fbd7b248fa4be405129d15351313e3c332a3fb9919417906060015b60405180910390a16102f36001600055565b5050565b6102ff6107c7565b6005546001600160a01b0316331461032a5760405163106216eb60e31b815260040160405180910390fd5b806003600082825461033c9190610c80565b909155505060055460045461035f916001600160a01b0391821691163084610889565b60408051338152602081018390527f32da4fd9d47c0c83cffd691914bba241ffb9e618734e21ecbbeb8b6b9d0e181d91015b60405180910390a16103a36001600055565b50565b6103ae6107c7565b6005546001600160a01b031633146103d95760405163106216eb60e31b815260040160405180910390fd5b6002541561044057600554600254600454610402926001600160a01b0391821692911690610821565b6002546040805133815260208101929092527f9f27a22fea017c09821db9e9e1700a69ddd6121050f29a783f8ca5f6876865f3910160405180910390a15b600060025561044f6001600055565b565b6104596107c7565b6005546001600160a01b031633146104845760405163106216eb60e31b815260040160405180910390fd5b6002548111156104a75760405163119563e560e31b815260040160405180910390fd5b80600260008282546104b99190610c69565b90915550506004546104d5906001600160a01b03168383610821565b60408051338152602081018390526001600160a01b038416918101919091527f75c3dbd9c6752428fa30bd9e8084cab8fa6abc3208f38092d8caceb60abfc7c8906060016102e1565b6105266108c7565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6105506108c7565b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c29190610c98565b6004549091506102f3906001600160a01b03168383610821565b6105e46108c7565b61044f6000610921565b6105f66107c7565b6005546001600160a01b031633146106215760405163106216eb60e31b815260040160405180910390fd5b80600260008282546106339190610c80565b9091555050600554600454610656916001600160a01b0391821691163084610889565b60408051338152602081018390527f65821c6fc831944f48f538cd7d8383bb4c21d5481c4ef70f32dba8ee9c07b92b9101610391565b6106946107c7565b6005546001600160a01b031633146106bf5760405163106216eb60e31b815260040160405180910390fd5b6002548111156106e25760405163119563e560e31b815260040160405180910390fd5b6005546004546106ff916001600160a01b03918216911683610821565b80600260008282546107119190610c69565b909155505060408051338152602081018390527f9f27a22fea017c09821db9e9e1700a69ddd6121050f29a783f8ca5f6876865f39101610391565b6107546108c7565b6001600160a01b0381166107be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103a381610921565b6002600054141561081a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107b5565b6002600055565b6040516001600160a01b03831660248201526044810182905261088490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610973565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108c19085906323b872dd60e01b9060840161084d565b50505050565b6001546001600160a01b0316331461044f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107b5565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006109c8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610a459092919063ffffffff16565b80519091501561088457808060200190518101906109e69190610cb1565b6108845760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107b5565b6060610a548484600085610a5c565b949350505050565b606082471015610abd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107b5565b600080866001600160a01b03168587604051610ad99190610cff565b60006040518083038185875af1925050503d8060008114610b16576040519150601f19603f3d011682016040523d82523d6000602084013e610b1b565b606091505b5091509150610b2c87838387610b37565b979650505050505050565b60608315610ba3578251610b9c576001600160a01b0385163b610b9c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107b5565b5081610a54565b610a548383815115610bb85781518083602001fd5b8060405162461bcd60e51b81526004016107b59190610d1b565b80356001600160a01b0381168114610be957600080fd5b919050565b60008060408385031215610c0157600080fd5b610c0a83610bd2565b946020939093013593505050565b600060208284031215610c2a57600080fd5b5035919050565b600060208284031215610c4357600080fd5b610c4c82610bd2565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7b57610c7b610c53565b500390565b60008219821115610c9357610c93610c53565b500190565b600060208284031215610caa57600080fd5b5051919050565b600060208284031215610cc357600080fd5b81518015158114610c4c57600080fd5b60005b83811015610cee578181015183820152602001610cd6565b838111156108c15750506000910152565b60008251610d11818460208701610cd3565b9190910192915050565b6020815260008251806020840152610d3a816040850160208701610cd3565b601f01601f1916919091016040019291505056fea264697066735822122047ef2876715a8526076c87761780ced195f04281ef6814fbfa38810f5c089fe664736f6c634300080a00330000000000000000000000000c1cf6883efa1b496b01f654e247b9b419873054
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636ff1c9bc1161009757806397495c721161006657806397495c72146101cc578063b0462296146101df578063f2fde38b146101f2578063fbfa77cf1461020557600080fd5b80636ff1c9bc14610197578063715018a6146101aa578063822313da146101b25780638da5cb5b146101bb57600080fd5b80634444ccae116100d35780634444ccae1461013e5780635215d054146101465780635fcbd285146101595780636817031b1461018457600080fd5b80630706835a146100fa5780631543a2d71461011657806315e8f69e1461012b575b600080fd5b61010360025481565b6040519081526020015b60405180910390f35b610129610124366004610bee565b610218565b005b610129610139366004610c18565b6102f7565b6101296103a6565b610129610154366004610bee565b610451565b60045461016c906001600160a01b031681565b6040516001600160a01b03909116815260200161010d565b610129610192366004610c31565b61051e565b6101296101a5366004610c31565b610548565b6101296105dc565b61010360035481565b6001546001600160a01b031661016c565b6101296101da366004610c18565b6105ee565b6101296101ed366004610c18565b61068c565b610129610200366004610c31565b61074c565b60055461016c906001600160a01b031681565b6102206107c7565b6005546001600160a01b0316331461024b5760405163106216eb60e31b815260040160405180910390fd5b60035481111561026e5760405163119563e560e31b815260040160405180910390fd5b80600360008282546102809190610c69565b909155505060045461029c906001600160a01b03168383610821565b60408051338152602081018390526001600160a01b038416918101919091527fb44b3631755227290f8fbd7b248fa4be405129d15351313e3c332a3fb9919417906060015b60405180910390a16102f36001600055565b5050565b6102ff6107c7565b6005546001600160a01b0316331461032a5760405163106216eb60e31b815260040160405180910390fd5b806003600082825461033c9190610c80565b909155505060055460045461035f916001600160a01b0391821691163084610889565b60408051338152602081018390527f32da4fd9d47c0c83cffd691914bba241ffb9e618734e21ecbbeb8b6b9d0e181d91015b60405180910390a16103a36001600055565b50565b6103ae6107c7565b6005546001600160a01b031633146103d95760405163106216eb60e31b815260040160405180910390fd5b6002541561044057600554600254600454610402926001600160a01b0391821692911690610821565b6002546040805133815260208101929092527f9f27a22fea017c09821db9e9e1700a69ddd6121050f29a783f8ca5f6876865f3910160405180910390a15b600060025561044f6001600055565b565b6104596107c7565b6005546001600160a01b031633146104845760405163106216eb60e31b815260040160405180910390fd5b6002548111156104a75760405163119563e560e31b815260040160405180910390fd5b80600260008282546104b99190610c69565b90915550506004546104d5906001600160a01b03168383610821565b60408051338152602081018390526001600160a01b038416918101919091527f75c3dbd9c6752428fa30bd9e8084cab8fa6abc3208f38092d8caceb60abfc7c8906060016102e1565b6105266108c7565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6105506108c7565b600480546040516370a0823160e01b815230928101929092526000916001600160a01b03909116906370a0823190602401602060405180830381865afa15801561059e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c29190610c98565b6004549091506102f3906001600160a01b03168383610821565b6105e46108c7565b61044f6000610921565b6105f66107c7565b6005546001600160a01b031633146106215760405163106216eb60e31b815260040160405180910390fd5b80600260008282546106339190610c80565b9091555050600554600454610656916001600160a01b0391821691163084610889565b60408051338152602081018390527f65821c6fc831944f48f538cd7d8383bb4c21d5481c4ef70f32dba8ee9c07b92b9101610391565b6106946107c7565b6005546001600160a01b031633146106bf5760405163106216eb60e31b815260040160405180910390fd5b6002548111156106e25760405163119563e560e31b815260040160405180910390fd5b6005546004546106ff916001600160a01b03918216911683610821565b80600260008282546107119190610c69565b909155505060408051338152602081018390527f9f27a22fea017c09821db9e9e1700a69ddd6121050f29a783f8ca5f6876865f39101610391565b6107546108c7565b6001600160a01b0381166107be5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6103a381610921565b6002600054141561081a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107b5565b6002600055565b6040516001600160a01b03831660248201526044810182905261088490849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610973565b505050565b6040516001600160a01b03808516602483015283166044820152606481018290526108c19085906323b872dd60e01b9060840161084d565b50505050565b6001546001600160a01b0316331461044f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107b5565b600180546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006109c8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610a459092919063ffffffff16565b80519091501561088457808060200190518101906109e69190610cb1565b6108845760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016107b5565b6060610a548484600085610a5c565b949350505050565b606082471015610abd5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016107b5565b600080866001600160a01b03168587604051610ad99190610cff565b60006040518083038185875af1925050503d8060008114610b16576040519150601f19603f3d011682016040523d82523d6000602084013e610b1b565b606091505b5091509150610b2c87838387610b37565b979650505050505050565b60608315610ba3578251610b9c576001600160a01b0385163b610b9c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107b5565b5081610a54565b610a548383815115610bb85781518083602001fd5b8060405162461bcd60e51b81526004016107b59190610d1b565b80356001600160a01b0381168114610be957600080fd5b919050565b60008060408385031215610c0157600080fd5b610c0a83610bd2565b946020939093013593505050565b600060208284031215610c2a57600080fd5b5035919050565b600060208284031215610c4357600080fd5b610c4c82610bd2565b9392505050565b634e487b7160e01b600052601160045260246000fd5b600082821015610c7b57610c7b610c53565b500390565b60008219821115610c9357610c93610c53565b500190565b600060208284031215610caa57600080fd5b5051919050565b600060208284031215610cc357600080fd5b81518015158114610c4c57600080fd5b60005b83811015610cee578181015183820152602001610cd6565b838111156108c15750506000910152565b60008251610d11818460208701610cd3565b9190910192915050565b6020815260008251806020840152610d3a816040850160208701610cd3565b601f01601f1916919091016040019291505056fea264697066735822122047ef2876715a8526076c87761780ced195f04281ef6814fbfa38810f5c089fe664736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000c1cf6883efa1b496b01f654e247b9b419873054
-----Decoded View---------------
Arg [0] : _lpToken (address): 0x0C1Cf6883efA1B496B01f654E247B9b419873054
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000c1cf6883efa1b496b01f654e247b9b419873054
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.