Address Contract Verified
Address
0xa7F3508cfcF054Cc9cf1440580B78784E07382dB
Balance
0 ETH
Nonce
1
Code Size
4839 bytes
Creator
0x1002f401...c0bb at tx 0xfd0d4cdd...30f4dd
Indexed Transactions
0
Contract Bytecode
4839 bytes
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806370a082311161010f5780639ce69679116100a2578063bcdc686e11610071578063bcdc686e146103ea578063ca3a0d72146103f2578063dd62ed3e14610405578063f2fde38b1461041857600080fd5b80639ce696791461039d578063a457c2d7146103b0578063a9059cbb146103c3578063b7f2fa86146103d657600080fd5b8063867ecf33116100de578063867ecf331461035e5780638da5cb5b1461037157806395d89b41146103825780639b5f95b01461038a57600080fd5b806370a0823114610311578063715018a61461033a57806377e2543d146103425780637c9f4ef81461034b57600080fd5b806324b8cf2411610187578063395093511161015657806339509351146102c557806342966c68146102d85780635b02a0d9146102eb578063704b6c02146102fe57600080fd5b806324b8cf241461028e5780632b3e99f71461029a5780632ee4887e146102a3578063313ce567146102b657600080fd5b806312333a12116101c357806312333a12146102525780631249c58b1461026957806318160ddd1461027357806323b872dd1461027b57600080fd5b806301bc45c9146101ea57806306fdde031461021a578063095ea7b31461022f575b600080fd5b6009546101fd906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b61022261042b565b60405161021191906110ae565b61024261023d366004611118565b6104bd565b6040519015158152602001610211565b61025b600b5481565b604051908152602001610211565b6102716104d7565b005b60025461025b565b610242610289366004611142565b61060f565b61025b64174876e80081565b61025b600a5481565b6102716102b136600461117e565b610633565b60405160128152602001610211565b6102426102d3366004611118565b61065d565b6102716102e63660046111a0565b61067f565b6102716102f93660046111a0565b6106a3565b61027161030c36600461117e565b610799565b61025b61031f36600461117e565b6001600160a01b031660009081526020819052604090205490565b6102716107c3565b61025b600c5481565b6008546101fd906001600160a01b031681565b61025b61036c3660046111a0565b6107d5565b6006546001600160a01b03166101fd565b6102226107ec565b6007546101fd906001600160a01b031681565b6102716103ab36600461117e565b6107fb565b6102426103be366004611118565b610825565b6102426103d1366004611118565b6108a0565b60095461024290600160a01b900460ff1681565b6102716108ae565b6102716104003660046111a0565b610974565b61025b6104133660046111b9565b6109dc565b61027161042636600461117e565b610a07565b60606003805461043a906111ec565b80601f0160208091040260200160405190810160405280929190818152602001828054610466906111ec565b80156104b35780601f10610488576101008083540402835291602001916104b3565b820191906000526020600020905b81548152906001019060200180831161049657829003601f168201915b5050505050905090565b6000336104cb818585610a7d565b60019150505b92915050565b6009546001600160a01b03163314806104fa57506006546001600160a01b031633145b6105385760405162461bcd60e51b815260206004820152600a60248201526927b7363c9020b236b4b760b11b60448201526064015b60405180910390fd5b610540610ba2565b6277f880600a5442610552919061123c565b1161059f5760405162461bcd60e51b815260206004820152601b60248201527f546f6f20736f6f6e20746f206d696e74206e657720746f6b656e730000000000604482015260640161052f565b6000600b546105ad60025490565b6105b7919061123c565b9050600064174876e800600c54600b546105d1919061124f565b6105db9190611266565b42600a55600754909150610601906001600160a01b03166105fc848461123c565b610bfb565b505061060d6001600555565b565b60003361061d858285610cba565b610628858585610d34565b506001949350505050565b61063b610ed8565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6000336104cb81858561067083836109dc565b61067a9190611288565b610a7d565b6106893382610f32565b80600b600082825461069b919061123c565b909155505050565b6008546001600160a01b031633146106f65760405162461bcd60e51b815260206004820152601660248201527513db9b1e4810db185a5b5a5b99c810dbdb9d1c9858dd60521b604482015260640161052f565b6106fe610ba2565b600254600b5461070e9083611288565b11156107775760405162461bcd60e51b815260206004820152603260248201527f416d6f756e742063616e6e6f742062652067726561746572207468616e2063756044820152717272656e7420746f74616c20737570706c7960701b606482015260840161052f565b80600b60008282546107899190611288565b9091555050600160055550565b50565b6107a1610ed8565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b6107cb610ed8565b61060d600061105c565b600d81600981106107e557600080fd5b0154905081565b60606004805461043a906111ec565b610803610ed8565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6000338161083382866109dc565b9050838110156108935760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161052f565b6106288286868403610a7d565b6000336104cb818585610d34565b6108b6610ed8565b6108be610ba2565b600954600160a01b900460ff16156109095760405162461bcd60e51b815260206004820152600e60248201526d105b1c9958591e481b5a5b9d195960921b604482015260640161052f565b6009805460ff60a01b1916600160a01b179055600c54600b5460009164174876e80091610936919061124f565b6109409190611266565b9050600b54816109509190611288565b600754909150610969906001600160a01b031682610bfb565b5061060d6001600555565b61097c610ed8565b600981106109c15760405162461bcd60e51b8152602060048201526012602482015271496e646578206f7574206f662072616e676560701b604482015260640161052f565b600d81600981106109d4576109d461129b565b0154600c5550565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610a0f610ed8565b6001600160a01b038116610a745760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161052f565b6107968161105c565b6001600160a01b038316610adf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052f565b6001600160a01b038216610b405760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052f565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600260055403610bf45760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161052f565b6002600555565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161052f565b8060026000828254610c639190611288565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6000610cc684846109dc565b90506000198114610d2e5781811015610d215760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161052f565b610d2e8484848403610a7d565b50505050565b6001600160a01b038316610d985760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052f565b6001600160a01b038216610dfa5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052f565b6001600160a01b03831660009081526020819052604090205481811015610e725760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161052f565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3610d2e565b6006546001600160a01b0316331461060d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161052f565b6001600160a01b038216610f925760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161052f565b6001600160a01b038216600090815260208190526040902054818110156110065760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b606482015260840161052f565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610b95565b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208083528351808285015260005b818110156110db578581018301518582016040015282016110bf565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461111357600080fd5b919050565b6000806040838503121561112b57600080fd5b611134836110fc565b946020939093013593505050565b60008060006060848603121561115757600080fd5b611160846110fc565b925061116e602085016110fc565b9150604084013590509250925092565b60006020828403121561119057600080fd5b611199826110fc565b9392505050565b6000602082840312156111b257600080fd5b5035919050565b600080604083850312156111cc57600080fd5b6111d5836110fc565b91506111e3602084016110fc565b90509250929050565b600181811c9082168061120057607f821691505b60208210810361122057634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156104d1576104d1611226565b80820281158282048414176104d1576104d1611226565b60008261128357634e487b7160e01b600052601260045260246000fd5b500490565b808201808211156104d1576104d1611226565b634e487b7160e01b600052603260045260246000fdfea264697066735822122082d6c02409f66ffe41025e8e35ae2497a0efc800dca086c2c114fa57b31a2b0264736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: Yes (200 runs)
paired.sol 100 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// imports
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Paired is ERC20, ReentrancyGuard, Ownable {
address public _multisigContract;
address public _claimingContract;
address public _admin;
bool public _initial_mint;
uint256 public _lastMint;
// amount made available for claiming
uint256 public _activeSupply = 1_000_000_000 * (10**decimals()); // 1 billion
uint256 public _max_inflation_pct = 372908894; // 0.372908894%
uint256[9] public _inflation_options = [
249067931, // 1% YoY - 0.1249% QoQ
311045746, // 1.25% YoY - 0.311% QoQ
372908894, // 1.5% YoY - 0.3729% QoQ
434657867, // 1.75% YoY - 0.4346% QoQ
496293157, // 2% YoY - 0.4962% QoQ
557815251, // 2.25% YoY - 0.5578% QoQ
619224633, // 2.5% YoY - 0.6192% QoQ
680521782, // 2.75% YoY - 0.6805% QoQ
741707178 // 3% YoY - 0.7417% QoQ
];
uint256 public constant _scaling_factor = 10**11;
constructor(string memory name, string memory symbol, address multisigContract) ERC20(name, symbol)
{
_multisigContract = multisigContract;
}
modifier onlyClaimingContract() {
require(msg.sender == _claimingContract, "Only Claiming Contract");
_;
}
modifier onlyAdmin() {
require(msg.sender == _admin || msg.sender == owner(), "Only Admin");
_;
}
// MARK: - Only Owner
function setAdmin(address admin) external onlyOwner {
_admin = admin;
}
function setClaimingContract(address claimingContract) external onlyOwner {
_claimingContract = claimingContract;
}
function setMultisigContract(address multisigContract) external onlyOwner {
_multisigContract = multisigContract;
}
function setInflationCap(uint256 index) external onlyOwner {
require(index < _inflation_options.length, "Index out of range");
_max_inflation_pct = _inflation_options[index];
}
function initial_mint() onlyOwner nonReentrant external {
require(_initial_mint == false, "Already minted");
_initial_mint = true;
uint256 amount = _activeSupply * _max_inflation_pct / _scaling_factor;
amount += _activeSupply;
_mint(_multisigContract, amount);
}
// MARK: - Only Admin
function mint() onlyAdmin nonReentrant external {
require((block.timestamp - _lastMint) > 7862400, "Too soon to mint new tokens");
uint256 delta = totalSupply() - _activeSupply;
uint256 amount = _activeSupply * _max_inflation_pct / _scaling_factor;
_lastMint = block.timestamp;
_mint(_multisigContract, amount - delta);
}
// MARK: - Public
function burn(uint256 amount) public virtual {
_burn(msg.sender, amount);
_activeSupply -= amount;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
// MARK: Only Claiming Contract
function updateActiveSupply(uint256 amount) onlyClaimingContract nonReentrant external {
require(amount + _activeSupply <= totalSupply(), "Amount cannot be greater than current total supply");
_activeSupply += amount;
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
ERC20.sol 389 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
/**
* @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.openzeppelin.com/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 ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @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(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @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 increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases 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.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `from` to `to`.
*
* 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");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(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");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(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");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(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 Updates `owner` s allowance for `spender` based on spent `amount`.
*
* 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);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
ReentrancyGuard.sol 69 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @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);
}
Read Contract
_activeSupply 0x12333a12 → uint256
_admin 0x01bc45c9 → address
_claimingContract 0x7c9f4ef8 → address
_inflation_options 0x867ecf33 → uint256
_initial_mint 0xb7f2fa86 → bool
_lastMint 0x2b3e99f7 → uint256
_max_inflation_pct 0x77e2543d → uint256
_multisigContract 0x9b5f95b0 → address
_scaling_factor 0x24b8cf24 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
initial_mint 0xbcdc686e
No parameters
mint 0x1249c58b
No parameters
renounceOwnership 0x715018a6
No parameters
setAdmin 0x704b6c02
address admin
setClaimingContract 0x9ce69679
address claimingContract
setInflationCap 0xca3a0d72
uint256 index
setMultisigContract 0x2ee4887e
address multisigContract
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateActiveSupply 0x5b02a0d9
uint256 amount
Recent Transactions
No transactions found for this address