Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
Overview
Max Total Supply
75,489,230.330316015006076958 oVCX
Holders
227
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
OptionsToken
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; import {Owned} from "solmate/auth/Owned.sol"; import {ERC20} from "solmate/tokens/ERC20.sol"; import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; import {IOracle} from "./interfaces/IOracle.sol"; import {IERC20Mintable} from "./interfaces/IERC20Mintable.sol"; /// @title Options Token /// @author zefram.eth /// @author ruhum /// @notice Options token representing the right to purchase the underlying token /// at an oracle-specified rate. Similar to call options but with a variable strike /// price that's always at a certain discount to the market price. /// @dev Assumes the underlying token and the payment token both use 18 decimals. /// @dev Popcorn fork: instead of minting new underlying tokens, we transfer them /// from this contract. POP is already fully minted. contract OptionsToken is ERC20, Owned, IERC20Mintable { /// ----------------------------------------------------------------------- /// Library usage /// ----------------------------------------------------------------------- using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; /// ----------------------------------------------------------------------- /// Errors /// ----------------------------------------------------------------------- error OptionsToken__PastDeadline(); error OptionsToken__NotTokenAdmin(); error OptionsToken__SlippageTooHigh(); /// ----------------------------------------------------------------------- /// Events /// ----------------------------------------------------------------------- event Exercise(address indexed sender, address indexed recipient, uint256 amount, uint256 paymentAmount); event SetOracle(IOracle indexed newOracle); event SetTreasury(address indexed newTreasury); /// ----------------------------------------------------------------------- /// Immutable parameters /// ----------------------------------------------------------------------- /// @notice The contract that has the right to mint options tokens address public immutable tokenAdmin; /// @notice The token paid by the options token holder during redemption ERC20 public immutable paymentToken; /// @notice The underlying token purchased during redemption ERC20 public immutable underlyingToken; /// ----------------------------------------------------------------------- /// Storage variables /// ----------------------------------------------------------------------- /// @notice The oracle contract that provides the current price to purchase /// the underlying token while exercising options (the strike price) IOracle public oracle; /// @notice The treasury address which receives tokens paid during redemption address public treasury; /// ----------------------------------------------------------------------- /// Constructor /// ----------------------------------------------------------------------- constructor( string memory name_, string memory symbol_, address owner_, address tokenAdmin_, ERC20 paymentToken_, ERC20 underlyingToken_, IOracle oracle_, address treasury_ ) ERC20(name_, symbol_, 18) Owned(owner_) { tokenAdmin = tokenAdmin_; paymentToken = paymentToken_; underlyingToken = underlyingToken_; oracle = oracle_; treasury = treasury_; emit SetOracle(oracle_); emit SetTreasury(treasury_); } /// ----------------------------------------------------------------------- /// External functions /// ----------------------------------------------------------------------- /// @notice Called by the token admin to mint options tokens /// @param to The address that will receive the minted options tokens /// @param amount The amount of options tokens that will be minted function mint(address to, uint256 amount) external virtual override { /// ----------------------------------------------------------------------- /// Verification /// ----------------------------------------------------------------------- if (msg.sender != tokenAdmin) revert OptionsToken__NotTokenAdmin(); /// ----------------------------------------------------------------------- /// State updates /// ----------------------------------------------------------------------- // skip if amount is zero if (amount == 0) return; // mint options tokens _mint(to, amount); } /// @notice Exercises options tokens to purchase the underlying tokens. /// @dev The options tokens are not burnt but sent to address(0) to avoid messing up the /// inflation schedule. /// The oracle may revert if it cannot give a secure result. /// @param amount The amount of options tokens to exercise /// @param maxPaymentAmount The maximum acceptable amount to pay. Used for slippage protection. /// @param recipient The recipient of the purchased underlying tokens /// @return paymentAmount The amount paid to the treasury to purchase the underlying tokens function exercise(uint256 amount, uint256 maxPaymentAmount, address recipient) external virtual returns (uint256 paymentAmount) { return _exercise(amount, maxPaymentAmount, recipient); } /// @notice Exercises options tokens to purchase the underlying tokens. /// @dev The options tokens are not burnt but sent to address(0) to avoid messing up the /// inflation schedule. /// The oracle may revert if it cannot give a secure result. /// @param amount The amount of options tokens to exercise /// @param maxPaymentAmount The maximum acceptable amount to pay. Used for slippage protection. /// @param recipient The recipient of the purchased underlying tokens /// @param deadline The Unix timestamp (in seconds) after which the call will revert /// @return paymentAmount The amount paid to the treasury to purchase the underlying tokens function exercise(uint256 amount, uint256 maxPaymentAmount, address recipient, uint256 deadline) external virtual returns (uint256 paymentAmount) { if (block.timestamp > deadline) revert OptionsToken__PastDeadline(); return _exercise(amount, maxPaymentAmount, recipient); } /// ----------------------------------------------------------------------- /// Owner functions /// ----------------------------------------------------------------------- /// @notice Sets the oracle contract. Only callable by the owner. /// @param oracle_ The new oracle contract function setOracle(IOracle oracle_) external onlyOwner { oracle = oracle_; emit SetOracle(oracle_); } /// @notice Sets the treasury address. Only callable by the owner. /// @param treasury_ The new treasury address function setTreasury(address treasury_) external onlyOwner { treasury = treasury_; emit SetTreasury(treasury_); } /// ----------------------------------------------------------------------- /// Internal functions /// ----------------------------------------------------------------------- function _exercise(uint256 amount, uint256 maxPaymentAmount, address recipient) internal virtual returns (uint256 paymentAmount) { // skip if amount is zero if (amount == 0) return 0; // transfer options tokens from msg.sender to address(0) // we transfer instead of burn because TokenAdmin cares about totalSupply // which we don't want to change in order to follow the emission schedule transfer(address(0), amount); // transfer payment tokens from msg.sender to the treasury paymentAmount = amount.mulWadUp(oracle.getPrice()); if (paymentAmount > maxPaymentAmount) revert OptionsToken__SlippageTooHigh(); paymentToken.safeTransferFrom(msg.sender, treasury, paymentAmount); // transfer underlying tokens to recipient. // Will revert if this contract doesn't have enough tokens underlyingToken.transfer(recipient, amount); emit Exercise(msg.sender, recipient, amount, paymentAmount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Simple single owner authorization mixin. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument. mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Arithmetic library with operations for fixed-point numbers. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol) /// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol) library FixedPointMathLib { /*////////////////////////////////////////////////////////////// SIMPLIFIED FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ uint256 internal constant MAX_UINT256 = 2**256 - 1; uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s. function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down. } function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up. } function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down. } function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up. } /*////////////////////////////////////////////////////////////// LOW LEVEL FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ function mulDivDown( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // Divide x * y by the denominator. z := div(mul(x, y), denominator) } } function mulDivUp( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // If x * y modulo the denominator is strictly greater than 0, // 1 is added to round up the division of x * y by the denominator. z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator)) } } function rpow( uint256 x, uint256 n, uint256 scalar ) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { switch x case 0 { switch n case 0 { // 0 ** 0 = 1 z := scalar } default { // 0 ** n = 0 z := 0 } } default { switch mod(n, 2) case 0 { // If n is even, store scalar in z for now. z := scalar } default { // If n is odd, store x in z for now. z := x } // Shifting right by 1 is like dividing by 2. let half := shr(1, scalar) for { // Shift n right by 1 before looping to halve it. n := shr(1, n) } n { // Shift n right by 1 each iteration to halve it. n := shr(1, n) } { // Revert immediately if x ** 2 would overflow. // Equivalent to iszero(eq(div(xx, x), x)) here. if shr(128, x) { revert(0, 0) } // Store x squared. let xx := mul(x, x) // Round to the nearest number. let xxRound := add(xx, half) // Revert if xx + half overflowed. if lt(xxRound, xx) { revert(0, 0) } // Set x to scaled xxRound. x := div(xxRound, scalar) // If n is even: if mod(n, 2) { // Compute z * x. let zx := mul(z, x) // If z * x overflowed: if iszero(eq(div(zx, x), z)) { // Revert if x is non-zero. if iszero(iszero(x)) { revert(0, 0) } } // Round to the nearest number. let zxRound := add(zx, half) // Revert if zx + half overflowed. if lt(zxRound, zx) { revert(0, 0) } // Return properly scaled zxRound. z := div(zxRound, scalar) } } } } } /*////////////////////////////////////////////////////////////// GENERAL NUMBER UTILITIES //////////////////////////////////////////////////////////////*/ function sqrt(uint256 x) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { let y := x // We start y at x, which will help us make our initial estimate. z := 181 // The "correct" value is 1, but this saves a multiplication later. // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically. // We check y >= 2^(k + 8) but shift right by k bits // each branch to ensure that if x >= 256, then y >= 256. if iszero(lt(y, 0x10000000000000000000000000000000000)) { y := shr(128, y) z := shl(64, z) } if iszero(lt(y, 0x1000000000000000000)) { y := shr(64, y) z := shl(32, z) } if iszero(lt(y, 0x10000000000)) { y := shr(32, y) z := shl(16, z) } if iszero(lt(y, 0x1000000)) { y := shr(16, y) z := shl(8, z) } // Goal was to get z*z*y within a small factor of x. More iterations could // get y in a tighter range. Currently, we will have y in [256, 256*2^16). // We ensured y >= 256 so that the relative difference between y and y+1 is small. // That's not possible if x < 256 but we can just verify those cases exhaustively. // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256. // Correctness can be checked exhaustively for x < 256, so we assume y >= 256. // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps. // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256. // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18. // There is no overflow risk here since y < 2^136 after the first branch above. z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181. // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough. z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) // If x+1 is a perfect square, the Babylonian method cycles between // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor. // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case. // If you don't care whether the floor or ceil square root is returned, you can remove this statement. z := sub(z, lt(div(x, z), z)) } } function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Mod x by y. Note this will return // 0 instead of reverting if y is zero. z := mod(x, y) } } function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) { /// @solidity memory-safe-assembly assembly { // Divide x by y. Note this will return // 0 instead of reverting if y is zero. r := div(x, y) } } function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) { /// @solidity memory-safe-assembly assembly { // Add 1 to x * y if x % y > 0. Note this will // return 0 instead of reverting if y is zero. z := add(gt(mod(x, y), 0), div(x, y)) } } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.7.0 <0.9.0; /// @title Interface for an oracle of the options token's strike price /// @author zefram.eth /// @notice An oracle of the options token's strike price interface IOracle { /// @notice Computes the current strike price of the option /// @return price The strike price in terms of the payment token, scaled by 18 decimals. /// For example, if the payment token is $2 and the strike price is $4, the return value /// would be 2e18. function getPrice() external view returns (uint256 price); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity >=0.7.0 <0.9.0; interface IERC20Mintable { function mint(address to, uint256 amount) external; }
{ "remappings": [ "create3-factory/=lib/create3-factory/", "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 1000000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"tokenAdmin_","type":"address"},{"internalType":"contract ERC20","name":"paymentToken_","type":"address"},{"internalType":"contract ERC20","name":"underlyingToken_","type":"address"},{"internalType":"contract IOracle","name":"oracle_","type":"address"},{"internalType":"address","name":"treasury_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OptionsToken__NotTokenAdmin","type":"error"},{"inputs":[],"name":"OptionsToken__PastDeadline","type":"error"},{"inputs":[],"name":"OptionsToken__SlippageTooHigh","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"name":"Exercise","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IOracle","name":"newOracle","type":"address"}],"name":"SetOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newTreasury","type":"address"}],"name":"SetTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxPaymentAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"exercise","outputs":[{"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"maxPaymentAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"exercise","outputs":[{"internalType":"uint256","name":"paymentAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paymentToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IOracle","name":"oracle_","type":"address"}],"name":"setOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury_","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"underlyingToken","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101406040818152346200056c5762001e91803803809162000022828662000571565b843982016101009182848303126200056c5783516001600160401b0392908381116200056c57816200005691870162000595565b60209182870151908582116200056c576200007391880162000595565b91620000818488016200060c565b9662000090606082016200060c565b936200009f608083016200060c565b620000ad60a084016200060c565b9660c08401519460018060a01b03948587168097036200056c5760e0620000d591016200060c565b938751978b8911620005565760009880620000f18b5462000621565b92601f9384811162000505575b5085908483116001146200049d578c9262000491575b50508160011b916000199060031b1c19161789555b8151908c82116200047d57819060019362000145855462000621565b82811162000428575b5085918311600114620003c4578b92620003b8575b5050600019600383901b1c191690821b1781555b60126080524660a0528251885491818a620001928562000621565b92838352868301958782821691826000146200039857505060011462000358575b50620001c29250038262000571565b519020918051918201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452818301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a083015260a0825260c082019a828c10908c111762000344578a905251902060c052600680546001600160a01b03199081169b85169b8c179091559899979896977fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef39690867f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a360e05289526101209687528286600754161760075516809460085416176008557fd3b5d1e0ffaeff528910f3663f0adace7694ab8241d58e17a91351ced2e080318280a280a261183292836200065f843960805183610c34015260a0518361122a015260c05183611251015260e0518381816106a6015261141b015251828181610ca30152611613015251818181610d1201526116870152f35b634e487b7160e01b88526041600452602488fd5b8691508c8052818d20908d915b8583106200037f575050620001c2935082010138620001b3565b8054838801850152869450889390920191810162000365565b60ff19168852620001c295151560051b8501019250389150620001b39050565b01519050388062000163565b848c52858c208594509190601f1984168d5b88828210620004115750508411620003f7575b505050811b01815562000177565b015160001960f88460031b161c19169055388080620003e9565b8385015186558897909501949384019301620003d6565b90919250848c52858c208380860160051c82019288871062000473575b91869588929594930160051c01915b828110620004645750506200014e565b8e815586955087910162000454565b9250819262000445565b634e487b7160e01b8a52604160045260248afd5b01519050388062000114565b8c8052868d209250601f1984168d5b88828210620004ee575050908460019594939210620004d4575b505050811b01895562000129565b015160001960f88460031b161c19169055388080620004c6565b6001859682939686015181550195019301620004ac565b9091508b8052858c208480850160051c8201928886106200054c575b9085949392910160051c01905b8181106200053d5750620000fe565b8d81558493506001016200052e565b9250819262000521565b634e487b7160e01b600052604160045260246000fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176200055657604052565b919080601f840112156200056c578251906001600160401b038211620005565760405191602091620005d1601f8301601f191684018562000571565b8184528282870101116200056c5760005b818110620005f857508260009394955001015290565b8581018301518482018401528201620005e2565b51906001600160a01b03821682036200056c57565b90600182811c9216801562000653575b60208310146200063d57565b634e487b7160e01b600052602260045260246000fd5b91607f16916200063156fe60806040908082526004918236101561001757600080fd5b600092833560e01c92836306fdde0314610f2957508263095ea7b314610e8d57826318160ddd14610e5057826323b872dd14610d365782632495a59914610cc75782633013ce2914610c58578263313ce56714610bfc5782633644e51514610bc157826340c10f1914610b7b57826361d027b314610b2857826370a0823114610ac65782637adbf97314610a155782637dc0d1d0146109c25782637ecebe00146109605782638da5cb5b1461090d57826395d89b41146107f2578263a1d50c3a14610777578263a9059cbb146106ca578263b7e1917c1461065b578263d505accf1461035c578263d6379b721461030a578263dd62ed3e146102915750508063f0f44260146101e25763f2fde38b1461012f57600080fd5b346101df5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df577fffffffffffffffffffffffff0000000000000000000000000000000000000000610187611116565b6006549073ffffffffffffffffffffffffffffffffffffffff906101ae8284163314611184565b169182911617600655337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b80fd5b50346101df5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df5761021a611116565b73ffffffffffffffffffffffffffffffffffffffff9061023f82600654163314611184565b16807fffffffffffffffffffffffff000000000000000000000000000000000000000060085416176008557fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef38280a280f35b9091503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065760209282916102cf611116565b6102d761113e565b9173ffffffffffffffffffffffffffffffffffffffff8092168452865283832091168252845220549051908152f35b8280fd5b9083346101df5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df575061035560209261034a611161565b9060243590356114ca565b9051908152f35b8382346106575760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757610395611116565b9061039e61113e565b91604435606435926084359260ff8416809403610653574285106105f6576103c4611225565b9573ffffffffffffffffffffffffffffffffffffffff8092169586895260209560058752848a209889549960018b01905585519285898501957f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c987528b89870152169a8b606086015288608086015260a085015260c084015260c0835260e0830167ffffffffffffffff94848210868311176105c957818852845190206101008501927f19010000000000000000000000000000000000000000000000000000000000008452610102860152610122850152604281526101608401948186109086111761059d57848752519020835261018082015260a4356101a082015260c4356101c0909101528780528490889060809060015afa1561059357865116968715158061058a575b1561052f5786977f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259596975283528087208688528352818188205551908152a380f35b8360649251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152fd5b508488146104ec565b81513d88823e3d90fd5b60248c60418f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b5060248c60418f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60648860208451917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152fd5b8680fd5b5080fd5b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b83823461065757807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757602091610705611116565b8273ffffffffffffffffffffffffffffffffffffffff60243592338552600387528285206107348582546111e9565b90551692838152600386522081815401905582519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef843392a35160018152f35b9083346101df5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57506107b1611161565b60643542116107cb576103559060209360243590356114ca565b50517f94a5fd94000000000000000000000000000000000000000000000000000000008152fd5b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575780519082600180549161083483610fed565b808652928281169081156108c7575060011461086b575b50505061085d82610867940383611040565b51918291826110b0565b0390f35b94508085527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8286106108af5750505061085d826020610867958201019461084b565b80546020878701810191909152909501948101610892565b61086797508693506020925061085d9491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b8201019461084b565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600654169051908152f35b8382346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657578060209273ffffffffffffffffffffffffffffffffffffffff6109b2611116565b1681526005845220549051908152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600754169051908152f35b8390346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657573573ffffffffffffffffffffffffffffffffffffffff80821680920361030657610a7590600654163314611184565b807fffffffffffffffffffffffff000000000000000000000000000000000000000060075416176007557fd3b5d1e0ffaeff528910f3663f0adace7694ab8241d58e17a91351ced2e080318280a280f35b8382346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657578060209273ffffffffffffffffffffffffffffffffffffffff610b18611116565b1681526003845220549051908152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600854169051908152f35b838234610657577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57610bbe610bb5611116565b60243590611402565b80f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757602090610355611225565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905160ff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b9083346101df5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57610d6f611116565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610d9861113e565b946044358573ffffffffffffffffffffffffffffffffffffffff80951694858752602098848a958652838920338a52865283892054857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e2d575b50505086885260038552828820610e0e8582546111e9565b9055169586815260038452208181540190558551908152a35160018152f35b610e36916111e9565b90888a528652838920338a528652838920558a8085610df6565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020906002549051908152f35b9091503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657602092610ec9611116565b9183602435928392338252875273ffffffffffffffffffffffffffffffffffffffff8282209516948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b9250503461030657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657828054610f6681610fed565b808552916001918083169081156108c75750600114610f915750505061085d82610867940383611040565b80809650527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b828610610fd55750505061085d826020610867958201019461084b565b80546020878701810191909152909501948101610fb8565b90600182811c92168015611036575b602083101461100757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691610ffc565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761108157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60208082528251818301819052939260005b858110611102575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b8181018301518482016040015282016110c2565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b1561118b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b919082039182116111f657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000467f00000000000000000000000000000000000000000000000000000000000000000361127357507f000000000000000000000000000000000000000000000000000000000000000090565b6040518154829161128382610fed565b80825281602094858201946001908782821691826000146113c657505060011461136d575b506112b592500382611040565b51902091604051918201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f845260408301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a083015260a0825260c082019082821067ffffffffffffffff831117611340575060405251902090565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b87805286915087907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8583106113ae5750506112b59350820101386112a8565b80548388018501528694508893909201918101611397565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001688526112b595151560051b85010192503891506112a89050565b73ffffffffffffffffffffffffffffffffffffffff90817f00000000000000000000000000000000000000000000000000000000000000001633036114a057821561149b576002548381018091116111f6576000927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9260209260025516938484526003825260408420818154019055604051908152a3565b505050565b60046040517f7bbe6d0a000000000000000000000000000000000000000000000000000000008152fd5b9291909280156117f45760003381526020600381526040908183206114f08582546111e9565b9055828052600381528183208481540190558282518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef833392a373ffffffffffffffffffffffffffffffffffffffff9460048287600754168551928380927f98d5fdca0000000000000000000000000000000000000000000000000000000082525afa9081156117ea5785916117b9575b50670de0b6b3a764000090807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0487118102158202156117b557860290808204910615150197881161178c578184606488600854168651907f23b872dd00000000000000000000000000000000000000000000000000000000825233600483015260248201528b6044820152827f00000000000000000000000000000000000000000000000000000000000000005af13d15601f3d1160018751141617161561172f57818660448693865197889384927fa9059cbb000000000000000000000000000000000000000000000000000000008452169a8b60048401528a60248401527f0000000000000000000000000000000000000000000000000000000000000000165af1801561172357908892916116e9575b507fb1c971764663d561c0ec2baf395a55f33f0a79fabb35bbad580247ba2959523d935082519485528401523392a3565b915091928281813d831161171c575b6117028183611040565b810103126106575751801515036101df57829187916116b8565b503d6116f8565b508251903d90823e3d90fd5b5060649151907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152fd5b600483517fd193bd20000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b90508281813d83116117e3575b6117d08183611040565b810103126117df575138611584565b8480fd5b503d6117c6565b84513d87823e3d90fd5b50600092505056fea264697066735822122056a0b6a2dd9a59c28ae166956b5ab208cfe3ea999e5c42dc5a0c78a37654aafe64736f6c63430008130033000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000002c3b135cd7dc6c673b358bef214843dab346427800000000000000000000000003d103c547b43b5a76df7e652bd0bb61be0bd70d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ce246eea10988c495b4a90a905ee9237a0f91543000000000000000000000000e2871224b413f55c5a2fd21e49bd63a52e339b0300000000000000000000000047fd36abceeb9954ae9ea1581295ce9a8308655e00000000000000000000000000000000000000000000000000000000000000155643582043616c6c204f7074696f6e20546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000046f56435800000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040908082526004918236101561001757600080fd5b600092833560e01c92836306fdde0314610f2957508263095ea7b314610e8d57826318160ddd14610e5057826323b872dd14610d365782632495a59914610cc75782633013ce2914610c58578263313ce56714610bfc5782633644e51514610bc157826340c10f1914610b7b57826361d027b314610b2857826370a0823114610ac65782637adbf97314610a155782637dc0d1d0146109c25782637ecebe00146109605782638da5cb5b1461090d57826395d89b41146107f2578263a1d50c3a14610777578263a9059cbb146106ca578263b7e1917c1461065b578263d505accf1461035c578263d6379b721461030a578263dd62ed3e146102915750508063f0f44260146101e25763f2fde38b1461012f57600080fd5b346101df5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df577fffffffffffffffffffffffff0000000000000000000000000000000000000000610187611116565b6006549073ffffffffffffffffffffffffffffffffffffffff906101ae8284163314611184565b169182911617600655337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b80fd5b50346101df5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df5761021a611116565b73ffffffffffffffffffffffffffffffffffffffff9061023f82600654163314611184565b16807fffffffffffffffffffffffff000000000000000000000000000000000000000060085416176008557fcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef38280a280f35b9091503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103065760209282916102cf611116565b6102d761113e565b9173ffffffffffffffffffffffffffffffffffffffff8092168452865283832091168252845220549051908152f35b8280fd5b9083346101df5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df575061035560209261034a611161565b9060243590356114ca565b9051908152f35b8382346106575760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757610395611116565b9061039e61113e565b91604435606435926084359260ff8416809403610653574285106105f6576103c4611225565b9573ffffffffffffffffffffffffffffffffffffffff8092169586895260209560058752848a209889549960018b01905585519285898501957f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c987528b89870152169a8b606086015288608086015260a085015260c084015260c0835260e0830167ffffffffffffffff94848210868311176105c957818852845190206101008501927f19010000000000000000000000000000000000000000000000000000000000008452610102860152610122850152604281526101608401948186109086111761059d57848752519020835261018082015260a4356101a082015260c4356101c0909101528780528490889060809060015afa1561059357865116968715158061058a575b1561052f5786977f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259596975283528087208688528352818188205551908152a380f35b8360649251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152600e60248201527f494e56414c49445f5349474e45520000000000000000000000000000000000006044820152fd5b508488146104ec565b81513d88823e3d90fd5b60248c60418f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b5060248c60418f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60648860208451917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152fd5b8680fd5b5080fd5b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000003d103c547b43b5a76df7e652bd0bb61be0bd70d168152f35b83823461065757807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757602091610705611116565b8273ffffffffffffffffffffffffffffffffffffffff60243592338552600387528285206107348582546111e9565b90551692838152600386522081815401905582519081527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef843392a35160018152f35b9083346101df5760807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57506107b1611161565b60643542116107cb576103559060209360243590356114ca565b50517f94a5fd94000000000000000000000000000000000000000000000000000000008152fd5b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575780519082600180549161083483610fed565b808652928281169081156108c7575060011461086b575b50505061085d82610867940383611040565b51918291826110b0565b0390f35b94508085527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8286106108af5750505061085d826020610867958201019461084b565b80546020878701810191909152909501948101610892565b61086797508693506020925061085d9491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b8201019461084b565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600654169051908152f35b8382346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657578060209273ffffffffffffffffffffffffffffffffffffffff6109b2611116565b1681526005845220549051908152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600754169051908152f35b8390346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657573573ffffffffffffffffffffffffffffffffffffffff80821680920361030657610a7590600654163314611184565b807fffffffffffffffffffffffff000000000000000000000000000000000000000060075416176007557fd3b5d1e0ffaeff528910f3663f0adace7694ab8241d58e17a91351ced2e080318280a280f35b8382346106575760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657578060209273ffffffffffffffffffffffffffffffffffffffff610b18611116565b1681526003845220549051908152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126106575760209073ffffffffffffffffffffffffffffffffffffffff600854169051908152f35b838234610657577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57610bbe610bb5611116565b60243590611402565b80f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261065757602090610355611225565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905160ff7f0000000000000000000000000000000000000000000000000000000000000012168152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2168152f35b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020905173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ce246eea10988c495b4a90a905ee9237a0f91543168152f35b9083346101df5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101df57610d6f611116565b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610d9861113e565b946044358573ffffffffffffffffffffffffffffffffffffffff80951694858752602098848a958652838920338a52865283892054857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e2d575b50505086885260038552828820610e0e8582546111e9565b9055169586815260038452208181540190558551908152a35160018152f35b610e36916111e9565b90888a528652838920338a528652838920558a8085610df6565b83823461065757817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610657576020906002549051908152f35b9091503461030657817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657602092610ec9611116565b9183602435928392338252875273ffffffffffffffffffffffffffffffffffffffff8282209516948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b9250503461030657827ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261030657828054610f6681610fed565b808552916001918083169081156108c75750600114610f915750505061085d82610867940383611040565b80809650527f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b828610610fd55750505061085d826020610867958201019461084b565b80546020878701810191909152909501948101610fb8565b90600182811c92168015611036575b602083101461100757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691610ffc565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761108157604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60208082528251818301819052939260005b858110611102575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8460006040809697860101520116010190565b8181018301518482016040015282016110c2565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361113957565b1561118b57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b919082039182116111f657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000467f00000000000000000000000000000000000000000000000000000000000000010361127357507fb8af12c3f3b7324692eeb9ac1b004d2ef1ee9a9955f923575740c872a23b1d3c90565b6040518154829161128382610fed565b80825281602094858201946001908782821691826000146113c657505060011461136d575b506112b592500382611040565b51902091604051918201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f845260408301527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a083015260a0825260c082019082821067ffffffffffffffff831117611340575060405251902090565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b87805286915087907f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8583106113ae5750506112b59350820101386112a8565b80548388018501528694508893909201918101611397565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001688526112b595151560051b85010192503891506112a89050565b73ffffffffffffffffffffffffffffffffffffffff90817f00000000000000000000000003d103c547b43b5a76df7e652bd0bb61be0bd70d1633036114a057821561149b576002548381018091116111f6576000927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9260209260025516938484526003825260408420818154019055604051908152a3565b505050565b60046040517f7bbe6d0a000000000000000000000000000000000000000000000000000000008152fd5b9291909280156117f45760003381526020600381526040908183206114f08582546111e9565b9055828052600381528183208481540190558282518581527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef833392a373ffffffffffffffffffffffffffffffffffffffff9460048287600754168551928380927f98d5fdca0000000000000000000000000000000000000000000000000000000082525afa9081156117ea5785916117b9575b50670de0b6b3a764000090807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0487118102158202156117b557860290808204910615150197881161178c578184606488600854168651907f23b872dd00000000000000000000000000000000000000000000000000000000825233600483015260248201528b6044820152827f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc25af13d15601f3d1160018751141617161561172f57818660448693865197889384927fa9059cbb000000000000000000000000000000000000000000000000000000008452169a8b60048401528a60248401527f000000000000000000000000ce246eea10988c495b4a90a905ee9237a0f91543165af1801561172357908892916116e9575b507fb1c971764663d561c0ec2baf395a55f33f0a79fabb35bbad580247ba2959523d935082519485528401523392a3565b915091928281813d831161171c575b6117028183611040565b810103126106575751801515036101df57829187916116b8565b503d6116f8565b508251903d90823e3d90fd5b5060649151907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152fd5b600483517fd193bd20000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b90508281813d83116117e3575b6117d08183611040565b810103126117df575138611584565b8480fd5b503d6117c6565b84513d87823e3d90fd5b50600092505056fea264697066735822122056a0b6a2dd9a59c28ae166956b5ab208cfe3ea999e5c42dc5a0c78a37654aafe64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000002c3b135cd7dc6c673b358bef214843dab346427800000000000000000000000003d103c547b43b5a76df7e652bd0bb61be0bd70d000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000ce246eea10988c495b4a90a905ee9237a0f91543000000000000000000000000e2871224b413f55c5a2fd21e49bd63a52e339b0300000000000000000000000047fd36abceeb9954ae9ea1581295ce9a8308655e00000000000000000000000000000000000000000000000000000000000000155643582043616c6c204f7074696f6e20546f6b656e000000000000000000000000000000000000000000000000000000000000000000000000000000000000046f56435800000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): VCX Call Option Token
Arg [1] : symbol_ (string): oVCX
Arg [2] : owner_ (address): 0x2C3B135cd7dc6C673b358BEF214843DAb3464278
Arg [3] : tokenAdmin_ (address): 0x03d103c547B43b5a76df7e652BD0Bb61bE0BD70d
Arg [4] : paymentToken_ (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [5] : underlyingToken_ (address): 0xcE246eEa10988C495B4A90a905Ee9237a0f91543
Arg [6] : oracle_ (address): 0xe2871224b413F55c5a2Fd21E49bD63A52e339b03
Arg [7] : treasury_ (address): 0x47fd36ABcEeb9954ae9eA1581295Ce9A8308655E
-----Encoded View---------------
12 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 0000000000000000000000002c3b135cd7dc6c673b358bef214843dab3464278
Arg [3] : 00000000000000000000000003d103c547b43b5a76df7e652bd0bb61be0bd70d
Arg [4] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [5] : 000000000000000000000000ce246eea10988c495b4a90a905ee9237a0f91543
Arg [6] : 000000000000000000000000e2871224b413f55c5a2fd21e49bd63a52e339b03
Arg [7] : 00000000000000000000000047fd36abceeb9954ae9ea1581295ce9a8308655e
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [9] : 5643582043616c6c204f7074696f6e20546f6b656e0000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [11] : 6f56435800000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.