Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Tonnel
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; // import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; interface IMainnetUSDT { // interface ISepoliaUSDT { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); } contract Tonnel { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } // ISepoliaUSDT sepoliaUSDT; IMainnetUSDT mainnetUSDT; address public treasuryWallet; uint256 public minimumAmount = 1_000_000; // minimum of 1 USDT error MinimumAmountNotMet(); error DepositFail(); error OtherFails(); event Deposit(address indexed from, uint256 amount, string destination, uint256 time); event DepositOnly(address indexed from, uint256 amount, uint256 time); function setTreasuryWallet(address _newWallet) external onlyOwner { treasuryWallet = _newWallet; } function setMinimumAmount(uint256 _newMinimum) external onlyOwner { minimumAmount = _newMinimum; } constructor( // address _sepoliaUSDTAddress, // address _treasuryWallet ) { // sepoliaUSDT = ISepoliaUSDT(0x7169D38820dfd117C3FA1f22a697dBA58d90BA06); mainnetUSDT = IMainnetUSDT(0xdAC17F958D2ee523a2206206994597C13D831ec7); treasuryWallet = 0xBadCE2c9dd0D33C746c5529CD3d3651b208350Be; // sepoliaUSDT = ISepoliaUSDT(_sepoliaUSDTAddress); // mainnetUSDT = IMainnetUSDT(_sepoliaUSDTAddress); // treasuryWallet = _treasuryWallet; _transferOwnership(_msgSender()); } /** * @notice key function * @param _amount USDT amount in full decimal point representation. FE to do conversion? */ /* function deposit(uint256 _amount, string memory _tonAddress) external { if (_amount < minimumAmount) { revert MinimumAmountNotMet(); } uint256 allowance = mainnetUSDT.allowance(msg.sender, address(this)); require(allowance >= _amount, "Token allowance too low"); uint256 balance = mainnetUSDT.balanceOf(msg.sender); require(balance >= _amount, "Token balance too low"); // if (!sepoliaUSDT.transferFrom(msg.sender, treasuryWallet, _amount)) { // revert DepositFail(); // } bool success = mainnetUSDT.transferFrom(msg.sender, treasuryWallet, _amount); if (!success) { revert DepositFail(); } emit Deposit(msg.sender, _amount, _tonAddress, block.timestamp); } */ function depositOnly(uint256 _amount) external { if (_amount < minimumAmount) { revert MinimumAmountNotMet(); } uint256 allowance = mainnetUSDT.allowance(msg.sender, address(this)); require(allowance >= _amount, "Token allowance too low"); uint256 balance = mainnetUSDT.balanceOf(msg.sender); require(balance >= _amount, "Token balance too low"); // if (!sepoliaUSDT.transferFrom(msg.sender, treasuryWallet, _amount)) { // revert DepositFail(); // } bool success = mainnetUSDT.transferFrom(msg.sender, treasuryWallet, _amount); if (!success) { revert DepositFail(); } emit DepositOnly(msg.sender, _amount, block.timestamp); } }
{ "remappings": [ "src/=src/", "@openzeppelin/=node_modules/@openzeppelin/", "forge-std/=lib/forge-std/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"DepositFail","type":"error"},{"inputs":[],"name":"MinimumAmountNotMet","type":"error"},{"inputs":[],"name":"OtherFails","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"string","name":"destination","type":"string"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"DepositOnly","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"depositOnly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minimumAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newMinimum","type":"uint256"}],"name":"setMinimumAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newWallet","type":"address"}],"name":"setTreasuryWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasuryWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080806040523461009f57620f42406003556001805473dac17f958d2ee523a2206206994597c13d831ec76001600160a01b0319918216179091556002805473badce2c9dd0d33c746c5529cd3d3651b208350be9083161790556000805433928116831782556001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36105a290816100a58239f35b600080fdfe608060408181526004908136101561001657600080fd5b600092833560e01c9081634626402b146104b75750806359f34a891461025b578063715018a6146101fe5780638da5cb5b146101d6578063a8602fea1461018d578063bb0c82981461016e578063eeb4a9c8146101485763f2fde38b1461007c57600080fd5b34610144576020366003190112610144576001600160a01b03823581811693919290849003610140576100ad6104dc565b83156100ee57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8480fd5b8280fd5b50503461016a57602036600319011261016a576101636104dc565b3560035580f35b5080fd5b83823461016a578160031936011261016a576020906003549051908152f35b50503461016a57602036600319011261016a57356001600160a01b0381169081900361016a576101bb6104dc565b6bffffffffffffffffffffffff60a01b600254161760025580f35b83823461016a578160031936011261016a57905490516001600160a01b039091168152602090f35b83346102585780600319360112610258576102176104dc565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5034610144576020806003193601126104b35782359260035484106104a5576001548351636eb1769f60e11b815233838201523060248201526001600160a01b0391821691908481604481865afa908115610427579087918991610474575b50106104315784516370a0823160e01b815233848201528481602481865afa9081156104275790879189916103f2575b50106103b75786916064859260025416875194859384926323b872dd60e01b8452338985015260248401528a60448401525af19081156103ad578691610373575b50156103655750907f3a21688a339752733e412d508044928216e2f6865d680bca3ebec22aac7cf9ac91815193845242908401523392a280f35b8251630251a08b60e21b8152fd5b90508281813d83116103a6575b61038a8183610534565b810103126103a2575180151581036103a2573861032b565b8580fd5b503d610380565b84513d88823e3d90fd5b845162461bcd60e51b81528084018590526015602482015274546f6b656e2062616c616e636520746f6f206c6f7760581b6044820152606490fd5b809250868092503d8311610420575b61040b8183610534565b8101031261041c57869051386102ea565b8780fd5b503d610401565b86513d8a823e3d90fd5b845162461bcd60e51b8152808401859052601760248201527f546f6b656e20616c6c6f77616e636520746f6f206c6f770000000000000000006044820152606490fd5b809250868092503d831161049e575b61048d8183610534565b8101031261041c57869051386102ba565b503d610483565b8251631b88e6f960e31b8152fd5b8380fd5b84903461016a578160031936011261016a576002546001600160a01b03168152602090f35b6000546001600160a01b031633036104f057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff82111761055657604052565b634e487b7160e01b600052604160045260246000fdfea26469706673582212202b316fb37929a836d6a5c2013b0af33f182e2319235b7f29807e699d0aa4ec9364736f6c63430008130033
Deployed Bytecode
0x608060408181526004908136101561001657600080fd5b600092833560e01c9081634626402b146104b75750806359f34a891461025b578063715018a6146101fe5780638da5cb5b146101d6578063a8602fea1461018d578063bb0c82981461016e578063eeb4a9c8146101485763f2fde38b1461007c57600080fd5b34610144576020366003190112610144576001600160a01b03823581811693919290849003610140576100ad6104dc565b83156100ee57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8480fd5b8280fd5b50503461016a57602036600319011261016a576101636104dc565b3560035580f35b5080fd5b83823461016a578160031936011261016a576020906003549051908152f35b50503461016a57602036600319011261016a57356001600160a01b0381169081900361016a576101bb6104dc565b6bffffffffffffffffffffffff60a01b600254161760025580f35b83823461016a578160031936011261016a57905490516001600160a01b039091168152602090f35b83346102585780600319360112610258576102176104dc565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5034610144576020806003193601126104b35782359260035484106104a5576001548351636eb1769f60e11b815233838201523060248201526001600160a01b0391821691908481604481865afa908115610427579087918991610474575b50106104315784516370a0823160e01b815233848201528481602481865afa9081156104275790879189916103f2575b50106103b75786916064859260025416875194859384926323b872dd60e01b8452338985015260248401528a60448401525af19081156103ad578691610373575b50156103655750907f3a21688a339752733e412d508044928216e2f6865d680bca3ebec22aac7cf9ac91815193845242908401523392a280f35b8251630251a08b60e21b8152fd5b90508281813d83116103a6575b61038a8183610534565b810103126103a2575180151581036103a2573861032b565b8580fd5b503d610380565b84513d88823e3d90fd5b845162461bcd60e51b81528084018590526015602482015274546f6b656e2062616c616e636520746f6f206c6f7760581b6044820152606490fd5b809250868092503d8311610420575b61040b8183610534565b8101031261041c57869051386102ea565b8780fd5b503d610401565b86513d8a823e3d90fd5b845162461bcd60e51b8152808401859052601760248201527f546f6b656e20616c6c6f77616e636520746f6f206c6f770000000000000000006044820152606490fd5b809250868092503d831161049e575b61048d8183610534565b8101031261041c57869051386102ba565b503d610483565b8251631b88e6f960e31b8152fd5b8380fd5b84903461016a578160031936011261016a576002546001600160a01b03168152602090f35b6000546001600160a01b031633036104f057565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b90601f8019910116810190811067ffffffffffffffff82111761055657604052565b634e487b7160e01b600052604160045260246000fdfea26469706673582212202b316fb37929a836d6a5c2013b0af33f182e2319235b7f29807e699d0aa4ec9364736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.