Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 87 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Toke To Auto | 24393618 | 1 hr ago | IN | 0 ETH | 0.00043761 | ||||
| Toke To Auto | 24393321 | 2 hrs ago | IN | 0 ETH | 0.00100853 | ||||
| Toke To Auto | 24392126 | 6 hrs ago | IN | 0 ETH | 0.00041979 | ||||
| Toke To Auto | 24392041 | 6 hrs ago | IN | 0 ETH | 0.00011373 | ||||
| Toke To Auto | 24392037 | 6 hrs ago | IN | 0 ETH | 0.00034224 | ||||
| Toke To Auto | 24391770 | 7 hrs ago | IN | 0 ETH | 0.00089361 | ||||
| Toke To Auto | 24390969 | 10 hrs ago | IN | 0 ETH | 0.00026839 | ||||
| Toke To Auto | 24390900 | 10 hrs ago | IN | 0 ETH | 0.00027232 | ||||
| Toke To Auto | 24390439 | 12 hrs ago | IN | 0 ETH | 0.000252 | ||||
| Toke To Auto | 24389630 | 14 hrs ago | IN | 0 ETH | 0.00002748 | ||||
| Toke To Auto | 24389123 | 16 hrs ago | IN | 0 ETH | 0.00003105 | ||||
| Toke To Auto | 24388989 | 16 hrs ago | IN | 0 ETH | 0.00001316 | ||||
| Toke To Auto | 24388897 | 17 hrs ago | IN | 0 ETH | 0.00001975 | ||||
| Toke To Auto | 24387870 | 20 hrs ago | IN | 0 ETH | 0.00018807 | ||||
| Toke To Auto | 24387721 | 21 hrs ago | IN | 0 ETH | 0.00001378 | ||||
| Toke To Auto | 24387631 | 21 hrs ago | IN | 0 ETH | 0.0001792 | ||||
| Toke To Auto | 24387563 | 21 hrs ago | IN | 0 ETH | 0.00001218 | ||||
| Toke To Auto | 24387435 | 22 hrs ago | IN | 0 ETH | 0.00002596 | ||||
| Toke To Auto | 24387425 | 22 hrs ago | IN | 0 ETH | 0.00001326 | ||||
| Toke To Auto | 24387082 | 23 hrs ago | IN | 0 ETH | 0.00001343 | ||||
| Toke To Auto | 24386711 | 24 hrs ago | IN | 0 ETH | 0.00001566 | ||||
| Toke To Auto | 24386367 | 25 hrs ago | IN | 0 ETH | 0.0002351 | ||||
| Toke To Auto | 24386316 | 25 hrs ago | IN | 0 ETH | 0.00005308 | ||||
| Toke To Auto | 24385911 | 27 hrs ago | IN | 0 ETH | 0.00003274 | ||||
| Toke To Auto | 24385835 | 27 hrs ago | IN | 0 ETH | 0.00003058 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
TokenConversion
Compiler Version
v0.8.33+commit.64118f21
Optimization Enabled:
Yes with 200 runs
Other Settings:
prague EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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);
}
}// 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;
}// 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;
}// 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);
}{
"remappings": [
"src/=src/",
"script/=script/",
"test/=test/",
"forge-std/=lib/forge-std/src/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@crytic/properties/=lib/properties/contracts/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "prague",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"autoToken","type":"address"},{"internalType":"address","name":"tokeToken","type":"address"},{"internalType":"address","name":"treasury","type":"address"},{"internalType":"address","name":"newStakingContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroAmount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"finalReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensConverted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"numOfCycles","type":"uint256"}],"name":"TokensStaked","type":"event"},{"inputs":[],"name":"AUTO","outputs":[{"internalType":"contract IERC20Mintable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NEW_STAKING","outputs":[{"internalType":"contract IAccToke","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKE","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSystemRegistry","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokeAmount","type":"uint256"},{"internalType":"uint256","name":"numOfCycles","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"lockTokeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokeAmount","type":"uint256"},{"internalType":"uint256","name":"numOfCycles","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"tokeToAuto","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
610100604052348015610010575f5ffd5b5060405161076138038061076183398101604081905261002f916100cb565b6001600160a01b038416158061004c57506001600160a01b038316155b8061005e57506001600160a01b038216155b8061007057506001600160a01b038116155b1561008e5760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0393841660805291831660a052821660c0521660e05261011c565b80516001600160a01b03811681146100c6575f5ffd5b919050565b5f5f5f5f608085870312156100de575f5ffd5b6100e7856100b0565b93506100f5602086016100b0565b9250610103604086016100b0565b9150610111606086016100b0565b905092959194509250565b60805160a05160c05160e0516105ea6101775f395f818161013a015281816101c801526102d501525f8181608e01526103a401525f818161017401526103d301525f818160d1015281816101f7015261046401526105ea5ff3fe608060405234801561000f575f5ffd5b5060043610610085575f3560e01c8063f12baf5c11610058578063f12baf5c1461011b578063f421979f14610135578063f5d15b651461015c578063fecec9ed1461016f575f5ffd5b80632d2c55651461008957806369f94adf146100cc5780637628a37d146100f3578063e66b384214610108575b5f5ffd5b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b610106610101366004610532565b610196565b005b610106610116366004610532565b6101a6565b732218f90a98b0c070676f249ef44834686daa42856100b0565b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b61010661016a366004610564565b610331565b6100b07f000000000000000000000000000000000000000000000000000000000000000081565b6101a18383836101a6565b505050565b6101b1833083610340565b60405163095ea7b360e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152602482018590527f0000000000000000000000000000000000000000000000000000000000000000169063095ea7b3906044016020604051808303815f875af115801561023d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610261919061058e565b5060408051848152602081018490526001600160a01b0383169133917f9b68f01b80e516179521925c1a690f13d1fe61c92ac2f10fc202fb1252d7f111910160405180910390a36040516373359c2160e11b815260048101849052602481018390526001600160a01b0382811660448301527f0000000000000000000000000000000000000000000000000000000000000000169063e66b3842906064015f604051808303815f87803b158015610316575f5ffd5b505af1158015610328573d5f5f3e3d5ffd5b50505050505050565b61033c828283610340565b5050565b825f0361036057604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0382166103875760405163d92e233d60e01b815260040160405180910390fd5b6040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166024830152604482018590527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd906064016020604051808303815f875af1158015610419573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061043d919061058e565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018590527f000000000000000000000000000000000000000000000000000000000000000016906340c10f19906044015f604051808303815f87803b1580156104a5575f5ffd5b505af11580156104b7573d5f5f3e3d5ffd5b50505050806001600160a01b0316826001600160a01b0316336001600160a01b03167f31d26dede2b13bbe4cb7a36e74fda90d409a86d7a0fdf0058d5096969d05bf208660405161050a91815260200190565b60405180910390a4505050565b80356001600160a01b038116811461052d575f5ffd5b919050565b5f5f5f60608486031215610544575f5ffd5b833592506020840135915061055b60408501610517565b90509250925092565b5f5f60408385031215610575575f5ffd5b8235915061058560208401610517565b90509250929050565b5f6020828403121561059e575f5ffd5b815180151581146105ad575f5ffd5b939250505056fea264697066735822122032cb85d2a212e4845bcf438155aa44946248b562b30164e937f789086f49b89364736f6c634300082100330000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c4790000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c94000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e588213
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610085575f3560e01c8063f12baf5c11610058578063f12baf5c1461011b578063f421979f14610135578063f5d15b651461015c578063fecec9ed1461016f575f5ffd5b80632d2c55651461008957806369f94adf146100cc5780637628a37d146100f3578063e66b384214610108575b5f5ffd5b6100b07f000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b81565b6040516001600160a01b03909116815260200160405180910390f35b6100b07f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c47981565b610106610101366004610532565b610196565b005b610106610116366004610532565b6101a6565b732218f90a98b0c070676f249ef44834686daa42856100b0565b6100b07f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e58821381565b61010661016a366004610564565b610331565b6100b07f0000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c9481565b6101a18383836101a6565b505050565b6101b1833083610340565b60405163095ea7b360e01b81526001600160a01b037f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e58821381166004830152602482018590527f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c479169063095ea7b3906044016020604051808303815f875af115801561023d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610261919061058e565b5060408051848152602081018490526001600160a01b0383169133917f9b68f01b80e516179521925c1a690f13d1fe61c92ac2f10fc202fb1252d7f111910160405180910390a36040516373359c2160e11b815260048101849052602481018390526001600160a01b0382811660448301527f00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e588213169063e66b3842906064015f604051808303815f87803b158015610316575f5ffd5b505af1158015610328573d5f5f3e3d5ffd5b50505050505050565b61033c828283610340565b5050565b825f0361036057604051631f2a200560e01b815260040160405180910390fd5b6001600160a01b0382166103875760405163d92e233d60e01b815260040160405180910390fd5b6040516323b872dd60e01b81523360048201526001600160a01b037f000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b81166024830152604482018590527f0000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c9416906323b872dd906064016020604051808303815f875af1158015610419573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061043d919061058e565b506040516340c10f1960e01b81526001600160a01b038381166004830152602482018590527f0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c47916906340c10f19906044015f604051808303815f87803b1580156104a5575f5ffd5b505af11580156104b7573d5f5f3e3d5ffd5b50505050806001600160a01b0316826001600160a01b0316336001600160a01b03167f31d26dede2b13bbe4cb7a36e74fda90d409a86d7a0fdf0058d5096969d05bf208660405161050a91815260200190565b60405180910390a4505050565b80356001600160a01b038116811461052d575f5ffd5b919050565b5f5f5f60608486031215610544575f5ffd5b833592506020840135915061055b60408501610517565b90509250925092565b5f5f60408385031215610575575f5ffd5b8235915061058560208401610517565b90509250929050565b5f6020828403121561059e575f5ffd5b815180151581146105ad575f5ffd5b939250505056fea264697066735822122032cb85d2a212e4845bcf438155aa44946248b562b30164e937f789086f49b89364736f6c63430008210033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c4790000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c94000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e588213
-----Decoded View---------------
Arg [0] : autoToken (address): 0x1Ec8eaa3f68261e793C48486b12092336A03c479
Arg [1] : tokeToken (address): 0x2e9d63788249371f1DFC918a52f8d799F4a38C94
Arg [2] : treasury (address): 0xa9900B2d550c406d1Cf58DA27228Feeef21D447b
Arg [3] : newStakingContract (address): 0x13ff49c4bf8dbBb6Fa8B2DEC9911438E6e588213
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000001ec8eaa3f68261e793c48486b12092336a03c479
Arg [1] : 0000000000000000000000002e9d63788249371f1dfc918a52f8d799f4a38c94
Arg [2] : 000000000000000000000000a9900b2d550c406d1cf58da27228feeef21d447b
Arg [3] : 00000000000000000000000013ff49c4bf8dbbb6fa8b2dec9911438e6e588213
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.