Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xFc9e2a42A8fcB01c9A6fd62133c71da80fa78057
Balance 0 ETH
Nonce 1
Code Size 1514 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

1514 bytes
0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c8063f12baf5c11610058578063f12baf5c1461011b578063f421979f14610135578063f5d15b651461015c578063fecec9ed1461016f575f5ffd5b80632d2c55651461008957806369f94adf146100cc5780637628a37d146100f3578063e66b384214610108575b5f5ffd5b6100b07f000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b81565b6040516001600160a01b03909116815260200160405180910390f35b6100b07f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c47981565b610106610101366004610532565b610196565b005b610106610116366004610532565b6101a6565b732218f90a98b0c070676f249ef44834686daa42856100b0565b6100b07f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e58821381565b61010661016a366004610564565b610331565b6100b07f0000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c9481565b6101a18383836101a6565b505050565b6101b1833083610340565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e58821381166004830152602482018590527f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c479169063095ea7b3906044016020604051808303815f875af115801561023d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610261919061058e565b5060408051848152602081018490526001600160a01b0383169133917f9b68f01b80e516179521925c1a690f13d1fe61c92ac2f10fc202fb1252d7f111910160405180910390a36040516373359c2160e11b815260048101849052602481018390526001600160a01b0382811660448301527f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e588213169063e66b3842906064015f604051808303815f87803b158015610316575f5ffd5b505af1158015610328573d5f5f3e3d5ffd5b50505050505050565b61033c828283610340565b5050565b825f0361036057604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0382166103875760405163d92e233d60e01b815260040160405180910390fd5b6040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b81166024830152604482018590527f0000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c9416906323b872dd906064016020604051808303815f875af1158015610419573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061043d919061058e565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018590527f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c47916906340c10f19906044015f604051808303815f87803b1580156104a5575f5ffd5b505af11580156104b7573d5f5f3e3d5ffd5b50505050806001600160a01b0316826001600160a01b0316336001600160a01b03167f31d26dede2b13bbe4cb7a36e74fda90d409a86d7a0fdf0058d5096969d05bf208660405161050a91815260200190565b60405180910390a4505050565b80356001600160a01b038116811461052d575f5ffd5b919050565b5f5f5f60608486031215610544575f5ffd5b833592506020840135915061055b60408501610517565b90509250925092565b5f5f60408385031215610575575f5ffd5b8235915061058560208401610517565b90509250929050565b5f6020828403121561059e575f5ffd5b815180151581146105ad575f5ffd5b939250505056fea264697066735822122032cb85d2a212e4845bcf438155aa44946248b562b30164e937f789086f49b89364736f6c63430008210033

Verified Source Code Partial Match

Compiler: v0.8.33+commit.64118f21 EVM: prague Optimization: Yes (200 runs)
TokenConversion.sol 123 lines
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025 Tokemak Foundation. All rights reserved.

pragma solidity ^0.8.27;

//              ██
//              ██
//              ██
//              ██
//              ██
// █████████████████████████████████████████
//                            ██
//                            ██
//                            ██
//                            ██
//                            ██

import { IAccToke } from "src/interfaces/IAccToke.sol";
import { IERC20Mintable } from "src/interfaces/IERC20Mintable.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

contract TokenConversion {
    IERC20Mintable public immutable AUTO;
    IERC20 public immutable TOKE;
    address public immutable TREASURY;
    IAccToke public immutable NEW_STAKING;

    error ZeroAddress();
    error ZeroAmount();

    event TokensConverted(address indexed from, address indexed receiver, address indexed finalReceiver, uint256 amount);
    event TokensStaked(address indexed from, address indexed account, uint256 amount, uint256 numOfCycles);

    constructor(
        address autoToken,
        address tokeToken,
        address treasury,
        address newStakingContract
    ) {
        if (autoToken == address(0) || tokeToken == address(0) || treasury == address(0) || newStakingContract == address(0)) {
            revert ZeroAddress();
        }

        AUTO = IERC20Mintable(autoToken);
        TOKE = IERC20(tokeToken);
        TREASURY = treasury;
        NEW_STAKING = IAccToke(newStakingContract);
    }

    /// @notice Convert your TOKE tokens to AUTO 1:1
    /// @param amount Amount of TOKE to convert to AUTO
    /// @param receiver Receiver of the AUTO token
    function tokeToAuto(
        uint256 amount,
        address receiver
    ) external {
        _tokeToAuto(amount, receiver, receiver);
    }

    /// @notice Convert your TOKE tokens to AUTO 1:1 and lock to a different account for `numOfCycles` cycles ->
    /// @notice that account gets resulting accAUTO
    /// @dev For Staking -> Auto ACC contract
    /// @param tokeAmount Amount of TOKE to lock up
    /// @param numOfCycles Number of cycles to lock for
    /// @param receiver Account to lock TOKE for
    function lockTokeFor(
        uint256 tokeAmount,
        uint256 numOfCycles,
        address receiver
    ) public {
        _tokeToAuto(tokeAmount, address(this), receiver);

        // slither-disable-next-line unused-return
        AUTO.approve(address(NEW_STAKING), tokeAmount);

        emit TokensStaked(msg.sender, receiver, tokeAmount, numOfCycles);

        NEW_STAKING.lockTokeFor(tokeAmount, numOfCycles, receiver);
    }

    /// @notice Convert your TOKE tokens to AUTO 1:1 and lock to a different account for `numOfCycles` cycles ->
    /// @notice that account gets resulting accAUTO
    /// @dev For TOKE acc Contract -> AUTO acc contract
    /// @param tokeAmount Amount of TOKE to lock up
    /// @param numOfCycles Number of cycles to lock for
    /// @param receiver Account to lock TOKE for
    function stake(
        uint256 tokeAmount,
        uint256 numOfCycles,
        address receiver
    ) external {
        lockTokeFor(tokeAmount, numOfCycles, receiver);
    }

    function getSystemRegistry() external pure returns (address) {
        return 0x2218F90A98b0C070676f249EF44834686dAa4285;
    }
    
    /// @notice Convert your TOKE tokens to AUTO 1:1
    /// @param amount Amount of TOKE to convert to AUTO
    /// @param receiver Intermediate receiver of the AUTO token
    /// @param finalReceiver Final receiver of the AUTO token based on the flow being executed
    function _tokeToAuto(
        uint256 amount,
        address receiver,
        address finalReceiver
    ) private {
        if (amount == 0) {
            revert ZeroAmount();
        }
        if (receiver == address(0)) {
            revert ZeroAddress();
        }

        // Tokens are known to revert on failure
        // slither-disable-next-line unchecked-transfer
        TOKE.transferFrom(msg.sender, TREASURY, amount);
        AUTO.mint(receiver, amount);

        emit TokensConverted(msg.sender, receiver, finalReceiver, amount);
    }

}
IAccToke.sol 29 lines
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025 Tokemak Foundation. All rights reserved.

pragma solidity ^0.8.27;

interface IAccToke {
    /// @notice Lock Toke for a different account for `numOfCycles` cycles -> that account gets resulting accTOKE
    /// @param tokeAmount Amount of TOKE to lock up
    /// @param numOfCycles Number of cycles to lock for
    /// @param account Account to lock TOKE for
    function lockTokeFor(
        uint256 tokeAmount,
        uint256 numOfCycles,
        address account
    ) external;

    function accTokeMigration(
		address accTokeToMigrateTo,
		uint256 migrationAmount,
		uint256 duration,
		address to
	) external;

    function setAutopilotSystemRegistry(
		address _autoPilotSystemRegistry
	) external;

    function grantRole(bytes32 role, address sender) external;
}
IERC20Mintable.sol 13 lines
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025 Tokemak Foundation. All rights reserved.

pragma solidity ^0.8.27;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface IERC20Mintable is IERC20 {
    function mint(
        address to,
        uint256 amount
    ) external;
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)

pragma solidity >=0.4.16;

/**
 * @dev Interface of the ERC-20 standard as defined in the ERC.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` 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 value) external returns (bool);
}

Read Contract

AUTO 0x69f94adf → address
NEW_STAKING 0xf421979f → address
TOKE 0xfecec9ed → address
TREASURY 0x2d2c5565 → address
getSystemRegistry 0xf12baf5c → address

Write Contract 3 functions

These functions modify contract state and require a wallet transaction to execute.

lockTokeFor 0xe66b3842
uint256 tokeAmount
uint256 numOfCycles
address receiver
stake 0x7628a37d
uint256 tokeAmount
uint256 numOfCycles
address receiver
tokeToAuto 0xf5d15b65
uint256 amount
address receiver

Recent Transactions

No transactions found for this address