Address Contract Partially Verified
Address
0x3c5A4e4b3964AABDf06B1a26e181B584318973f4
Balance
0 ETH
Nonce
1
Code Size
4711 bytes
Creator
0xA05C03Cb...AaF1 at tx 0x78341330...78248d
Indexed Transactions
0
Contract Bytecode
4711 bytes
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063874dae88116100ad578063af38d75711610071578063af38d757146102d2578063b6db75a0146102f0578063d54ad2a11461030e578063e834a8341461032c578063fc0c546a1461034a57610121565b8063874dae881461023e5780638f32d59b1461025a57806394fb912214610278578063a10ffbed14610296578063af0420fc146102b457610121565b806345f0a44f116100f457806345f0a44f146101ae5780634e71d92d146101de5780634fb2e45d146101e8578063560fa48c14610204578063796b89b91461022057610121565b8063124b65b4146101265780631f2698ab1461014457806334c5a044146101625780634420e48614610192575b600080fd5b61012e610368565b60405161013b9190610ac1565b60405180910390f35b61014c610372565b6040516101599190610ac1565b60405180910390f35b61017c60048036038101906101779190610b44565b610378565b6040516101899190610ac1565b60405180910390f35b6101ac60048036038101906101a79190610b44565b6103c1565b005b6101c860048036038101906101c39190610b9d565b610416565b6040516101d59190610ac1565b60405180910390f35b6101e661043a565b005b61020260048036038101906101fd9190610b44565b610594565b005b61021e60048036038101906102199190610c2f565b6106b5565b005b610228610722565b6040516102359190610ac1565b60405180910390f35b61025860048036038101906102539190610ca3565b61072a565b005b610262610807565b60405161026f9190610cfe565b60405180910390f35b610280610865565b60405161028d9190610cfe565b60405180910390f35b61029e6108b6565b6040516102ab9190610ac1565b60405180910390f35b6102bc6108bc565b6040516102c99190610ac1565b60405180910390f35b6102da6108c6565b6040516102e79190610ac1565b60405180910390f35b6102f86109b0565b6040516103059190610cfe565b60405180910390f35b610316610a00565b6040516103239190610ac1565b60405180910390f35b610334610a0a565b6040516103419190610ac1565b60405180910390f35b610352610a10565b60405161035f9190610d78565b60405180910390f35b6000600554905090565b60035481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6103c96109b0565b610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610e16565b60405180910390fd5b61041381600b61072a565b50565b6006818154811061042657600080fd5b906000526020600020016000915090505481565b610442610865565b610481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047890610ea8565b60405180910390fd5b600061048b6108c6565b9050600081116104d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c790610f3a565b60405180910390fd5b80600460008282546104e29190610f89565b92505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61052f610a36565b836040518363ffffffff1660e01b815260040161054d929190610fee565b6020604051808303816000875af115801561056c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105909190611043565b5050565b61059c610807565b6105db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d2906110e2565b60405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061060c82600161072a565b61061781600061072a565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8934ce4adea8d9ce0d714d2c22b86790e41b7731c84b926fbbdc1d40ff6533c960405160405180910390a35050565b6106bd6109b0565b6106fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f390610e16565b60405180910390fd5b836003819055508260058190555081816006919061071b929190610a3e565b5050505050565b600042905090565b610732610807565b610771576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610768906110e2565b60405180910390fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f65efeaf737ce094d287661b6a56bb530dce1fc30853708d1912a74f8ae65ffbb826040516107fb9190610ac1565b60405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610849610a36565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600b60016000610875610a36565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414905090565b60055481565b6000600354905090565b6000600354421161090c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109039061114e565b60405180910390fd5b60006005546003544261091f919061116e565b61092991906111d1565b9050600680549050811061094c576001600680549050610949919061116e565b90505b6004546006828154811061096357610962611202565b5b90600052602060002001541161097d5760009150506109ad565b6004546006828154811061099457610993611202565b5b90600052602060002001546109a9919061116e565b9150505b90565b600060018060006109bf610a36565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414905090565b6000600454905090565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b828054828255906000526020600020908101928215610a7a579160200282015b82811115610a79578235825591602001919060010190610a5e565b5b509050610a879190610a8b565b5090565b5b80821115610aa4576000816000905550600101610a8c565b5090565b6000819050919050565b610abb81610aa8565b82525050565b6000602082019050610ad66000830184610ab2565b92915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b1182610ae6565b9050919050565b610b2181610b06565b8114610b2c57600080fd5b50565b600081359050610b3e81610b18565b92915050565b600060208284031215610b5a57610b59610adc565b5b6000610b6884828501610b2f565b91505092915050565b610b7a81610aa8565b8114610b8557600080fd5b50565b600081359050610b9781610b71565b92915050565b600060208284031215610bb357610bb2610adc565b5b6000610bc184828501610b88565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f840112610bef57610bee610bca565b5b8235905067ffffffffffffffff811115610c0c57610c0b610bcf565b5b602083019150836020820283011115610c2857610c27610bd4565b5b9250929050565b60008060008060608587031215610c4957610c48610adc565b5b6000610c5787828801610b88565b9450506020610c6887828801610b88565b935050604085013567ffffffffffffffff811115610c8957610c88610ae1565b5b610c9587828801610bd9565b925092505092959194509250565b60008060408385031215610cba57610cb9610adc565b5b6000610cc885828601610b2f565b9250506020610cd985828601610b88565b9150509250929050565b60008115159050919050565b610cf881610ce3565b82525050565b6000602082019050610d136000830184610cef565b92915050565b6000819050919050565b6000610d3e610d39610d3484610ae6565b610d19565b610ae6565b9050919050565b6000610d5082610d23565b9050919050565b6000610d6282610d45565b9050919050565b610d7281610d57565b82525050565b6000602082019050610d8d6000830184610d69565b92915050565b600082825260208201905092915050565b7f4d656d62657273686970203a2063616c6c6572206973206e6f7420612061646d60008201527f696e000000000000000000000000000000000000000000000000000000000000602082015250565b6000610e00602283610d93565b9150610e0b82610da4565b604082019050919050565b60006020820190508181036000830152610e2f81610df3565b9050919050565b7f4d656d62657268736970203a2063616c6c6572206973206e6f74206120636c6160008201527f696d616e74000000000000000000000000000000000000000000000000000000602082015250565b6000610e92602583610d93565b9150610e9d82610e36565b604082019050919050565b60006020820190508181036000830152610ec181610e85565b9050919050565b7f546f6b656e56657374696e673a204e6f20636c61696d61626c6520616d6f756e60008201527f7400000000000000000000000000000000000000000000000000000000000000602082015250565b6000610f24602183610d93565b9150610f2f82610ec8565b604082019050919050565b60006020820190508181036000830152610f5381610f17565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610f9482610aa8565b9150610f9f83610aa8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fd457610fd3610f5a565b5b828201905092915050565b610fe881610b06565b82525050565b60006040820190506110036000830185610fdf565b6110106020830184610ab2565b9392505050565b61102081610ce3565b811461102b57600080fd5b50565b60008151905061103d81611017565b92915050565b60006020828403121561105957611058610adc565b5b60006110678482850161102e565b91505092915050565b7f4d656d62657273686970203a2063616c6c6572206973206e6f7420746865206f60008201527f776e657200000000000000000000000000000000000000000000000000000000602082015250565b60006110cc602483610d93565b91506110d782611070565b604082019050919050565b600060208201905081810360008301526110fb816110bf565b9050919050565b7f546f6b656e56657374696e673a204e6f7420636c61696d61626c650000000000600082015250565b6000611138601b83610d93565b915061114382611102565b602082019050919050565b600060208201905081810360008301526111678161112b565b9050919050565b600061117982610aa8565b915061118483610aa8565b92508282101561119757611196610f5a565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006111dc82610aa8565b91506111e783610aa8565b9250826111f7576111f66111a2565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220d3a9134fd1165ce03736b1b89dd10aaa47800a0212c0baec24722d58832de07964736f6c634300080a0033
Verified Source Code Partial Match
Compiler: v0.8.10+commit.fc410830
EVM: london
Optimization: No
Claimant.sol 706 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.3.2 (token/ERC20/IERC20.sol)
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender,
address recipient,
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);
event Mint(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);
}
// OpenZeppelin Contracts v4.3.2 (token/ERC20/extensions/IERC20Metadata.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);
}
// OpenZeppelin Contracts v4.3.2 (utils/Context.sol)
/**
* @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;
}
}
// OpenZeppelin Contracts v4.3.2 (token/ERC20/ERC20.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.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 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:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, 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}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), 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}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
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 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) {
_approve(_msgSender(), spender, _allowances[_msgSender()][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) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
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:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
_afterTokenTransfer(sender, recipient, 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;
_balances[account] += amount;
emit Mint(account, amount);
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, 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 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 {}
}
// OpenZeppelin Contracts v4.3.2 (token/ERC20/extensions/ERC20Capped.sol)
/**
* @dev Extension of {ERC20} that adds a cap to the supply of tokens.
*/
abstract contract ERC20Capped is ERC20 {
uint256 private immutable _cap;
/**
* @dev Sets the value of the `cap`. This value is immutable, it can only be
* set once during construction.
*/
constructor(uint256 cap_) {
require(cap_ > 0, "ERC20Capped: cap is 0");
_cap = cap_;
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view virtual returns (uint256) {
return _cap;
}
/**
* @dev See {ERC20-_mint}.
*/
function _mint(address account, uint256 amount) internal virtual override {
require(ERC20.totalSupply() + amount <= cap(), "ERC20Capped: cap exceeded");
super._mint(account, amount);
}
}
// OpenZeppelin Contracts v4.3.2 (access/Ownable.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 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 {
_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);
}
}
contract Membership is Context {
address private owner;
event MembershipChanged(address indexed owner, uint256 level);
event OwnerTransferred(address indexed preOwner, address indexed newOwner);
mapping(address => uint256) internal membership;
constructor() {
owner = _msgSender();
setMembership(_msgSender(), 1);
}
function transferOwner(address newOwner) public onlyOwner {
address preOwner = owner;
setMembership(newOwner, 1);
setMembership(preOwner, 0);
owner = newOwner;
emit OwnerTransferred(preOwner, newOwner);
}
function setMembership(address key, uint256 level) public onlyOwner {
membership[key] = level;
emit MembershipChanged(key, level);
}
modifier onlyOwner() {
require(isOwner(), "Membership : caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == owner;
}
modifier onlyAdmin() {
require(isAdmin(), "Membership : caller is not a admin");
_;
}
function isAdmin() public view returns (bool) {
return membership[_msgSender()] == 1;
}
modifier onlyClaimant() {
require(isClaimant(), "Memberhsip : caller is not a claimant");
_;
}
function isClaimant() public view returns (bool) {
return membership[_msgSender()] == 11;
}
function getMembership(address account) public view returns (uint256){
return membership[account];
}
}
contract LOKA is ERC20Capped, Ownable {
constructor(
string memory name,
string memory symbol,
uint256 cap
) ERC20(name, symbol) ERC20Capped(cap) {
}
function mint(address addr, uint256 amount) public onlyOwner {
_mint(addr, amount);
}
// function retain(address addr, uint256 amount, uint256 strtd, uint256 trm, uint256 tms) public onlyOwner {
// _mint(addr, amount);
// Claimant(addr).initialize(strtd, trm, tms);
// }
mapping(address => uint256) private _allocates;
function _allocate(address addr, uint256 amount) internal virtual {
_allocates[addr] += amount;
}
function allocate(address addr, uint256 amount) public onlyOwner {
_allocate(addr, amount);
}
function allocateOf(address account) public view virtual returns (uint256) {
return _allocates[account];
}
function take(address addr, uint256 amount) public {
address sender = _msgSender();
require(_allocates[sender]>=amount, "TokenVesting: No takable amount");
_allocates[sender] -= amount;
_mint(addr, amount);
}
}
contract Claimant is Membership {
LOKA public token;
uint256 public started;
uint256 public claimed;
uint256 public term;
uint256[] public amounts;
constructor(LOKA _token) Membership() {
token = _token;
}
function initialize(uint256 strtd, uint256 trm, uint256[] calldata amnts) public onlyAdmin {
started = strtd;
term = trm;
amounts = amnts;
}
function register(address m) public onlyAdmin {
setMembership(m, 11);
}
function claimable() public view returns (uint256){
require(block.timestamp > started, "TokenVesting: Not claimable");
uint256 sequence = (block.timestamp - started) / term;
if(sequence>=amounts.length)
sequence = amounts.length-1;
if(amounts[sequence]<=claimed)
return 0;
return amounts[sequence]-claimed;
}
function claim() public onlyClaimant {
uint256 amount = claimable();
require(amount > 0, "TokenVesting: No claimable amount");
claimed += amount;
token.transfer(_msgSender(), amount);
}
function totalClaimed() public view returns (uint256) {
return claimed;
}
function getStarted() public view returns (uint256) {
return started;
}
function getTerm() public view returns (uint256) {
return term;
}
function getBlockTimestamp() public view returns (uint256) {
return block.timestamp;
}
}
Read Contract
amounts 0x45f0a44f → uint256
claimable 0xaf38d757 → uint256
claimed 0xe834a834 → uint256
getBlockTimestamp 0x796b89b9 → uint256
getMembership 0x34c5a044 → uint256
getStarted 0xaf0420fc → uint256
getTerm 0x124b65b4 → uint256
isAdmin 0xb6db75a0 → bool
isClaimant 0x94fb9122 → bool
isOwner 0x8f32d59b → bool
started 0x1f2698ab → uint256
term 0xa10ffbed → uint256
token 0xfc0c546a → address
totalClaimed 0xd54ad2a1 → uint256
Write Contract 5 functions
These functions modify contract state and require a wallet transaction to execute.
claim 0x4e71d92d
No parameters
initialize 0x560fa48c
uint256 strtd
uint256 trm
uint256[] amnts
register 0x4420e486
address m
setMembership 0x874dae88
address key
uint256 level
transferOwner 0x4fb2e45d
address newOwner
Recent Transactions
No transactions found for this address