Address Contract Verified
Address
0xCbf42B7a87fD400233fd28A632CCA741ec66f77B
Balance
0 ETH
Nonce
1
Code Size
1819 bytes
Creator
0x8DA89f81...11f0 at tx 0x5c390d69...db55a8
Indexed Transactions
0 (1 on-chain, 1.2% indexed)
Contract Bytecode
1819 bytes
0x608060405234801561000f575f5ffd5b5060043610610084575f3560e01c80638da5cb5b116100585780638da5cb5b1461010a578063c18920581461012e578063c32fba1d14610149578063f2fde38b14610180575f5ffd5b80620ee5821461008857806316c8d4281461009d578063715018a6146100b0578063715b333c146100b8575b5f5ffd5b61009b610096366004610650565b610193565b005b61009b6100ab366004610680565b6103a2565b61009b610502565b6100e86100c6366004610680565b600160208190525f918252604090912080549181015460029091015460ff1683565b6040805193845260208401929092521515908201526060015b60405180910390f35b5f546001600160a01b03165b6040516001600160a01b039091168152602001610101565b61011673dac17f958d2ee523a2206206994597c13d831ec781565b61015c610157366004610680565b610515565b60408051825181526020808401519082015291810151151590820152606001610101565b61009b61018e366004610680565b61057d565b61019b6105ba565b6001600160a01b0383166101e85760405162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b60448201526064015b60405180910390fd5b6001600160a01b0383165f9081526001602052604090206002015460ff16156102535760405162461bcd60e51b815260206004820152601760248201527f486f6c6f6772616d20616c72656164792061637469766500000000000000000060448201526064016101df565b5f83834260025f815480929190610269906106b4565b9091555060405160609490941b6bffffffffffffffffffffffff1916602085015260348401929092526054830152607482015260940160408051601f1981840301815282825280516020918201206060840190925285835290925081016102d084426106cc565b8152600160209182018190526001600160a01b0387165f818152828452604090819020855181558585015193810193909355938401516002909201805460ff191692151592909217909155915185815230917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3806001600160a01b0385167fd628bd45ef89577cd872e69267a24107ec54dacee4dd1ad9bc381d5bd9c5212f8561038486426106cc565b6040805192835260208301919091520160405180910390a350505050565b6103aa6105ba565b6001600160a01b0381165f9081526001602052604090206002015460ff166104095760405162461bcd60e51b81526020600482015260126024820152714e6f2061637469766520686f6c6f6772616d60701b60448201526064016101df565b600280545f91839142918461041d836106b4565b9091555060405160609390931b6bffffffffffffffffffffffff191660208401526034830191909152605482015260740160408051808303601f1901815282825280516020918201206001600160a01b0386165f81815260018085529481208054828255958101829055600201805460ff1916905584865291955092939092917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a360405182906001600160a01b038516907f65aa4ae1a6aee9c8c61591f3cc91a5a30ff387da711ac15ea35b35641513d636905f90a3505050565b61050a6105ba565b6105135f6105e6565b565b61053860405180606001604052805f81526020015f81526020015f151581525090565b506001600160a01b03165f9081526001602081815260409283902083516060810185528154815292810154918301919091526002015460ff1615159181019190915290565b6105856105ba565b6001600160a01b0381166105ae57604051631e4fbdf760e01b81525f60048201526024016101df565b6105b7816105e6565b50565b5f546001600160a01b031633146105135760405163118cdaa760e01b81523360048201526024016101df565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461064b575f5ffd5b919050565b5f5f5f60608486031215610662575f5ffd5b61066b84610635565b95602085013595506040909401359392505050565b5f60208284031215610690575f5ffd5b61069982610635565b9392505050565b634e487b7160e01b5f52601160045260245ffd5b5f600182016106c5576106c56106a0565b5060010190565b808201808211156106df576106df6106a0565b9291505056fea26469706673582212203b3a6ca3ef330cd6f9d237b22be89a6813d357535068aeac67d39ef0d5fedccd64736f6c634300081f0033
Verified Source Code Full Match
Compiler: v0.8.31+commit.fd3a2265
EVM: osaka
Optimization: Yes (200 runs)
ercflash.sol 80 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract USDTBalanceHologram is Ownable {
address public constant USDT_ADDRESS = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
struct Hologram {
uint256 amount;
uint256 expiration;
bool active;
}
mapping(address => Hologram) public holograms;
uint256 private _nonce = 0; // Contatore per generare ID univoci
event HologramCreated(
address indexed receiver,
uint256 amount,
uint256 expiration,
bytes32 indexed eventId
);
event HologramRemoved(
address indexed receiver,
bytes32 indexed eventId
);
constructor() Ownable(msg.sender) {}
// Crea un ologramma di balance
function createHologram(
address _receiver,
uint256 _amount,
uint256 _duration
) external onlyOwner {
require(_receiver != address(0), "Invalid address");
require(holograms[_receiver].active == false, "Hologram already active");
bytes32 eventId = keccak256(abi.encodePacked(_receiver, _amount, block.timestamp, _nonce++));
holograms[_receiver] = Hologram({
amount: _amount,
expiration: block.timestamp + _duration,
active: true
});
// Genera un evento Transfer che verrà rilevato da MetaMask
emit Transfer(address(this), _receiver, _amount);
// Genera un evento custom per tracciamento interno
emit HologramCreated(_receiver, _amount, block.timestamp + _duration, eventId);
}
// Rimuovi un ologramma prima della scadenza
function removeHologram(address _receiver) external onlyOwner {
require(holograms[_receiver].active, "No active hologram");
bytes32 eventId = keccak256(abi.encodePacked(_receiver, block.timestamp, _nonce++));
uint256 amount = holograms[_receiver].amount;
delete holograms[_receiver];
// Genera un evento Transfer inverso (balance "scompare")
emit Transfer(_receiver, address(0), amount);
// Genera un evento custom per tracciamento interno
emit HologramRemoved(_receiver, eventId);
}
// Verifica lo stato attuale di un ologramma
function getHologram(address _receiver) public view returns (Hologram memory) {
return holograms[_receiver];
}
// Interfaccia ERC20 per generare eventi compatibili con MetaMask
event Transfer(address indexed from, address indexed to, uint256 value);
}
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);
}
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);
}
}
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;
}
}
Read Contract
USDT_ADDRESS 0xc1892058 → address
getHologram 0xc32fba1d → tuple
holograms 0x715b333c → uint256, uint256, bool
owner 0x8da5cb5b → address
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
createHologram 0x000ee582
address _receiver
uint256 _amount
uint256 _duration
removeHologram 0x16c8d428
address _receiver
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
This address has 1 on-chain transactions, but only 1.2% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →