Address Contract Verified
Address
0x28c3501fd8a248c6ac334C065FE7907062953CfD
Balance
0 ETH
Nonce
1
Code Size
3648 bytes
Creator
0x9299DBA9...E8e5 at tx 0x70d5e3fb...315bdd
Indexed Transactions
0
Contract Bytecode
3648 bytes
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb14610294578063d505accf146102a7578063dd62ed3e146102ba578063f2fde38b146102e5578063fca3b5aa146102f857600080fd5b806370a08231146102265780637ecebe00146102465780638da5cb5b1461026657806395d89b41146102795780639dc29fac1461028157600080fd5b806323b872dd116100f457806323b872dd146101a9578063313ce567146101bc57806332cb6b0c146101f55780633644e5151461020957806340c10f191461021157600080fd5b806306fdde03146101265780630754617214610144578063095ea7b31461016f57806318160ddd14610192575b600080fd5b61012e61030b565b60405161013b9190610b17565b60405180910390f35b600754610157906001600160a01b031681565b6040516001600160a01b03909116815260200161013b565b61018261017d366004610b81565b610399565b604051901515815260200161013b565b61019b60025481565b60405190815260200161013b565b6101826101b7366004610bab565b610406565b6101e37f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff909116815260200161013b565b61019b6c0c9f2c9cd04674edea4000000081565b61019b6104e6565b61022461021f366004610b81565b610541565b005b61019b610234366004610be7565b60036020526000908152604090205481565b61019b610254366004610be7565b60056020526000908152604090205481565b600654610157906001600160a01b031681565b61012e6105e2565b61022461028f366004610b81565b6105ef565b6101826102a2366004610b81565b610623565b6102246102b5366004610c09565b610689565b61019b6102c8366004610c7c565b600460209081526000928352604080842090915290825290205481565b6102246102f3366004610be7565b6108cd565b610224610306366004610be7565b610943565b6000805461031890610caf565b80601f016020809104026020016040519081016040528092919081815260200182805461034490610caf565b80156103915780601f1061036657610100808354040283529160200191610391565b820191906000526020600020905b81548152906001019060200180831161037457829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906103f49086815260200190565b60405180910390a35060015b92915050565b6001600160a01b038316600090815260046020908152604080832033845290915281205460001981146104625761043d8382610cff565b6001600160a01b03861660009081526004602090815260408083203384529091529020555b6001600160a01b0385166000908152600360205260408120805485929061048a908490610cff565b90915550506001600160a01b0380851660008181526003602052604090819020805487019055519091871690600080516020610deb833981519152906104d39087815260200190565b60405180910390a3506001949350505050565b60007f0000000000000000000000000000000000000000000000000000000000000001461461051c576105176109c1565b905090565b507f414119fed7a19c75e88173d5a0b5c87b7a2af7f4067087a1f8649051298f527990565b6007546001600160a01b031633146105745760405162461bcd60e51b815260040161056b90610d12565b60405180910390fd5b6c0c9f2c9cd04674edea40000000816002546105909190610d38565b11156105d45760405162461bcd60e51b815260206004820152601360248201527213505617d4d55414131657d15610d151511151606a1b604482015260640161056b565b6105de8282610a5b565b5050565b6001805461031890610caf565b6007546001600160a01b031633146106195760405162461bcd60e51b815260040161056b90610d12565b6105de8282610ab5565b33600090815260036020526040812080548391908390610644908490610cff565b90915550506001600160a01b03831660008181526003602052604090819020805485019055513390600080516020610deb833981519152906103f49086815260200190565b428410156106d95760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f45585049524544000000000000000000604482015260640161056b565b600060016106e56104e6565b6001600160a01b038a811660008181526005602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156107f1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906108275750876001600160a01b0316816001600160a01b0316145b6108645760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b604482015260640161056b565b6001600160a01b0390811660009081526004602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b6006546001600160a01b031633146108f75760405162461bcd60e51b815260040161056b90610d12565b600680546001600160a01b0319166001600160a01b03831690811790915560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a350565b6006546001600160a01b0316331461096d5760405162461bcd60e51b815260040161056b90610d12565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f726b590ef91a8c76ad05bbe91a57ef84605276528f49cd47d787f558a4e755b69060200160405180910390a150565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60006040516109f39190610d4b565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b8060026000828254610a6d9190610d38565b90915550506001600160a01b038216600081815260036020908152604080832080548601905551848152600080516020610deb83398151915291015b60405180910390a35050565b6001600160a01b03821660009081526003602052604081208054839290610add908490610cff565b90915550506002805482900390556040518181526000906001600160a01b03841690600080516020610deb83398151915290602001610aa9565b600060208083528351808285015260005b81811015610b4457858101830151858201604001528201610b28565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610b7c57600080fd5b919050565b60008060408385031215610b9457600080fd5b610b9d83610b65565b946020939093013593505050565b600080600060608486031215610bc057600080fd5b610bc984610b65565b9250610bd760208501610b65565b9150604084013590509250925092565b600060208284031215610bf957600080fd5b610c0282610b65565b9392505050565b600080600080600080600060e0888a031215610c2457600080fd5b610c2d88610b65565b9650610c3b60208901610b65565b95506040880135945060608801359350608088013560ff81168114610c5f57600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610c8f57600080fd5b610c9883610b65565b9150610ca660208401610b65565b90509250929050565b600181811c90821680610cc357607f821691505b602082108103610ce357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561040057610400610ce9565b6020808252600c908201526b15539055551213d49256915160a21b604082015260600190565b8082018082111561040057610400610ce9565b600080835481600182811c915080831680610d6757607f831692505b60208084108203610d8657634e487b7160e01b86526022600452602486fd5b818015610d9a5760018114610daf57610ddc565b60ff1986168952841515850289019650610ddc565b60008a81526020902060005b86811015610dd45781548b820152908501908301610dbb565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212207dcca9b9da6e14d906152727c84e838e0459f181fc6f0fc15c0e67a77a49a00364736f6c63430008140033
Verified Source Code Full Match
Compiler: v0.8.20+commit.a1b79de6
EVM: paris
Optimization: Yes (200 runs)
BAYC.sol 54 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
import { Owned } from "solmate/auth/Owned.sol";
import { ERC20 } from "solmate/tokens/ERC20.sol";
/// @title BAYC memecoin
/// @notice This contract implements an ERC20 token with minting and burning capabilities.
/// @dev Inherits from ERC20 and Owned contracts.
contract BAYC is ERC20, Owned {
uint256 public constant MAX_SUPPLY = 1_000_000_000_000 * 10 ** 18;
/// @notice Address of the minter
address public minter;
/// @notice Event emitted when the minter is set
/// @param minter The address of the new minter
event MinterSet(address minter);
/// @notice Constructor to initialize the token and set the owner
/// @param _owner The address of the owner
constructor(address _owner) ERC20("BAYC", "BAYC", 18) Owned(_owner) {
emit Transfer(address(0), msg.sender, 0);
}
/// @notice Mints new tokens
/// @dev Only the minter can call this function
/// @param to The address to mint tokens to
/// @param amount The amount of tokens to mint
function mint(address to, uint256 amount) external {
require(msg.sender == minter, "UNAUTHORIZED");
require(totalSupply + amount <= MAX_SUPPLY, "MAX_SUPPLY_EXCEEDED");
_mint(to, amount);
}
/// @notice Burns tokens
/// @dev Only the minter can call this function
/// @param from The address to burn tokens from
/// @param amount The amount of tokens to burn
function burn(address from, uint256 amount) external {
require(msg.sender == minter, "UNAUTHORIZED");
_burn(from, amount);
}
/*** Admin functions ***/
/// @notice Sets the minter address
/// @dev Only the owner can call this function
/// @param _minter The address of the new minter
function setMinter(address _minter) external onlyOwner {
minter = _minter;
emit MinterSet(_minter);
}
}
Owned.sol 44 lines
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Simple single owner authorization mixin.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)
abstract contract Owned {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event OwnershipTransferred(address indexed user, address indexed newOwner);
/*//////////////////////////////////////////////////////////////
OWNERSHIP STORAGE
//////////////////////////////////////////////////////////////*/
address public owner;
modifier onlyOwner() virtual {
require(msg.sender == owner, "UNAUTHORIZED");
_;
}
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(address _owner) {
owner = _owner;
emit OwnershipTransferred(address(0), _owner);
}
/*//////////////////////////////////////////////////////////////
OWNERSHIP LOGIC
//////////////////////////////////////////////////////////////*/
function transferOwnership(address newOwner) public virtual onlyOwner {
owner = newOwner;
emit OwnershipTransferred(msg.sender, newOwner);
}
}
ERC20.sol 206 lines
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
//////////////////////////////////////////////////////////////*/
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
/*//////////////////////////////////////////////////////////////
METADATA STORAGE
//////////////////////////////////////////////////////////////*/
string public name;
string public symbol;
uint8 public immutable decimals;
/*//////////////////////////////////////////////////////////////
ERC20 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
/*//////////////////////////////////////////////////////////////
EIP-2612 STORAGE
//////////////////////////////////////////////////////////////*/
uint256 internal immutable INITIAL_CHAIN_ID;
bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;
mapping(address => uint256) public nonces;
/*//////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////*/
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals
) {
name = _name;
symbol = _symbol;
decimals = _decimals;
INITIAL_CHAIN_ID = block.chainid;
INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
}
/*//////////////////////////////////////////////////////////////
ERC20 LOGIC
//////////////////////////////////////////////////////////////*/
function approve(address spender, uint256 amount) public virtual returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transfer(address to, uint256 amount) public virtual returns (bool) {
balanceOf[msg.sender] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) public virtual returns (bool) {
uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.
if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;
balanceOf[from] -= amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(from, to, amount);
return true;
}
/*//////////////////////////////////////////////////////////////
EIP-2612 LOGIC
//////////////////////////////////////////////////////////////*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
// Unchecked because the only math done is incrementing
// the owner's nonce which cannot realistically overflow.
unchecked {
address recoveredAddress = ecrecover(
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR(),
keccak256(
abi.encode(
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
),
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
),
v,
r,
s
);
require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");
allowance[recoveredAddress][spender] = value;
}
emit Approval(owner, spender, value);
}
function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
}
function computeDomainSeparator() internal view virtual returns (bytes32) {
return
keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256("1"),
block.chainid,
address(this)
)
);
}
/*//////////////////////////////////////////////////////////////
INTERNAL MINT/BURN LOGIC
//////////////////////////////////////////////////////////////*/
function _mint(address to, uint256 amount) internal virtual {
totalSupply += amount;
// Cannot overflow because the sum of all user
// balances can't exceed the max uint256 value.
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function _burn(address from, uint256 amount) internal virtual {
balanceOf[from] -= amount;
// Cannot underflow because a user's balance
// will never be larger than the total supply.
unchecked {
totalSupply -= amount;
}
emit Transfer(from, address(0), amount);
}
}
Read Contract
DOMAIN_SEPARATOR 0x3644e515 → bytes32
MAX_SUPPLY 0x32cb6b0c → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
minter 0x07546172 → address
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x9dc29fac
address from
uint256 amount
mint 0x40c10f19
address to
uint256 amount
permit 0xd505accf
address owner
address spender
uint256 value
uint256 deadline
uint8 v
bytes32 r
bytes32 s
setMinter 0xfca3b5aa
address _minter
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address