Source Code
Overview
ETH Balance
0 ETH
More Info
ContractCreator
TokenTracker
Multichain Info
N/A
Latest 16 from a total of 16 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
Amount
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Approve And Call | 33059034 | 39 days ago | IN | 0 ETH | 0.00000007 | ||||
| Get Faucet Token... | 33058218 | 39 days ago | IN | 0 ETH | 0.00000004 | ||||
| Get Faucet Token... | 31415186 | 77 days ago | IN | 0 ETH | 0.00000002 | ||||
| Approve And Call | 31414266 | 77 days ago | IN | 0 ETH | 0.00000011 | ||||
| Approve | 31414225 | 77 days ago | IN | 0 ETH | 0.00000005 | ||||
| Get Faucet Token... | 31321623 | 79 days ago | IN | 0 ETH | 0.00000002 | ||||
| Approve | 31318987 | 80 days ago | IN | 0 ETH | 0.00000004 | ||||
| Get Faucet Token... | 31318859 | 80 days ago | IN | 0 ETH | 0.00000002 | ||||
| Approve | 31052836 | 86 days ago | IN | 0 ETH | 0.00000004 | ||||
| Get Faucet Token... | 31051965 | 86 days ago | IN | 0 ETH | 0.00000004 | ||||
| Approve | 30568011 | 97 days ago | IN | 0 ETH | 0.00000005 | ||||
| Approve | 30540654 | 98 days ago | IN | 0 ETH | 0.00000005 | ||||
| Get Faucet Token... | 30540612 | 98 days ago | IN | 0 ETH | 0.00000003 | ||||
| Get Faucet Token... | 30540579 | 98 days ago | IN | 0 ETH | 0.00000003 | ||||
| Get Faucet Token... | 30540529 | 98 days ago | IN | 0 ETH | 0.00000005 | ||||
| Approve | 30540263 | 98 days ago | IN | 0 ETH | 0.00000005 |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x33646a45...0fC2EB689 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
Test0xBTC
Compiler Version
v0.8.28+commit.7893614a
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.0;
/// @notice Interface for contracts that can receive token approvals and execute logic
/// @dev This abstract contract defines the callback function that spender contracts must implement
/// @dev Used in conjunction with approveAndCall to enable atomic approve + call transactions
abstract contract ApproveAndCallFallBack {
/// @notice Callback function called when tokens are approved via approveAndCall
/// @dev This function should contain the logic to execute after receiving token approval
/// @param from The address that approved the tokens
/// @param tokens The amount of tokens approved
/// @param token The address of the token contract that called this function
/// @param data Additional data passed from the approveAndCall function
function receiveApproval(address from, uint256 tokens, address token, bytes calldata data) public virtual;
}
/// @notice Main contract for Test0xBitcoin token
contract Test0xBTC {
/// @notice Token name identifier
string public name = "Test0xBitcoin";
/// @notice Token symbol for trading/display purposes
string public symbol = "T0XBTC";
/// @notice Number of decimal places for token precision
uint8 public decimals = 8;
// uint256 public totalSupply;
/// @notice Mapping to track balance of each address
mapping(address => uint256) public balanceOf;
/// @notice Nested mapping for allowances (owner -> spender -> amount)
mapping(address => mapping(address => uint256)) public allowance;
/// @notice Event emitted when tokens are transferred
event Transfer(address indexed from, address indexed to, uint256 value);
/// @notice Event emitted when allowance is set/approved
event Approval(address indexed owner, address indexed spender, uint256 value);
/// @notice Constructor to initialize the contract with initial token supply
constructor() {
/// @notice Initial token supply calculation variable
uint256 initialSupply = 11000000 * 10 ** uint256(decimals); // 21 million tokens
balanceOf[msg.sender] = initialSupply;
// totalSupply = initialSupply;
emit Transfer(address(0), msg.sender, initialSupply);
}
/// @notice Faucet function to distribute test tokens
function getFaucetTokens_Testnet_0xBTC() public {
/// @notice Amount of tokens to distribute from faucet
uint sendz = 10* 10 ** decimals; //10 tokens
balanceOf[msg.sender] += sendz;
// totalSupply += sendz;
emit Transfer(address(0), msg.sender, sendz);
}
/// @notice Standard ERC20 transfer function for sending tokens
/// @param to recipient address for the token transfer
/// @param value amount of tokens to transfer
/// @return bool returns true if transfer is successful
function transfer(address to, uint256 value) public returns (bool) {
require(balanceOf[msg.sender] >= value, "Insufficient balance");
_transfer(msg.sender, to, value);
return true;
}
/// @notice Standard ERC20 approve function for setting allowances
/// @param spender address that will be allowed to spend tokens
/// @param value amount of tokens that can be spent
/// @return bool returns true if approval is successful
function approve(address spender, uint256 value) public returns (bool) {
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/// @notice Standard ERC20 transferFrom function for spending approved tokens
/// @param from address to transfer tokens from
/// @param to address to transfer tokens to
/// @param value amount of tokens to transfer
/// @return bool returns true if transfer is successful
function transferFrom(address from, address to, uint256 value) public returns (bool) {
require(balanceOf[from] >= value, "Insufficient balance");
require(allowance[from][msg.sender] >= value, "Allowance exceeded");
allowance[from][msg.sender] -= value;
_transfer(from, to, value);
return true;
}
/// @notice Internal helper function to handle token transfers
/// @param from address to transfer tokens from
/// @param to address to transfer tokens to
/// @param value amount of tokens to transfer
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0), "Transfer to zero address");
balanceOf[from] -= value;
balanceOf[to] += value;
emit Transfer(from, to, value);
}
/// @notice Approve tokens for spending and call a contract function in one transaction
/// @dev This function combines approval and contract call to avoid the need for separate transactions
/// @dev The spender contract must implement ApproveAndCallFallBack interface with receiveApproval function
/// @param spender The address authorized to spend the tokens
/// @param tokens The amount of tokens to approve for spending
/// @param data Additional data to pass to the spender contract's receiveApproval function
/// @return success Returns true if the approval and call were successful
function approveAndCall(address spender, uint tokens, bytes calldata data) public returns (bool success) {
allowance[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"viaIR": true,
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokens","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"approveAndCall","outputs":[{"internalType":"bool","name":"success","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFaucetTokens_Testnet_0xBTC","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
0x6080604052346101425760006100158154610147565b601f8111610118575b507f546573743078426974636f696e0000000000000000000000000000000000001a815560015461004e90610147565b601f81116100d0575b50600c6554305842544360d01b01600155600860ff19600254161760025550600033815260036020526603e871b540c0006040822055604051906603e871b540c00082527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203393a360405161086190816101828239f35b60018252601f0160051c7fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6908101905b81811061010d5750610057565b828155600101610100565b818052601f60208320910160051c8101905b818110610137575061001e565b82815560010161012a565b600080fd5b90600182811c92168015610177575b602083101461016157565b634e487b7160e01b600052602260045260246000fd5b91607f169161015656fe6080604052600436101561001257600080fd5b6000803560e01c806306fdde03146105a6578063095ea7b31461052957806323b872dd14610458578063313ce5671461043757806340b533ef146103aa57806370a082311461037157806395d89b4114610268578063a9059cbb14610227578063cae9ca51146100e25763dd62ed3e1461008b57600080fd5b346100df5760403660031901126100df5760406100a66106c5565b916100af6106e0565b9260018060a01b031681526004602052209060018060a01b03166000526020526020604060002054604051908152f35b80fd5b50346100df5760603660031901126100df576100fc6106c5565b8160243560443567ffffffffffffffff811161022357366023820112156102235780600401359367ffffffffffffffff851161021f57366024868401011161021f5733845260046020526040842060018060a01b038216855260205282604085205560018060a01b031690816040518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3813b1561021f578360a46024948760405198899788968794638f4ffcb160e01b8652336004870152828601523060448601526080606486015282608486015201848401378181018301849052601f01601f191681010301925af1801561021457610204575b602060405160018152f35b8161020e91610644565b386101f9565b6040513d84823e3d90fd5b8380fd5b8280fd5b50346100df5760403660031901126100df5760406101f99161026261024a6106c5565b916024359384913381526003602052205410156106f6565b33610769565b50346100df57806003193601126100df576040519080600154908160011c91600181168015610367575b6020841081146103535783865290811561032c57506001146102cf575b6102cb846102bf81860382610644565b6040519182918261067c565b0390f35b600181527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6939250905b808210610312575090915081016020016102bf826102af565b9192600181602092548385880101520191019092916102f9565b60ff191660208087019190915292151560051b850190920192506102bf91508390506102af565b634e487b7160e01b83526022600452602483fd5b92607f1692610292565b50346100df5760203660031901126100df576020906040906001600160a01b036103996106c5565b168152600383522054604051908152f35b50346100df57806003193601126100df5760ff60025416604d811161042357600a0a80600a0290600a820403610423573382526003602052604082206103f182825461075c565b9055604051908152817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203393a380f35b634e487b7160e01b82526011600452602482fd5b50346100df57806003193601126100df57602060ff60025416604051908152f35b50346100df5760603660031901126100df576104726106c5565b61047a6106e0565b6044359160018060a01b038116808552600360205261049f84604087205410156106f6565b80855260046020908152604080872033885290915285205484116104ef57846040916101f99652600460205281812060018060a01b0333168252602052206104e8848254610739565b9055610769565b60405162461bcd60e51b8152602060048201526012602482015271105b1b1bddd85b98d948195e18d95959195960721b6044820152606490fd5b50346100df5760403660031901126100df576040906105466106c5565b33808352600460209081528484206001600160a01b03909316808552928152939092206024359081905560405190815290927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a3602060405160018152f35b50346100df57806003193601126100df5760405190808054908160011c9160018116801561063a575b6020841081146103535783865290811561032c57506001146105fb576102cb846102bf81860382610644565b80805260208120939250905b808210610620575090915081016020016102bf826102af565b919260018160209254838588010152019101909291610607565b92607f16926105cf565b90601f8019910116810190811067ffffffffffffffff82111761066657604052565b634e487b7160e01b600052604160045260246000fd5b91909160208152825180602083015260005b8181106106af575060409293506000838284010152601f8019910116010190565b806020809287010151604082860101520161068e565b600435906001600160a01b03821682036106db57565b600080fd5b602435906001600160a01b03821682036106db57565b156106fd57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b9190820391821161074657565b634e487b7160e01b600052601160045260246000fd5b9190820180921161074657565b6001600160a01b03909116919082156107e65760207fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9160018060a01b031692836000526003825260406000206107c1828254610739565b9055846000526003825260406000206107db82825461075c565b9055604051908152a3565b60405162461bcd60e51b815260206004820152601860248201527f5472616e7366657220746f207a65726f206164647265737300000000000000006044820152606490fdfea2646970667358221220c7a8956ec49d6660d6b302b4382243e8a782e5fe7a9ada9bc7e14cdbc31fb5ac64736f6c634300081c0033
Deployed Bytecode
0x6080604052600436101561001257600080fd5b6000803560e01c806306fdde03146105a6578063095ea7b31461052957806323b872dd14610458578063313ce5671461043757806340b533ef146103aa57806370a082311461037157806395d89b4114610268578063a9059cbb14610227578063cae9ca51146100e25763dd62ed3e1461008b57600080fd5b346100df5760403660031901126100df5760406100a66106c5565b916100af6106e0565b9260018060a01b031681526004602052209060018060a01b03166000526020526020604060002054604051908152f35b80fd5b50346100df5760603660031901126100df576100fc6106c5565b8160243560443567ffffffffffffffff811161022357366023820112156102235780600401359367ffffffffffffffff851161021f57366024868401011161021f5733845260046020526040842060018060a01b038216855260205282604085205560018060a01b031690816040518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560203392a3813b1561021f578360a46024948760405198899788968794638f4ffcb160e01b8652336004870152828601523060448601526080606486015282608486015201848401378181018301849052601f01601f191681010301925af1801561021457610204575b602060405160018152f35b8161020e91610644565b386101f9565b6040513d84823e3d90fd5b8380fd5b8280fd5b50346100df5760403660031901126100df5760406101f99161026261024a6106c5565b916024359384913381526003602052205410156106f6565b33610769565b50346100df57806003193601126100df576040519080600154908160011c91600181168015610367575b6020841081146103535783865290811561032c57506001146102cf575b6102cb846102bf81860382610644565b6040519182918261067c565b0390f35b600181527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6939250905b808210610312575090915081016020016102bf826102af565b9192600181602092548385880101520191019092916102f9565b60ff191660208087019190915292151560051b850190920192506102bf91508390506102af565b634e487b7160e01b83526022600452602483fd5b92607f1692610292565b50346100df5760203660031901126100df576020906040906001600160a01b036103996106c5565b168152600383522054604051908152f35b50346100df57806003193601126100df5760ff60025416604d811161042357600a0a80600a0290600a820403610423573382526003602052604082206103f182825461075c565b9055604051908152817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60203393a380f35b634e487b7160e01b82526011600452602482fd5b50346100df57806003193601126100df57602060ff60025416604051908152f35b50346100df5760603660031901126100df576104726106c5565b61047a6106e0565b6044359160018060a01b038116808552600360205261049f84604087205410156106f6565b80855260046020908152604080872033885290915285205484116104ef57846040916101f99652600460205281812060018060a01b0333168252602052206104e8848254610739565b9055610769565b60405162461bcd60e51b8152602060048201526012602482015271105b1b1bddd85b98d948195e18d95959195960721b6044820152606490fd5b50346100df5760403660031901126100df576040906105466106c5565b33808352600460209081528484206001600160a01b03909316808552928152939092206024359081905560405190815290927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a3602060405160018152f35b50346100df57806003193601126100df5760405190808054908160011c9160018116801561063a575b6020841081146103535783865290811561032c57506001146105fb576102cb846102bf81860382610644565b80805260208120939250905b808210610620575090915081016020016102bf826102af565b919260018160209254838588010152019101909291610607565b92607f16926105cf565b90601f8019910116810190811067ffffffffffffffff82111761066657604052565b634e487b7160e01b600052604160045260246000fd5b91909160208152825180602083015260005b8181106106af575060409293506000838284010152601f8019910116010190565b806020809287010151604082860101520161068e565b600435906001600160a01b03821682036106db57565b600080fd5b602435906001600160a01b03821682036106db57565b156106fd57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b9190820391821161074657565b634e487b7160e01b600052601160045260246000fd5b9190820180921161074657565b6001600160a01b03909116919082156107e65760207fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9160018060a01b031692836000526003825260406000206107c1828254610739565b9055846000526003825260406000206107db82825461075c565b9055604051908152a3565b60405162461bcd60e51b815260206004820152601860248201527f5472616e7366657220746f207a65726f206164647265737300000000000000006044820152606490fdfea2646970667358221220c7a8956ec49d6660d6b302b4382243e8a782e5fe7a9ada9bc7e14cdbc31fb5ac64736f6c634300081c0033
Loading...
Loading
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.