ETH Price: $3,593.18 (+3.81%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Redeem178156242023-07-31 21:17:11522 days ago1690838231IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0022214129.81959118
Redeem178156132023-07-31 21:14:59522 days ago1690838099IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0023565431.63356581
Redeem178154132023-07-31 20:34:59522 days ago1690835699IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0033025844.33300671
Redeem178154032023-07-31 20:32:59522 days ago1690835579IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0032231843.27409368
Redeem177974222023-07-29 8:11:11524 days ago1690618271IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0014843516.20771249
Redeem177973982023-07-29 8:06:23524 days ago1690617983IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0016853818.40277007
Redeem177971352023-07-29 7:13:35524 days ago1690614815IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.001380815.07709488
Redeem176344902023-07-06 11:24:35547 days ago1688642675IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0024368325.28915868
Set Backing172533702023-05-13 20:19:11601 days ago1684009151IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0012197442.48371362
Redeem172474352023-05-13 0:12:35602 days ago1683936755IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0030574540.93854714
Redeem171643072023-05-01 6:50:35613 days ago1682923835IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0039676350.0439931
Redeem171625532023-05-01 0:54:11614 days ago1682902451IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0040301844
Set Backing171147792023-04-24 7:51:59620 days ago1682322719IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.001209742.13370702
Redeem170767242023-04-18 23:11:11626 days ago1681859471IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0054148259.00305749
Redeem170584642023-04-16 9:06:11628 days ago1681635971IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0023606225.72270973
Set Backing170543302023-04-15 19:01:47629 days ago1681585307IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0007761527.03350999
Redeem170528262023-04-15 13:53:35629 days ago1681566815IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0023323625.41478342
Redeem170492292023-04-15 1:36:23630 days ago1681522583IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0024147226.31219927
Redeem170430462023-04-14 4:22:23630 days ago1681446143IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0025685228.04587246
Redeem170388742023-04-13 13:42:11631 days ago1681393331IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0029377237.06491289
Redeem170388062023-04-13 13:26:47631 days ago1681392407IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0041311542.86715922
Redeem170379302023-04-13 10:11:59631 days ago1681380719IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0039634743.19389259
Redeem170342392023-04-12 20:19:59632 days ago1681330799IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0022009524.03230942
Withdraw ERC20170330932023-04-12 16:25:35632 days ago1681316735IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0011781422.48885638
Withdraw ERC20170330872023-04-12 16:24:23632 days ago1681316663IN
0x4fE67Fd4...9eD9f3dB3
0 ETH0.0013200123.08210599
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SpiralRedeem

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion
File 1 of 9 : TokenRedeem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;

import { IStaking } from "../interfaces/IStaking.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract SpiralRedeem is Ownable {
    using SafeERC20 for IERC20;

    IERC20 public constant spiral = IERC20(0x85b6ACaBa696B9E4247175274F8263F99b4B9180);
    IERC20 public constant coil = IERC20(0x823E1B82cE1Dc147Bbdb25a203f046aFab1CE918);
    IERC20 public constant usdc = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);
    IStaking public constant staking = IStaking(0x6701E792b7CD344BaE763F27099eEb314A4b4943);

    uint256 public spiralBacking;

    uint256 public PENALTY = 100;
    uint256 public constant PENALTY_UNITS = 1000;
    address public Treasury = 0xC47eC74A753acb09e4679979AfC428cdE0209639;
    constructor() {}

    /***************************
             RESTRICTED
    *****************************/

    //In decimals of USDC
    function setBacking(uint128 amount_) external onlyOwner {
        spiralBacking = amount_;
    }

    function setPenaltyPercent(uint256 penalty_) external onlyOwner {
        require(penalty_ <= PENALTY_UNITS);
        PENALTY = penalty_;
    }

    function withdrawERC20(address token_, uint256 amount_) external onlyOwner {
        IERC20(token_).safeTransfer(Treasury, amount_ == 0 ? IERC20(token_).balanceOf(address(this)) : amount_);
    }

    /***************************
                VIEW
    *****************************/

    function usdcRedeemAmount(uint128 amount_) external view returns(uint256) {
        uint256 usdcAmount = (amount_ * spiralBacking) / staking.index();
        uint256 penalty = (usdcAmount * PENALTY) / PENALTY_UNITS;
        uint256 redeemAmount = usdcAmount - penalty;
        return redeemAmount;
    }

    /***************************
                REDEEM
    *****************************/

    function redeem(uint128 amount_) external {
        uint256 usdcAmount = (amount_ * spiralBacking) / staking.index();
        uint256 penalty = (usdcAmount * PENALTY) / PENALTY_UNITS;
        uint256 redeemAmount = usdcAmount - penalty;

        coil.transferFrom(msg.sender, address(this), amount_);
        usdc.transfer(msg.sender, redeemAmount);
    }
}

File 2 of 9 : IStaking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IStaking {
    function index() external view returns(uint256);
    function stakeFor(address, uint256) external;
}

File 3 of 9 : Ownable.sol
// 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);
    }
}

File 4 of 9 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 5 of 9 : SafeERC20.sol
// 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");
        }
    }
}

File 6 of 9 : Context.sol
// 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;
    }
}

File 7 of 9 : IERC20.sol
// 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);
}

File 8 of 9 : Address.sol
// 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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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);
            }
        }
    }
}

File 9 of 9 : draft-IERC20Permit.sol
// 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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"PENALTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PENALTY_UNITS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"Treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coil","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":"uint128","name":"amount_","type":"uint128"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"amount_","type":"uint128"}],"name":"setBacking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"penalty_","type":"uint256"}],"name":"setPenaltyPercent","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"spiral","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"spiralBacking","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract IStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"amount_","type":"uint128"}],"name":"usdcRedeemAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526064600255600380546001600160a01b03191673c47ec74a753acb09e4679979afc428cde020963917905534801561003b57600080fd5b506100453361004a565b61009a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b610e87806100a96000396000f3fe608060405234801561001057600080fd5b50600436106101005760003560e01c806371c263b211610097578063c259a40511610066578063c259a40514610234578063ec046e5d1461023d578063f2fde38b14610258578063fcdac2531461026b57600080fd5b806371c263b2146101dd5780638da5cb5b146101f057806391fd74e21461020e578063a1db97821461022157600080fd5b8063563df32f116100d3578063563df32f146101915780636348657c146101b15780636ee42c85146101cc578063715018a6146101d557600080fd5b80630239331414610105578063354df84f146101215780633e413bee146101365780634cf088d914610176575b600080fd5b61010e60025481565b6040519081526020015b60405180910390f35b61013461012f366004610c0c565b61027e565b005b61015173a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b610151736701e792b7cd344bae763f27099eeb314a4b494381565b6003546101519073ffffffffffffffffffffffffffffffffffffffff1681565b6101517385b6acaba696b9e4247175274f8263f99b4b918081565b61010e6103e881565b6101346104a5565b6101346101eb366004610c3e565b6104b9565b60005473ffffffffffffffffffffffffffffffffffffffff16610151565b61013461021c366004610c0c565b6104d5565b61013461022f366004610c80565b6104f4565b61010e60015481565b61015173823e1b82ce1dc147bbdb25a203f046afab1ce91881565b610134610266366004610caa565b6105d5565b61010e610279366004610c0c565b610691565b6000736701e792b7cd344bae763f27099eeb314a4b494373ffffffffffffffffffffffffffffffffffffffff16632986c0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103039190610cc5565b600154610322906fffffffffffffffffffffffffffffffff8516610d0d565b61032c9190610d4a565b905060006103e8600254836103419190610d0d565b61034b9190610d4a565b905060006103598284610d85565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526fffffffffffffffffffffffffffffffff8616604482015290915073823e1b82ce1dc147bbdb25a203f046afab1ce918906323b872dd906064016020604051808303816000875af11580156103e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104089190610d9e565b506040517fa9059cbb0000000000000000000000000000000000000000000000000000000081523360048201526024810182905273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb489063a9059cbb906044016020604051808303816000875af115801561047a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049e9190610d9e565b5050505050565b6104ad610776565b6104b760006107f7565b565b6104c1610776565b6103e88111156104d057600080fd5b600255565b6104dd610776565b6fffffffffffffffffffffffffffffffff16600155565b6104fc610776565b6003546105d19073ffffffffffffffffffffffffffffffffffffffff16821561052557826105b3565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8516906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b39190610cc5565b73ffffffffffffffffffffffffffffffffffffffff8516919061086c565b5050565b6105dd610776565b73ffffffffffffffffffffffffffffffffffffffff8116610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61068e816107f7565b50565b600080736701e792b7cd344bae763f27099eeb314a4b494373ffffffffffffffffffffffffffffffffffffffff16632986c0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107179190610cc5565b600154610736906fffffffffffffffffffffffffffffffff8616610d0d565b6107409190610d4a565b905060006103e8600254836107559190610d0d565b61075f9190610d4a565b9050600061076d8284610d85565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067c565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526108f99084906108fe565b505050565b6000610960826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a0a9092919063ffffffff16565b8051909150156108f9578080602001905181019061097e9190610d9e565b6108f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161067c565b6060610a198484600085610a23565b90505b9392505050565b606082471015610ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161067c565b73ffffffffffffffffffffffffffffffffffffffff85163b610b33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161067c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610b5c9190610de4565b60006040518083038185875af1925050503d8060008114610b99576040519150601f19603f3d011682016040523d82523d6000602084013e610b9e565b606091505b5091509150610bae828286610bb9565b979650505050505050565b60608315610bc8575081610a1c565b825115610bd85782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c9190610e00565b600060208284031215610c1e57600080fd5b81356fffffffffffffffffffffffffffffffff81168114610a1c57600080fd5b600060208284031215610c5057600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c7b57600080fd5b919050565b60008060408385031215610c9357600080fd5b610c9c83610c57565b946020939093013593505050565b600060208284031215610cbc57600080fd5b610a1c82610c57565b600060208284031215610cd757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610d4557610d45610cde565b500290565b600082610d80577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115610d9857610d98610cde565b92915050565b600060208284031215610db057600080fd5b81518015158114610a1c57600080fd5b60005b83811015610ddb578181015183820152602001610dc3565b50506000910152565b60008251610df6818460208701610dc0565b9190910192915050565b6020815260008251806020840152610e1f816040850160208701610dc0565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea264697066735822122008bce3b6c77126f53784c721c20e113105bbcea870976113ec8f179696e75fae64736f6c63430008100033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101005760003560e01c806371c263b211610097578063c259a40511610066578063c259a40514610234578063ec046e5d1461023d578063f2fde38b14610258578063fcdac2531461026b57600080fd5b806371c263b2146101dd5780638da5cb5b146101f057806391fd74e21461020e578063a1db97821461022157600080fd5b8063563df32f116100d3578063563df32f146101915780636348657c146101b15780636ee42c85146101cc578063715018a6146101d557600080fd5b80630239331414610105578063354df84f146101215780633e413bee146101365780634cf088d914610176575b600080fd5b61010e60025481565b6040519081526020015b60405180910390f35b61013461012f366004610c0c565b61027e565b005b61015173a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610118565b610151736701e792b7cd344bae763f27099eeb314a4b494381565b6003546101519073ffffffffffffffffffffffffffffffffffffffff1681565b6101517385b6acaba696b9e4247175274f8263f99b4b918081565b61010e6103e881565b6101346104a5565b6101346101eb366004610c3e565b6104b9565b60005473ffffffffffffffffffffffffffffffffffffffff16610151565b61013461021c366004610c0c565b6104d5565b61013461022f366004610c80565b6104f4565b61010e60015481565b61015173823e1b82ce1dc147bbdb25a203f046afab1ce91881565b610134610266366004610caa565b6105d5565b61010e610279366004610c0c565b610691565b6000736701e792b7cd344bae763f27099eeb314a4b494373ffffffffffffffffffffffffffffffffffffffff16632986c0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156102df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103039190610cc5565b600154610322906fffffffffffffffffffffffffffffffff8516610d0d565b61032c9190610d4a565b905060006103e8600254836103419190610d0d565b61034b9190610d4a565b905060006103598284610d85565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201526fffffffffffffffffffffffffffffffff8616604482015290915073823e1b82ce1dc147bbdb25a203f046afab1ce918906323b872dd906064016020604051808303816000875af11580156103e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104089190610d9e565b506040517fa9059cbb0000000000000000000000000000000000000000000000000000000081523360048201526024810182905273a0b86991c6218b36c1d19d4a2e9eb0ce3606eb489063a9059cbb906044016020604051808303816000875af115801561047a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049e9190610d9e565b5050505050565b6104ad610776565b6104b760006107f7565b565b6104c1610776565b6103e88111156104d057600080fd5b600255565b6104dd610776565b6fffffffffffffffffffffffffffffffff16600155565b6104fc610776565b6003546105d19073ffffffffffffffffffffffffffffffffffffffff16821561052557826105b3565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8516906370a0823190602401602060405180830381865afa15801561058f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b39190610cc5565b73ffffffffffffffffffffffffffffffffffffffff8516919061086c565b5050565b6105dd610776565b73ffffffffffffffffffffffffffffffffffffffff8116610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b61068e816107f7565b50565b600080736701e792b7cd344bae763f27099eeb314a4b494373ffffffffffffffffffffffffffffffffffffffff16632986c0e56040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107179190610cc5565b600154610736906fffffffffffffffffffffffffffffffff8616610d0d565b6107409190610d4a565b905060006103e8600254836107559190610d0d565b61075f9190610d4a565b9050600061076d8284610d85565b95945050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146104b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067c565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526108f99084906108fe565b505050565b6000610960826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610a0a9092919063ffffffff16565b8051909150156108f9578080602001905181019061097e9190610d9e565b6108f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161067c565b6060610a198484600085610a23565b90505b9392505050565b606082471015610ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161067c565b73ffffffffffffffffffffffffffffffffffffffff85163b610b33576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161067c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610b5c9190610de4565b60006040518083038185875af1925050503d8060008114610b99576040519150601f19603f3d011682016040523d82523d6000602084013e610b9e565b606091505b5091509150610bae828286610bb9565b979650505050505050565b60608315610bc8575081610a1c565b825115610bd85782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c9190610e00565b600060208284031215610c1e57600080fd5b81356fffffffffffffffffffffffffffffffff81168114610a1c57600080fd5b600060208284031215610c5057600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c7b57600080fd5b919050565b60008060408385031215610c9357600080fd5b610c9c83610c57565b946020939093013593505050565b600060208284031215610cbc57600080fd5b610a1c82610c57565b600060208284031215610cd757600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610d4557610d45610cde565b500290565b600082610d80577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b81810381811115610d9857610d98610cde565b92915050565b600060208284031215610db057600080fd5b81518015158114610a1c57600080fd5b60005b83811015610ddb578181015183820152602001610dc3565b50506000910152565b60008251610df6818460208701610dc0565b9190910192915050565b6020815260008251806020840152610e1f816040850160208701610dc0565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea264697066735822122008bce3b6c77126f53784c721c20e113105bbcea870976113ec8f179696e75fae64736f6c63430008100033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.