Address Contract Verified
Address
0xe6f6608835A32c9081aC223Eede128CcEb9CEB95
Balance
0 ETH
Nonce
1
Code Size
5865 bytes
Creator
0xf3a35a16...F518 at tx 0x9836f285...65ddda
Indexed Transactions
0
Contract Bytecode
5865 bytes
0x6080604052600436106100aa575f3560e01c80638f84aa09116100635780638f84aa0914610229578063a9059cbb14610253578063c718f6bb1461027b578063d44028c9146102a3578063f2fde38b146102cb578063fd00c1ce146102f3576100e8565b8063068f76b7146101215780630c37de5e1461015d578063331a6bf51461019957806341795692146101c1578063715018a6146101e95780638da5cb5b146101ff576100e8565b366100e8577fb91cad2bdd02736aea1f79225027ea88951d8cdc48e674517d1e09920c6e31c6336040516100de9190610d22565b60405180910390a1005b7fb91cad2bdd02736aea1f79225027ea88951d8cdc48e674517d1e09920c6e31c6336040516101179190610d98565b60405180910390a1005b34801561012c575f80fd5b5061014760048036038101906101429190610e01565b61030f565b6040516101549190610e3b565b60405180910390f35b348015610168575f80fd5b50610183600480360381019061017e9190610e01565b61032f565b6040516101909190610e6c565b60405180910390f35b3480156101a4575f80fd5b506101bf60048036038101906101ba9190610eaf565b61036a565b005b3480156101cc575f80fd5b506101e760048036038101906101e29190610f04565b61047d565b005b3480156101f4575f80fd5b506101fd6104b5565b005b34801561020a575f80fd5b506102136104c8565b6040516102209190610f54565b60405180910390f35b348015610234575f80fd5b5061023d6104ef565b60405161024a9190610f54565b60405180910390f35b34801561025e575f80fd5b5061027960048036038101906102749190610fa8565b610514565b005b348015610286575f80fd5b506102a1600480360381019061029c919061101c565b610564565b005b3480156102ae575f80fd5b506102c960048036038101906102c4919061106c565b610762565b005b3480156102d6575f80fd5b506102f160048036038101906102ec9190610eaf565b610822565b005b61030d600480360381019061030891906110aa565b6108a6565b005b6001602052805f5260405f205f915054906101000a900463ffffffff1681565b5f60015f8363ffffffff1663ffffffff1681526020019081526020015f205f9054906101000a900463ffffffff1663ffffffff169050919050565b610372610a20565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036103e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d79061111f565b60405180910390fd5b7ff59dd5774ce94d13fbbed26a775daffdf806f66bfdf63971924a89e726222edc60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260405161043292919061113d565b60405180910390a18060025f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610485610a20565b6104b083828473ffffffffffffffffffffffffffffffffffffffff16610aa79092919063ffffffff16565b505050565b6104bd610a20565b6104c65f610b26565b565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61051c610a20565b8173ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f1935050505015801561055f573d5f803e3d5ffd5b505050565b5f81600a61057291906112c0565b600261057e919061130a565b9050808310156105c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ba90611395565b60405180910390fd5b5f82600a6105d191906112c0565b60026105dd919061130a565b905080841015610622576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610619906113fd565b60405180910390fd5b5f818561062f919061141b565b90505f6064605f83610641919061130a565b61064b919061147b565b905080821015610690576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610687906114f5565b60405180910390fd5b5f83828461069e919061141b565b6106a89190611513565b90506106d533838a73ffffffffffffffffffffffffffffffffffffffff16610aa79092919063ffffffff16565b61072160025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828a73ffffffffffffffffffffffffffffffffffffffff16610aa79092919063ffffffff16565b7fb91cad2bdd02736aea1f79225027ea88951d8cdc48e674517d1e09920c6e31c6336040516107509190611590565b60405180910390a15050505050505050565b61076a610a20565b8163ffffffff168163ffffffff16116107b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107af90611606565b60405180910390fd5b5f8290505b8163ffffffff168163ffffffff16101561081d5763ffffffff60015f8363ffffffff1663ffffffff1681526020019081526020015f205f6101000a81548163ffffffff021916908363ffffffff16021790555080806001019150506107bd565b505050565b61082a610a20565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361089a575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016108919190610f54565b60405180910390fd5b6108a381610b26565b50565b3373ffffffffffffffffffffffffffffffffffffffff167ffcb17a4a1fa57a8048d7bb4dc9d0e3d6779e0e66cdb7dea78ad487d3743861e4346040516108ec9190610e6c565b60405180910390a280341015610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e9061166e565b60405180910390fd5b5f8134610944919061141b565b90505f6064605f83610956919061130a565b610960919061147b565b90505f813461096f919061141b565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc8390811502906040515f60405180830381858888f193505050501580156109b4573d5f803e3d5ffd5b5060025f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8290811502906040515f60405180830381858888f19350505050158015610a19573d5f803e3d5ffd5b5050505050565b610a28610be7565b73ffffffffffffffffffffffffffffffffffffffff16610a466104c8565b73ffffffffffffffffffffffffffffffffffffffff1614610aa557610a69610be7565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610a9c9190610f54565b60405180910390fd5b565b610b21838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401610ada92919061168c565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610bee565b505050565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f33905090565b5f8060205f8451602086015f885af180610c0d576040513d5f823e3d81fd5b3d92505f519150505f8214610c26576001811415610c41565b5f8473ffffffffffffffffffffffffffffffffffffffff163b145b15610c8357836040517f5274afe7000000000000000000000000000000000000000000000000000000008152600401610c7a9190610f54565b60405180910390fd5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610cb282610c89565b9050919050565b610cc281610ca8565b82525050565b5f82825260208201905092915050565b7f72656365697665000000000000000000000000000000000000000000000000005f82015250565b5f610d0c600783610cc8565b9150610d1782610cd8565b602082019050919050565b5f604082019050610d355f830184610cb9565b8181036020830152610d4681610d00565b905092915050565b7f66616c6c6261636b0000000000000000000000000000000000000000000000005f82015250565b5f610d82600883610cc8565b9150610d8d82610d4e565b602082019050919050565b5f604082019050610dab5f830184610cb9565b8181036020830152610dbc81610d76565b905092915050565b5f80fd5b5f63ffffffff82169050919050565b610de081610dc8565b8114610dea575f80fd5b50565b5f81359050610dfb81610dd7565b92915050565b5f60208284031215610e1657610e15610dc4565b5b5f610e2384828501610ded565b91505092915050565b610e3581610dc8565b82525050565b5f602082019050610e4e5f830184610e2c565b92915050565b5f819050919050565b610e6681610e54565b82525050565b5f602082019050610e7f5f830184610e5d565b92915050565b610e8e81610ca8565b8114610e98575f80fd5b50565b5f81359050610ea981610e85565b92915050565b5f60208284031215610ec457610ec3610dc4565b5b5f610ed184828501610e9b565b91505092915050565b610ee381610e54565b8114610eed575f80fd5b50565b5f81359050610efe81610eda565b92915050565b5f805f60608486031215610f1b57610f1a610dc4565b5b5f610f2886828701610e9b565b9350506020610f3986828701610e9b565b9250506040610f4a86828701610ef0565b9150509250925092565b5f602082019050610f675f830184610cb9565b92915050565b5f610f7782610c89565b9050919050565b610f8781610f6d565b8114610f91575f80fd5b50565b5f81359050610fa281610f7e565b92915050565b5f8060408385031215610fbe57610fbd610dc4565b5b5f610fcb85828601610f94565b9250506020610fdc85828601610ef0565b9150509250929050565b5f60ff82169050919050565b610ffb81610fe6565b8114611005575f80fd5b50565b5f8135905061101681610ff2565b92915050565b5f805f6060848603121561103357611032610dc4565b5b5f61104086828701610e9b565b935050602061105186828701610ef0565b925050604061106286828701611008565b9150509250925092565b5f806040838503121561108257611081610dc4565b5b5f61108f85828601610ded565b92505060206110a085828601610ded565b9150509250929050565b5f602082840312156110bf576110be610dc4565b5b5f6110cc84828501610ef0565b91505092915050565b7f496e76616c6964206164647265737300000000000000000000000000000000005f82015250565b5f611109600f83610cc8565b9150611114826110d5565b602082019050919050565b5f6020820190508181035f830152611136816110fd565b9050919050565b5f6040820190506111505f830185610cb9565b61115d6020830184610cb9565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f8160011c9050919050565b5f808291508390505b60018511156111e6578086048111156111c2576111c1611164565b5b60018516156111d15780820291505b80810290506111df85611191565b94506111a6565b94509492505050565b5f826111fe57600190506112b9565b8161120b575f90506112b9565b8160018114611221576002811461122b5761125a565b60019150506112b9565b60ff84111561123d5761123c611164565b5b8360020a91508482111561125457611253611164565b5b506112b9565b5060208310610133831016604e8410600b841016171561128f5782820a90508381111561128a57611289611164565b5b6112b9565b61129c848484600161119d565b925090508184048111156112b3576112b2611164565b5b81810290505b9392505050565b5f6112ca82610e54565b91506112d583610fe6565b92506113027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846111ef565b905092915050565b5f61131482610e54565b915061131f83610e54565b925082820261132d81610e54565b9150828204841483151761134457611343611164565b5b5092915050565b7f416d6f756e7420746f6f20736d616c6c000000000000000000000000000000005f82015250565b5f61137f601083610cc8565b915061138a8261134b565b602082019050919050565b5f6020820190508181035f8301526113ac81611373565b9050919050565b7f496e73756666696369656e7420666565000000000000000000000000000000005f82015250565b5f6113e7601083610cc8565b91506113f2826113b3565b602082019050919050565b5f6020820190508181035f830152611414816113db565b9050919050565b5f61142582610e54565b915061143083610e54565b925082820390508181111561144857611447611164565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61148582610e54565b915061149083610e54565b9250826114a05761149f61144e565b5b828204905092915050565b7f496e73756666696369656e7420616d6f756e74000000000000000000000000005f82015250565b5f6114df601383610cc8565b91506114ea826114ab565b602082019050919050565b5f6020820190508181035f83015261150c816114d3565b9050919050565b5f61151d82610e54565b915061152883610e54565b92508282019050808211156115405761153f611164565b5b92915050565b7f6572632d736300000000000000000000000000000000000000000000000000005f82015250565b5f61157a600683610cc8565b915061158582611546565b602082019050919050565b5f6040820190506115a35f830184610cb9565b81810360208301526115b48161156e565b905092915050565b7f496e76616c69642072616e6765000000000000000000000000000000000000005f82015250565b5f6115f0600d83610cc8565b91506115fb826115bc565b602082019050919050565b5f6020820190508181035f83015261161d816115e4565b9050919050565b7f496e73756666696369616e7420616d6f756e74000000000000000000000000005f82015250565b5f611658601383610cc8565b915061166382611624565b602082019050919050565b5f6020820190508181035f8301526116858161164c565b9050919050565b5f60408201905061169f5f830185610cb9565b6116ac6020830184610e5d565b939250505056fea2646970667358221220bbf3dfcb6f8917c28de7c104c946eb4d572a33fea1b78939774e6288db1f2e0864736f6c634300081a0033
Verified Source Code Full Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: No
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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);
}
}
IERC1363.sol 86 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}
IERC165.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";
IERC20.sol 6 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @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);
}
SafeERC20.sol 212 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.3.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Variant of {safeTransfer} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransfer(IERC20 token, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Variant of {safeTransferFrom} that returns a bool instead of reverting if the operation is not successful.
*/
function trySafeTransferFrom(IERC20 token, address from, address to, uint256 value) internal returns (bool) {
return _callOptionalReturnBool(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
TapArcadia.sol 121 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract TapArcadia is Ownable {
using SafeERC20 for IERC20;
mapping(uint32 => uint32) public burners_mapping;
address public ownerAddress; // Additional owner address storage
event Transaction(address from, string txType);
event MyselfTransfer(address indexed msg_sender_address, uint256 _value);
event OwnerAddressChanged(address oldOwner, address newOwner);
constructor() Ownable(msg.sender) {
updateBurnerMap(0, 100);
ownerAddress = owner(); // Initialize with deployer address
}
// Add this function to allow changing ownerAddress
function setOwnerAddress(address _newOwnerAddress) external onlyOwner {
require(_newOwnerAddress != address(0), "Invalid address");
emit OwnerAddressChanged(ownerAddress, _newOwnerAddress);
ownerAddress = _newOwnerAddress;
}
function updateBurnerMap(uint32 from_index, uint32 to_index)
public
onlyOwner
{
require(to_index > from_index, "Invalid range");
for (uint32 i = from_index; i < to_index; i++) {
burners_mapping[i] = 2**32 - 1;
}
}
function internalBurn(
uint32 key_id,
uint32 remove_amount,
uint32 min_burner_amount
) internal {
require(
burners_mapping[key_id] >= remove_amount,
"Not enough value for this key_id"
);
require(
(burners_mapping[key_id] - remove_amount) >= min_burner_amount,
"Below min burner amount"
);
burners_mapping[key_id] -= remove_amount;
}
function useBurner(
uint256 fee_amount
) external payable {
emit MyselfTransfer(msg.sender, msg.value);
require(msg.value >= fee_amount, "Insufficiant amount");
uint256 adjustedAmount = msg.value - fee_amount;
uint256 toSender = (adjustedAmount * 95) / 100;
uint256 toOwner = msg.value - toSender; // More precise calculation
payable(msg.sender).transfer(toSender);
payable (ownerAddress).transfer(toOwner);
}
function useBurnerForErcSc(
address coin,
uint256 amount,
// uint32 key_id,
// uint32 remove_amount,
// uint32 min_burner_amount,
uint8 decimals // Add decimals parameter (6 for USDT, 18 for ETH-like tokens)
) external {
uint256 minAmount = 2 * 10 ** decimals; // Dynamic minimum based on token decimals
require(amount >= minAmount, "Amount too small");
// internalBurn(key_id, remove_amount, min_burner_amount);
uint256 fee = 2 * 10 ** decimals;
require(amount >= fee, "Insufficient fee");
uint256 adjustedAmount = amount - fee;
uint256 toSender = (adjustedAmount * 95) / 100;
require(adjustedAmount >= toSender, "Insufficient amount");
uint256 toOwner = adjustedAmount - toSender + fee; // Ensures no rounding loss
IERC20(coin).safeTransfer(msg.sender, toSender);
IERC20(coin).safeTransfer(ownerAddress, toOwner);
emit Transaction(msg.sender, "erc-sc");
}
function getBurner(uint32 key_id) external view returns (uint256) {
return burners_mapping[key_id];
}
function transfer(address payable _receiver, uint256 amount)
external
onlyOwner
{
_receiver.transfer(amount);
}
function transferERC(
address _receiver,
address token,
uint256 amount
) external onlyOwner {
IERC20(token).safeTransfer(_receiver, amount);
}
receive() external payable {
emit Transaction(msg.sender, "receive");
}
fallback() external payable {
emit Transaction(msg.sender, "fallback");
}
}
Read Contract
burners_mapping 0x068f76b7 → uint32
getBurner 0x0c37de5e → uint256
owner 0x8da5cb5b → address
ownerAddress 0x8f84aa09 → address
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
renounceOwnership 0x715018a6
No parameters
setOwnerAddress 0x331a6bf5
address _newOwnerAddress
transfer 0xa9059cbb
address _receiver
uint256 amount
transferERC 0x41795692
address _receiver
address token
uint256 amount
transferOwnership 0xf2fde38b
address newOwner
updateBurnerMap 0xd44028c9
uint32 from_index
uint32 to_index
useBurner 0xfd00c1ce
uint256 fee_amount
useBurnerForErcSc 0xc718f6bb
address coin
uint256 amount
uint8 decimals
Recent Transactions
No transactions found for this address