ETH Price: $3,319.18 (-2.08%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Migrator

Compiler Version
v0.8.10+commit.fc410830

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
File 1 of 7 : Migrator.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "OpenZeppelin/[email protected]/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "./Governable.sol";

interface IStaking {
    function delegates(address staker) external view returns (address);

    // From OGVStaking.sol
    function unstakeFrom(address staker, uint256[] memory lockupIds) external returns (uint256, uint256);

    // From ExponentialStaking.sol
    function stake(uint256 amountIn, uint256 duration, address to, bool stakeRewards, int256 lockupId) external;
}

contract Migrator is Governable {
    ERC20Burnable public immutable ogv;
    ERC20Burnable public immutable ogn;

    IStaking public immutable ogvStaking;
    IStaking public immutable ognStaking;

    // Fixed conversion rate
    uint256 public constant CONVERSION_RATE = 0.09137 ether;

    uint256 public endTime;

    event TokenExchanged(uint256 ogvAmountIn, uint256 ognAmountOut);
    event Decommissioned();
    event LockupsMigrated(address indexed user, uint256[] ogvLockupIds, uint256 newStakeAmount, uint256 newDuration);

    error MigrationAlreadyStarted();
    error ContractInsolvent(uint256 expectedOGN, uint256 availableOGN);
    error LockupIdsRequired();
    error InvalidStakeAmount();

    constructor(address _ogv, address _ogn, address _ogvStaking, address _ognStaking) {
        ogv = ERC20Burnable(_ogv);
        ogn = ERC20Burnable(_ogn);
        ogvStaking = IStaking(_ogvStaking);
        ognStaking = IStaking(_ognStaking);
    }

    /**
     * @notice Solvency Checks
     *
     * This ensures that the contract always has enough OGN to
     * continue with the migration.
     * However, it doesn't revert if the difference is in favour
     * of the contract (i.e. has more OGN than expected).
     */
    modifier isSolvent() {
        _;

        uint256 availableOGN = ogn.balanceOf(address(this));
        uint256 maxOGNNeeded = (ogv.totalSupply() * CONVERSION_RATE) / 1 ether;

        if (availableOGN < maxOGNNeeded) {
            revert ContractInsolvent(maxOGNNeeded, availableOGN);
        }
    }

    /**
     * @notice Starts the migration and sets it to end after
     *          365 days. Also, approves xOGN to transfer OGN
     *          held in this contract. Can be invoked only once
     */
    function start() external onlyGovernor isSolvent {
        if (endTime != 0) {
            revert MigrationAlreadyStarted();
        }

        // Max approve
        ogn.approve(address(ognStaking), type(uint256).max);

        endTime = block.timestamp + 365 days;
    }

    /**
     * @notice Computes the amount of OGN needed for migration
     *          and if the contract has more OGN than that, it
     *          transfers it back to the treasury. If migration complete, transfers all.
     * @param treasury Address that receives excess OGN
     */
    function transferExcessTokens(address treasury) external onlyGovernor {
        uint256 availableOGN = ogn.balanceOf(address(this));

        if (endTime == 0 || isMigrationActive()) {
            uint256 maxOGNNeeded = (ogv.totalSupply() * CONVERSION_RATE) / 1 ether;
            ogn.transfer(treasury, availableOGN - maxOGNNeeded);
        } else {
            emit Decommissioned();
            ogn.transfer(treasury, availableOGN);
        }
    }

    /**
     * @notice Returns the active status of the migration.
     * @return True if migration has started and has not ended yet.
     */
    function isMigrationActive() public view returns (bool) {
        return endTime > 0 && block.timestamp < endTime;
    }

    /**
     * @notice Migrates the specified amount of OGV to OGN.
     *          Does not check if migration is active since
     *          that's okay (until we decommission).
     * @param ogvAmount Amount of OGV to migrate
     * @return ognReceived OGN Received
     */
    function migrate(uint256 ogvAmount) external isSolvent returns (uint256 ognReceived) {
        return _migrate(ogvAmount, msg.sender);
    }

    /**
     * @notice Migrates OGV stakes to OGN. Can also include unstaked OGN & OGV
     *          balances from the user's wallet (if specified).
     *          Does not check if migration is active since that's okay (until
     *          we decommission the contract).
     * @param lockupIds OGV Lockup IDs to be migrated
     * @param ogvAmountFromWallet Extra OGV balance from user's wallet to migrate & stake
     * @param ognAmountFromWallet Extra OGN balance from user's wallet to stake
     * @param migrateRewards If true, Migrate & Stake received rewards
     * @param newStakeAmount Max amount of OGN (from wallet+unstake) to stake
     * @param newStakeDuration Duration of the new stake
     */
    function migrate(
        uint256[] calldata lockupIds,
        uint256 ogvAmountFromWallet,
        uint256 ognAmountFromWallet,
        bool migrateRewards,
        uint256 newStakeAmount,
        uint256 newStakeDuration
    ) external isSolvent {
        if (lockupIds.length == 0) {
            revert LockupIdsRequired();
        }

        // Unstake
        (uint256 ogvAmountUnlocked, uint256 rewardsCollected) = ogvStaking.unstakeFrom(msg.sender, lockupIds);

        if (migrateRewards) {
            // Include rewards if needed
            ogvAmountFromWallet += rewardsCollected;
        }

        ogvAmountFromWallet += ogvAmountUnlocked;

        if (ognAmountFromWallet > 0) {
            // Transfer in additional OGN to stake from user's wallet
            ogn.transferFrom(msg.sender, address(this), ognAmountFromWallet);
        }

        // Migrate OGV to OGN and include that along with existing balance
        ognAmountFromWallet += _migrate(ogvAmountFromWallet, address(this));

        if (ognAmountFromWallet < newStakeAmount) {
            revert InvalidStakeAmount();
        }

        uint256 ognToWallet = ognAmountFromWallet - newStakeAmount;
        if (ognToWallet > 0) {
            ogn.transfer(msg.sender, ognToWallet);
        }

        if (newStakeAmount > 0) {
            // Stake it
            ognStaking.stake(
                newStakeAmount,
                newStakeDuration,
                msg.sender,
                false,
                -1 // New stake
            );
        }

        emit LockupsMigrated(msg.sender, lockupIds, newStakeAmount, newStakeDuration);
    }

    /**
     * @notice Migrates caller's OGV to OGN and sends it to the `receiver`
     * @return ognReceived OGN Received
     */
    function _migrate(uint256 ogvAmount, address receiver) internal returns (uint256 ognReceived) {
        ognReceived = (ogvAmount * CONVERSION_RATE) / 1 ether;

        emit TokenExchanged(ogvAmount, ognReceived);

        ogv.burnFrom(msg.sender, ogvAmount);

        if (receiver != address(this)) {
            // When migrating stakes, the contract would directly
            // stake the balance on behalf of the user. So there's
            // no need to transfer to self. Transfering to user and then
            // back to this contract would only increase gas cost (and
            // an additional tx for the user).
            ogn.transfer(receiver, ognReceived);
        }
    }
}

File 2 of 7 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}

File 3 of 7 : Governable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @title OUSD Governable Contract
 * @dev Copy of the openzeppelin Ownable.sol contract with nomenclature change
 *      from owner to governor and renounce methods removed. Does not use
 *      Context.sol like Ownable.sol does for simplification.
 * @author Origin Protocol Inc
 */
abstract contract Governable {
    // Storage position of the owner and pendingOwner of the contract
    // keccak256("OUSD.governor");
    bytes32 private constant governorPosition = 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a;

    // keccak256("OUSD.pending.governor");
    bytes32 private constant pendingGovernorPosition =
        0x44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db;

    // keccak256("OUSD.reentry.status");
    bytes32 private constant reentryStatusPosition = 0x53bf423e48ed90e97d02ab0ebab13b2a235a6bfbe9c321847d5c175333ac4535;

    // See OpenZeppelin ReentrancyGuard implementation
    uint256 constant _NOT_ENTERED = 1;
    uint256 constant _ENTERED = 2;

    event PendingGovernorshipTransfer(address indexed previousGovernor, address indexed newGovernor);

    event GovernorshipTransferred(address indexed previousGovernor, address indexed newGovernor);

    /**
     * @dev Initializes the contract setting the deployer as the initial Governor.
     */
    constructor() {
        _setGovernor(msg.sender);
        emit GovernorshipTransferred(address(0), _governor());
    }

    /**
     * @dev Returns the address of the current Governor.
     */
    function governor() public view returns (address) {
        return _governor();
    }

    /**
     * @dev Returns the address of the current Governor.
     */
    function _governor() internal view returns (address governorOut) {
        bytes32 position = governorPosition;
        assembly {
            governorOut := sload(position)
        }
    }

    /**
     * @dev Returns the address of the pending Governor.
     */
    function _pendingGovernor() internal view returns (address pendingGovernor) {
        bytes32 position = pendingGovernorPosition;
        assembly {
            pendingGovernor := sload(position)
        }
    }

    /**
     * @dev Throws if called by any account other than the Governor.
     */
    modifier onlyGovernor() {
        require(isGovernor(), "Caller is not the Governor");
        _;
    }

    /**
     * @dev Returns true if the caller is the current Governor.
     */
    function isGovernor() public view returns (bool) {
        return msg.sender == _governor();
    }

    function _setGovernor(address newGovernor) internal {
        bytes32 position = governorPosition;
        assembly {
            sstore(position, newGovernor)
        }
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        bytes32 position = reentryStatusPosition;
        uint256 _reentry_status;
        assembly {
            _reentry_status := sload(position)
        }

        // On the first call to nonReentrant, _notEntered will be true
        require(_reentry_status != _ENTERED, "Reentrant call");

        // Any calls to nonReentrant after this point will fail
        assembly {
            sstore(position, _ENTERED)
        }

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        assembly {
            sstore(position, _NOT_ENTERED)
        }
    }

    function _setPendingGovernor(address newGovernor) internal {
        bytes32 position = pendingGovernorPosition;
        assembly {
            sstore(position, newGovernor)
        }
    }

    /**
     * @dev Transfers Governance of the contract to a new account (`newGovernor`).
     * Can only be called by the current Governor. Must be claimed for this to complete
     * @param _newGovernor Address of the new Governor
     */
    function transferGovernance(address _newGovernor) external onlyGovernor {
        _setPendingGovernor(_newGovernor);
        emit PendingGovernorshipTransfer(_governor(), _newGovernor);
    }

    /**
     * @dev Claim Governance of the contract to a new account (`newGovernor`).
     * Can only be called by the new Governor.
     */
    function claimGovernance() external {
        require(msg.sender == _pendingGovernor(), "Only the pending Governor can complete the claim");
        _changeGovernor(msg.sender);
    }

    /**
     * @dev Change Governance of the contract to a new account (`newGovernor`).
     * @param _newGovernor Address of the new Governor
     */
    function _changeGovernor(address _newGovernor) internal {
        require(_newGovernor != address(0), "New Governor is address(0)");
        emit GovernorshipTransferred(_governor(), _newGovernor);
        _setGovernor(_newGovernor);
    }
}

File 4 of 7 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 5 of 7 : 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 6 of 7 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

    /**
     * @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);
}

File 7 of 7 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

Settings
{
  "remappings": [
    "contracts/=contracts/",
    "script/=script/",
    "tests/=tests/",
    "utils/=contracts/utils/",
    "OpenZeppelin/openzeppelin-contracts@02fcc75bb7f35376c22def91b0fb9bc7a50b9458/=lib/openzeppelin-contracts/",
    "OpenZeppelin/openzeppelin-contracts-upgradeable@a16f26a063cd018c4c986832c3df332a131f53b9/=lib/openzeppelin-contracts-upgradeable/",
    "OpenZeppelin/[email protected]/=lib/openzeppelin-contracts/",
    "OpenZeppelin/[email protected]/=lib/openzeppelin-contracts-upgradeable/",
    "paulrberg/[email protected]/=lib/prb-math/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/",
    "prb-math/=lib/prb-math/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false,
  "libraries": {
    "contracts/utils/VmHelper.sol": {
      "VmHelper": "0x59E742b8D6c02e24c348EBbD5fF1883B3a4AC7a9"
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_ogv","type":"address"},{"internalType":"address","name":"_ogn","type":"address"},{"internalType":"address","name":"_ogvStaking","type":"address"},{"internalType":"address","name":"_ognStaking","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"expectedOGN","type":"uint256"},{"internalType":"uint256","name":"availableOGN","type":"uint256"}],"name":"ContractInsolvent","type":"error"},{"inputs":[],"name":"InvalidStakeAmount","type":"error"},{"inputs":[],"name":"LockupIdsRequired","type":"error"},{"inputs":[],"name":"MigrationAlreadyStarted","type":"error"},{"anonymous":false,"inputs":[],"name":"Decommissioned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernor","type":"address"}],"name":"GovernorshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ogvLockupIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"newStakeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDuration","type":"uint256"}],"name":"LockupsMigrated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernor","type":"address"}],"name":"PendingGovernorshipTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ogvAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"ognAmountOut","type":"uint256"}],"name":"TokenExchanged","type":"event"},{"inputs":[],"name":"CONVERSION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMigrationActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ogvAmount","type":"uint256"}],"name":"migrate","outputs":[{"internalType":"uint256","name":"ognReceived","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"lockupIds","type":"uint256[]"},{"internalType":"uint256","name":"ogvAmountFromWallet","type":"uint256"},{"internalType":"uint256","name":"ognAmountFromWallet","type":"uint256"},{"internalType":"bool","name":"migrateRewards","type":"bool"},{"internalType":"uint256","name":"newStakeAmount","type":"uint256"},{"internalType":"uint256","name":"newStakeDuration","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ogn","outputs":[{"internalType":"contract ERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ognStaking","outputs":[{"internalType":"contract IStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ogv","outputs":[{"internalType":"contract ERC20Burnable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ogvStaking","outputs":[{"internalType":"contract IStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"start","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"}],"name":"transferExcessTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"transferGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b50604051620016ef380380620016ef8339810160408190526200003591620000d5565b6200004d33600080516020620016cf83398151915255565b600080516020620016cf833981519152546040516001600160a01b03909116906000907fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a908290a36001600160a01b0393841660805291831660a052821660c0521660e05262000132565b80516001600160a01b0381168114620000d057600080fd5b919050565b60008060008060808587031215620000ec57600080fd5b620000f785620000b8565b93506200010760208601620000b8565b92506200011760408601620000b8565b91506200012760608601620000b8565b905092959194509250565b60805160a05160c05160e0516114e5620001ea6000396000818161021a015281816107430152610ca401526000818161016301526104db0152600081816101e0015281816102ba015281816105b6015281816106940152818161080a0152818161099d01528181610ae101528181610bd501528181610cd401528181610d6a01526110a401526000818161013c015281816103450152818161089501528181610a4101528181610df5015261100a01526114e56000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80635d36b190116100975780638a4d8f35116100665780638a4d8f3514610215578063be9a65551461023c578063c7af335214610244578063d38bfff41461024c57600080fd5b80635d36b190146101be5780635e1da48d146101c8578063602bc098146101db578063716280561461020257600080fd5b80632b478a7f116100d35780632b478a7f1461015e5780632c8bff31146101855780633197cbb6146101a2578063454b0608146101ab57600080fd5b80630c340a24146100fa5780630e913a6c1461011f578063142561cf14610137575b600080fd5b61010261025f565b6040516001600160a01b0390911681526020015b60405180910390f35b61012761027c565b6040519015158152602001610116565b6101027f000000000000000000000000000000000000000000000000000000000000000081565b6101027f000000000000000000000000000000000000000000000000000000000000000081565b6101946701449c87e920a00081565b604051908152602001610116565b61019460005481565b6101946101b93660046111dd565b610293565b6101c6610412565b005b6101c66101d6366004611214565b6104b8565b6101027f000000000000000000000000000000000000000000000000000000000000000081565b6101c66102103660046112bd565b610961565b6101027f000000000000000000000000000000000000000000000000000000000000000081565b6101c6610c48565b610127610eb6565b6101c661025a3660046112bd565b610ee7565b60006102776000805160206114908339815191525490565b905090565b600080600054118015610277575050600054421090565b600061029f8233610f8b565b6040516370a0823160e01b81523060048201529091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c591906112ed565b6103cf919061131c565b6103d9919061133b565b90508082101561040b5760405163660cb9ab60e01b815260048101829052602481018390526044015b60405180910390fd5b5050919050565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146104ad5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610402565b6104b633611119565b565b856104d65760405163591308b760e01b815260040160405180910390fd5b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166325141a41338b8b6040518463ffffffff1660e01b815260040161052993929190611393565b60408051808303816000875af1158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b91906113c1565b9150915084156105825761057f81886113e5565b96505b61058c82886113e5565b9650851561062d576040516323b872dd60e01b8152336004820152306024820152604481018790527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b91906113fd565b505b6106378730610f8b565b61064190876113e5565b95508386101561066457604051630103be3b60e21b815260040160405180910390fd5b6000610670858861141a565b9050801561070b5760405163a9059cbb60e01b8152336004820152602481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb906044016020604051808303816000875af11580156106e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070991906113fd565b505b84156107a857604051632e6a154960e11b815260048101869052602481018590523360448201526000606482015260001960848201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635cd42a929060a401600060405180830381600087803b15801561078f57600080fd5b505af11580156107a3573d6000803e3d6000fd5b505050505b336001600160a01b03167fb5895e6e094fe35ea6fb07a0d870556bd8873cb5b013db35577ac4b8fc9ba9118b8b88886040516107e79493929190611431565b60405180910390a250506040516370a0823160e01b8152306004820152600091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091591906112ed565b61091f919061131c565b610929919061133b565b9050808210156109565760405163660cb9ab60e01b81526004810182905260248101839052604401610402565b505050505050505050565b610969610eb6565b6109855760405162461bcd60e51b815260040161040290611458565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156109ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1091906112ed565b905060005460001480610a265750610a2661027c565b15610b86576000670de0b6b3a76400006701449c87e920a0007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac191906112ed565b610acb919061131c565b610ad5919061133b565b90506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663a9059cbb84610b11848661141a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8091906113fd565b50505050565b6040517f4bd04f3440c9bf56a25f7b9e1ac75a9803bd83123a127cf9748129c938630b3990600090a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4291906113fd565b505b5050565b610c50610eb6565b610c6c5760405162461bcd60e51b815260040161040290611458565b60005415610c8d576040516347b2fd5d60e01b815260040160405180910390fd5b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260001960248301527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303816000875af1158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4191906113fd565b50610d50426301e133806113e5565b60009081556040516370a0823160e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015610db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddd91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7591906112ed565b610e7f919061131c565b610e89919061133b565b905080821015610c445760405163660cb9ab60e01b81526004810182905260248101839052604401610402565b6000610ece6000805160206114908339815191525490565b6001600160a01b0316336001600160a01b031614905090565b610eef610eb6565b610f0b5760405162461bcd60e51b815260040161040290611458565b610f33817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316610f536000805160206114908339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b6000670de0b6b3a7640000610fa86701449c87e920a0008561131c565b610fb2919061133b565b60408051858152602081018390529192507f9c1f21412e7678ca4f1e877049ce3e4db3d039e316e6b55b1de2aef667ae4996910160405180910390a160405163079cc67960e41b8152336004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906379cc679090604401600060405180830381600087803b15801561105657600080fd5b505af115801561106a573d6000803e3d6000fd5b505050506001600160a01b03821630146111135760405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af11580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111191906113fd565b505b92915050565b6001600160a01b03811661116f5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610402565b806001600160a01b031661118f6000805160206114908339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36111da8160008051602061149083398151915255565b50565b6000602082840312156111ef57600080fd5b5035919050565b80151581146111da57600080fd5b803561120f816111f6565b919050565b600080600080600080600060c0888a03121561122f57600080fd5b873567ffffffffffffffff8082111561124757600080fd5b818a0191508a601f83011261125b57600080fd5b81358181111561126a57600080fd5b8b60208260051b850101111561127f57600080fd5b602092830199509750508801359450604088013593506112a160608901611204565b92506080880135915060a0880135905092959891949750929550565b6000602082840312156112cf57600080fd5b81356001600160a01b03811681146112e657600080fd5b9392505050565b6000602082840312156112ff57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561133657611336611306565b500290565b60008261135857634e487b7160e01b600052601260045260246000fd5b500490565b81835260006001600160fb1b0383111561137657600080fd5b8260051b8083602087013760009401602001938452509192915050565b6001600160a01b03841681526040602082018190526000906113b8908301848661135d565b95945050505050565b600080604083850312156113d457600080fd5b505080516020909101519092909150565b600082198211156113f8576113f8611306565b500190565b60006020828403121561140f57600080fd5b81516112e6816111f6565b60008282101561142c5761142c611306565b500390565b60608152600061144560608301868861135d565b6020830194909452506040015292915050565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000060408201526060019056fe7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa26469706673582212205330315b95343fe4bd69d03d3998a906ef5a2a00994763df0cdab4fbf7cf123c64736f6c634300080a00337bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d00000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae260000000000000000000000000c4576ca1c365868e162554af8e385dc3e7c66d900000000000000000000000063898b3b6ef3d39332082178656e9862bee45c57

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80635d36b190116100975780638a4d8f35116100665780638a4d8f3514610215578063be9a65551461023c578063c7af335214610244578063d38bfff41461024c57600080fd5b80635d36b190146101be5780635e1da48d146101c8578063602bc098146101db578063716280561461020257600080fd5b80632b478a7f116100d35780632b478a7f1461015e5780632c8bff31146101855780633197cbb6146101a2578063454b0608146101ab57600080fd5b80630c340a24146100fa5780630e913a6c1461011f578063142561cf14610137575b600080fd5b61010261025f565b6040516001600160a01b0390911681526020015b60405180910390f35b61012761027c565b6040519015158152602001610116565b6101027f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d081565b6101027f0000000000000000000000000c4576ca1c365868e162554af8e385dc3e7c66d981565b6101946701449c87e920a00081565b604051908152602001610116565b61019460005481565b6101946101b93660046111dd565b610293565b6101c6610412565b005b6101c66101d6366004611214565b6104b8565b6101027f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae2681565b6101c66102103660046112bd565b610961565b6101027f00000000000000000000000063898b3b6ef3d39332082178656e9862bee45c5781565b6101c6610c48565b610127610eb6565b6101c661025a3660046112bd565b610ee7565b60006102776000805160206114908339815191525490565b905090565b600080600054118015610277575050600054421090565b600061029f8233610f8b565b6040516370a0823160e01b81523060048201529091506000907f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b0316906370a0823190602401602060405180830381865afa158015610309573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032d91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d06001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156103a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c591906112ed565b6103cf919061131c565b6103d9919061133b565b90508082101561040b5760405163660cb9ab60e01b815260048101829052602481018390526044015b60405180910390fd5b5050919050565b7f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db546001600160a01b0316336001600160a01b0316146104ad5760405162461bcd60e51b815260206004820152603060248201527f4f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f60448201526f6d706c6574652074686520636c61696d60801b6064820152608401610402565b6104b633611119565b565b856104d65760405163591308b760e01b815260040160405180910390fd5b6000807f0000000000000000000000000c4576ca1c365868e162554af8e385dc3e7c66d96001600160a01b03166325141a41338b8b6040518463ffffffff1660e01b815260040161052993929190611393565b60408051808303816000875af1158015610547573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061056b91906113c1565b9150915084156105825761057f81886113e5565b96505b61058c82886113e5565b9650851561062d576040516323b872dd60e01b8152336004820152306024820152604481018790527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610607573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061062b91906113fd565b505b6106378730610f8b565b61064190876113e5565b95508386101561066457604051630103be3b60e21b815260040160405180910390fd5b6000610670858861141a565b9050801561070b5760405163a9059cbb60e01b8152336004820152602481018290527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b03169063a9059cbb906044016020604051808303816000875af11580156106e5573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070991906113fd565b505b84156107a857604051632e6a154960e11b815260048101869052602481018590523360448201526000606482015260001960848201527f00000000000000000000000063898b3b6ef3d39332082178656e9862bee45c576001600160a01b031690635cd42a929060a401600060405180830381600087803b15801561078f57600080fd5b505af11580156107a3573d6000803e3d6000fd5b505050505b336001600160a01b03167fb5895e6e094fe35ea6fb07a0d870556bd8873cb5b013db35577ac4b8fc9ba9118b8b88886040516107e79493929190611431565b60405180910390a250506040516370a0823160e01b8152306004820152600091507f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b0316906370a0823190602401602060405180830381865afa158015610859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087d91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d06001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091591906112ed565b61091f919061131c565b610929919061133b565b9050808210156109565760405163660cb9ab60e01b81526004810182905260248101839052604401610402565b505050505050505050565b610969610eb6565b6109855760405162461bcd60e51b815260040161040290611458565b6040516370a0823160e01b81523060048201526000907f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b0316906370a0823190602401602060405180830381865afa1580156109ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1091906112ed565b905060005460001480610a265750610a2661027c565b15610b86576000670de0b6b3a76400006701449c87e920a0007f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d06001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac191906112ed565b610acb919061131c565b610ad5919061133b565b90506001600160a01b037f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae261663a9059cbb84610b11848661141a565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8091906113fd565b50505050565b6040517f4bd04f3440c9bf56a25f7b9e1ac75a9803bd83123a127cf9748129c938630b3990600090a160405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae26169063a9059cbb906044016020604051808303816000875af1158015610c1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4291906113fd565b505b5050565b610c50610eb6565b610c6c5760405162461bcd60e51b815260040161040290611458565b60005415610c8d576040516347b2fd5d60e01b815260040160405180910390fd5b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000063898b3b6ef3d39332082178656e9862bee45c578116600483015260001960248301527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae26169063095ea7b3906044016020604051808303816000875af1158015610d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4191906113fd565b50610d50426301e133806113e5565b60009081556040516370a0823160e01b81523060048201527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae266001600160a01b0316906370a0823190602401602060405180830381865afa158015610db9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddd91906112ed565b90506000670de0b6b3a76400006701449c87e920a0007f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d06001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7591906112ed565b610e7f919061131c565b610e89919061133b565b905080821015610c445760405163660cb9ab60e01b81526004810182905260248101839052604401610402565b6000610ece6000805160206114908339815191525490565b6001600160a01b0316336001600160a01b031614905090565b610eef610eb6565b610f0b5760405162461bcd60e51b815260040161040290611458565b610f33817f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db55565b806001600160a01b0316610f536000805160206114908339815191525490565b6001600160a01b03167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b6000670de0b6b3a7640000610fa86701449c87e920a0008561131c565b610fb2919061133b565b60408051858152602081018390529192507f9c1f21412e7678ca4f1e877049ce3e4db3d039e316e6b55b1de2aef667ae4996910160405180910390a160405163079cc67960e41b8152336004820152602481018490527f0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d06001600160a01b0316906379cc679090604401600060405180830381600087803b15801561105657600080fd5b505af115801561106a573d6000803e3d6000fd5b505050506001600160a01b03821630146111135760405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae26169063a9059cbb906044016020604051808303816000875af11580156110ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111191906113fd565b505b92915050565b6001600160a01b03811661116f5760405162461bcd60e51b815260206004820152601a60248201527f4e657720476f7665726e6f7220697320616464726573732830290000000000006044820152606401610402565b806001600160a01b031661118f6000805160206114908339815191525490565b6001600160a01b03167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a36111da8160008051602061149083398151915255565b50565b6000602082840312156111ef57600080fd5b5035919050565b80151581146111da57600080fd5b803561120f816111f6565b919050565b600080600080600080600060c0888a03121561122f57600080fd5b873567ffffffffffffffff8082111561124757600080fd5b818a0191508a601f83011261125b57600080fd5b81358181111561126a57600080fd5b8b60208260051b850101111561127f57600080fd5b602092830199509750508801359450604088013593506112a160608901611204565b92506080880135915060a0880135905092959891949750929550565b6000602082840312156112cf57600080fd5b81356001600160a01b03811681146112e657600080fd5b9392505050565b6000602082840312156112ff57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561133657611336611306565b500290565b60008261135857634e487b7160e01b600052601260045260246000fd5b500490565b81835260006001600160fb1b0383111561137657600080fd5b8260051b8083602087013760009401602001938452509192915050565b6001600160a01b03841681526040602082018190526000906113b8908301848661135d565b95945050505050565b600080604083850312156113d457600080fd5b505080516020909101519092909150565b600082198211156113f8576113f8611306565b500190565b60006020828403121561140f57600080fd5b81516112e6816111f6565b60008282101561142c5761142c611306565b500390565b60608152600061144560608301868861135d565b6020830194909452506040015292915050565b6020808252601a908201527f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000060408201526060019056fe7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4aa26469706673582212205330315b95343fe4bd69d03d3998a906ef5a2a00994763df0cdab4fbf7cf123c64736f6c634300080a0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d00000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae260000000000000000000000000c4576ca1c365868e162554af8e385dc3e7c66d900000000000000000000000063898b3b6ef3d39332082178656e9862bee45c57

-----Decoded View---------------
Arg [0] : _ogv (address): 0x9c354503C38481a7A7a51629142963F98eCC12D0
Arg [1] : _ogn (address): 0x8207c1FfC5B6804F6024322CcF34F29c3541Ae26
Arg [2] : _ogvStaking (address): 0x0C4576Ca1c365868E162554AF8e385dc3e7C66D9
Arg [3] : _ognStaking (address): 0x63898b3b6Ef3d39332082178656E9862bee45C57

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000009c354503c38481a7a7a51629142963f98ecc12d0
Arg [1] : 0000000000000000000000008207c1ffc5b6804f6024322ccf34f29c3541ae26
Arg [2] : 0000000000000000000000000c4576ca1c365868e162554af8e385dc3e7c66d9
Arg [3] : 00000000000000000000000063898b3b6ef3d39332082178656e9862bee45c57


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

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.