Transactions
Token Transfers
Internal Transactions
Coin Balance History
Logs
Code
Read Contract
Write Contract
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- FetchToken
- Optimization enabled
- true
- Compiler version
- v0.8.3+commit.8d00100c
- Optimization runs
- 300
- EVM Version
- default
- Verified at
- 2025-01-23T00:39:35.904607Z
Constructor Arguments
0x0000000000000000000000009718ff27282861f62bc00bd410254c2768cc954a000000000000000000000000ad95b97ff769464bca0811814613f92abc5d31120000000000000000000000001d33d9ddcc8a3a42e25fd1401c53a54a3db8672900000000000000000000000035eae501a5499fd9fcca9d73fc78ecbd79b0e615
Arg [0] (address) : 0x9718ff27282861f62bc00bd410254c2768cc954a
Arg [1] (address) : 0xad95b97ff769464bca0811814613f92abc5d3112
Arg [2] (address) : 0x1d33d9ddcc8a3a42e25fd1401c53a54a3db86729
Arg [3] (address) : 0x35eae501a5499fd9fcca9d73fc78ecbd79b0e615
fetchtoken/contracts/FetchToken.sol
// contracts/FetchToken.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
import "./interfaces/IFetchFlex.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
contract FetchToken is ERC20, Ownable {
uint internal constant _1_BILLION = 1e27; // 1e9 + 1e18 = 1e27
uint internal constant _250_MILLIONS = 25e25;
uint internal constant YEAR_IN_SECONDS = 31557600;
uint internal immutable createdAt;
uint internal updatedAt;
address internal oracle;
/*
* To date, solidity does not natively support operations with decimals and floating point numbers
* making the calculation of an inflationary formula complicated and gas-expensive
* (the inflationary formula is very similar to the compound interest formula)
* For this reason, this table of precomputed values is provided for each period the first 100 years,
* each value indicates the number of tokens per second to be issued in the correspoding year
*/
uint[101] internal RATE = [ // Yearly inflation rate (tokens per sec)
7922021953507237559, // 7.922021953507238
8318123051182599437, // 8.3181230511826
8734029203741729409, // 8.734029203741729
9170730663928815879, // 9.170730663928817
9629267197125256673, // 9.629267197125257
10110730556981519507, // 10.110730556981519
10616267084830595482, // 10.616267084830595
11147080439072125256, // 11.147080439072123
11704434461025730727, // 11.70443446102573
12289656184077017897, // 12.28965618407702
12904138993280868950, // 12.904138993280869
13549345942944913428, // 13.549345942944912
14226813240092155297, // 14.226813240092156
14938153902096778589, // 14.93815390209678
15685061597201620211, // 15.68506159720162
16469314677061684031, // 16.469314677061686
17292780410914790731, // 17.29278041091479
18157419431460529317, // 18.15741943146053
19065290403033532334, // 19.065290403033533
20018554923185258067, // 20.01855492318526
21019482669344498948, // 21.019482669344498
22070456802811690369, // 22.07045680281169
23173979642952318934, // 23.173979642952318
24332678625099915709, // 24.332678625099916
25549312556354897077, // 25.5493125563549
26826778184172630364, // 26.826778184172632
28168117093381274241, // 28.168117093381273
29576522948050327021, // 29.57652294805033
31055349095452857631, // 31.055349095452858
32608116550225555809, // 32.60811655022555
34238522377736773392, // 34.23852237773677
35950448496623659593, // 35.95044849662366
37747970921454841306, // 37.74797092145484
39635369467527546454, // 39.635369467527546
41617137940903997769, // 41.617137940903994
43697994837949223008, // 43.697994837949224
45882894579846655005, // 45.88289457984665
48177039308838986488, // 48.177039308838985
50585891274280870535, // 50.58589127428087
53115185837994917230, // 53.115185837994915
55770945129894763860, // 55.77094512989476
58559492386389478287, // 58.55949238638947
61487467005708938575, // 61.48746700570894
64561840355994435571, // 64.56184035599443
67789932373794052779, // 67.78993237379406
71179428992483680634, // 71.17942899248368
74738400442107929627, // 74.73840044210793
78475320464213527010, // 78.47532046421352
82399086487424170405, // 82.39908648742417
86519040811795399523, // 86.5190408117954
90844992852385098993, // 90.84499285238509
95387242495004423657, // 95.38724249500443
100156604619754639136, // 100.15660461975463
105164434850742166705, // 105.16443485074217
110422656593279463584, // 110.42265659327946
115943789422943335361, // 115.94378942294334
121740978894090615256, // 121.74097889409062
127828027838794984409, // 127.82802783879498
134219429230735100261, // 134.2194292307351
140930400692271465511, // 140.93040069227146
147976920726884870839, // 147.97692072688488
155375766763229301341, // 155.3757667632293
163144555101390980303, // 163.14455510139098
171301782856460408903, // 171.30178285646042
179866871999283532335, // 179.86687199928355
188860215599247851548, // 188.86021559924785
198303226379209794154, // 198.3032263792098
208218387698170615002, // 208.21838769817063
218629307083079194869, // 218.6293070830792
229560772437233313053, // 229.5607724372333
241038811059094988212, // 241.038811059095
253090751612049775648, // 253.0907516120498
265745289192651405684, // 265.7452891926514
279032553652284837884, // 279.03255365228483
292984181334899326945, // 292.98418133489935
307633390401643534363, // 307.6333904016435
323015059921725955079, // 323.01505992172594
339165812917812381170, // 339.1658129178124
356124103563703006566, // 356.12410356370304
373930308741888103024, // 373.9303087418881
392626824178982685629, // 392.6268241789827
412258165387932225518, // 412.25816538793225
432871073657328694197, // 432.8710736573287
454514627340195008492, // 454.514627340195
477240358707204508581, // 477.2403587072045
501102376642564390194, // 501.1023766425644
526157495474693512815, // 526.1574954746935
552465370248426939945, // 552.4653702484269
580088638760849209065, // 580.0886387608492
609093070698891677441, // 609.0930706988917
639547724233836508480, // 639.5477242338364
671525110445527574974, // 671.5251104455275
705101365967805694983, // 705.1013659678058
740356434266195971810, // 740.3564342661961
777374255979505095445, // 777.374255979505
816242968778479668923, // 816.2429687784797
857055117217403097827, // 857.0551172174032
899907873078273379471, // 899.9078730782734
944903266732186731564, // 944.9032667321867
992148430068796803306, // 992.1484300687968
1041755851572236671990 // 1041.7558515722367
];
uint[100] internal minted; // cached seconds minted per period, max to YEAR_IN_SECONDS
event Mint(uint indexed _timestamp, uint _releaseAmount);
event IncreasedTimeBasedRewards(uint indexed _timestamp, uint _rewardAmount);
event IncreasedStakingRewards(uint indexed _timestamp, uint _rewardAmount);
// Sets the initial supply to 5 Billions (5.000.000.000) with allocations per each group of entitlements
constructor(
address _liquidityIssuanceMultisig,
address _teamIssuanceMultisig,
address _communityIssuanceMultisig,
address _reserveIssuanceMultisig
) ERC20("Fetch", "FETCH") {
require(_liquidityIssuanceMultisig != address(0), "ERROR_ZERO_ADDRESS");
require(_teamIssuanceMultisig != address(0), "ERROR_ZERO_ADDRESS");
require(_communityIssuanceMultisig != address(0), "ERROR_ZERO_ADDRESS");
require(_reserveIssuanceMultisig != address(0), "ERROR_ZERO_ADDRESS");
_mint(_liquidityIssuanceMultisig, 7 * _250_MILLIONS); // 35% (1.750.000.000)
_mint(_teamIssuanceMultisig, 5 * _250_MILLIONS); // 25% (1.250.000.000)
_mint(_communityIssuanceMultisig, _1_BILLION); // 20% (1.000.000.000)
_mint(_reserveIssuanceMultisig, _1_BILLION); // 20% (1.000.000.000)
createdAt = block.timestamp;
updatedAt = block.timestamp;
}
function setOracleAddress(address _oracleAddress) public onlyOwner {
require(_oracleAddress != address(0), "ERROR_ZERO_ADDRESS");
oracle = _oracleAddress;
renounceOwnership();
}
// Minting 5% of the current token allocation
function mintToOracle() external {
require(oracle != address(0), "ERROR_ORACLE_NOT_SET");
uint256 _releaseAmount = getAmountToRelease();
if (_releaseAmount > 0) {
updatedAt = block.timestamp;
uint256 _stakingRewards = (_releaseAmount * 40) / 100;
_mint(oracle, (_releaseAmount - _stakingRewards)); // 60% minted to the oracle address
_mint(address(this), _stakingRewards); // 40% minted to the staking rewards
_approve(address(this), oracle, _stakingRewards);
IFetchFlex(oracle).addStakingRewards(_stakingRewards);
emit Mint(block.timestamp, _releaseAmount);
emit IncreasedTimeBasedRewards(block.timestamp, (_releaseAmount - _stakingRewards));
emit IncreasedStakingRewards(block.timestamp, _stakingRewards);
}
}
function getAmountToRelease() internal returns (uint256 inflation) {
uint toMint = (block.timestamp - updatedAt); // Minting periods to calculate
uint maxMint = (block.timestamp - createdAt); // Time from contract creation to current time
uint start = Math.min(((updatedAt - createdAt)/YEAR_IN_SECONDS), 100); // Inflation rate index from the last update
uint end = Math.min((maxMint/YEAR_IN_SECONDS), 100); // Inflation rate index from contract start
if (start != end) { // Overlapping years calculations
for (uint i = start; toMint > 0 && i < 100; i++) {
uint pending = YEAR_IN_SECONDS - minted[i];
if (toMint > pending) {
inflation += (pending * RATE[i]);
minted[i] += pending;
toMint -= pending;
}
else {
inflation += (toMint * RATE[i]);
minted[i] += toMint;
toMint = 0;
}
}
}
else {
minted[start] += toMint;
inflation = (toMint * RATE[start]);
}
return inflation;
}
function getCreatedAt() external view returns (uint256) {
return createdAt;
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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);
}
}
@openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* 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}.
*
* 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 default value returned by this function, unless
* it's 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 {}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.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);
}
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// 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);
}
@openzeppelin/contracts/utils/Context.sol
// 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;
}
}
@openzeppelin/contracts/utils/math/Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
contracts/ImporterToken.sol
// SPDX-License-Identifier: MIT
import { FetchToken } from "fetchtoken/contracts/FetchToken.sol";
pragma solidity 0.8.3;
contract ImporterToken {}
fetchtoken/contracts/interfaces/IFetchFlex.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
interface IFetchFlex {
function addStakingRewards(uint256 _amount) external;
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","storageLayout"],"":["ast"]}},"optimizer":{"runs":300,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_liquidityIssuanceMultisig","internalType":"address"},{"type":"address","name":"_teamIssuanceMultisig","internalType":"address"},{"type":"address","name":"_communityIssuanceMultisig","internalType":"address"},{"type":"address","name":"_reserveIssuanceMultisig","internalType":"address"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"IncreasedStakingRewards","inputs":[{"type":"uint256","name":"_timestamp","internalType":"uint256","indexed":true},{"type":"uint256","name":"_rewardAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"IncreasedTimeBasedRewards","inputs":[{"type":"uint256","name":"_timestamp","internalType":"uint256","indexed":true},{"type":"uint256","name":"_rewardAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Mint","inputs":[{"type":"uint256","name":"_timestamp","internalType":"uint256","indexed":true},{"type":"uint256","name":"_releaseAmount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCreatedAt","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintToOracle","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOracleAddress","inputs":[{"type":"address","name":"_oracleAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x610d40604052676df0acfe79a51eb760a090815267736fe8d7ffba2d0d60c052677935814932e9e28160e052677f44faf342426107610100526785a2077f6bf8e5e161012052678c5087df64922493610140526793548eaa8fffd99a61016052679ab262997d9971486101805267a26e81212a4780a76101a05267aa8da12f9f97e3296101c05267b314b60b9ac5e2566101e05267bc08f258fc1c98146102005267c56fcb43d5845da16102205267cf4efbd40698055d6102405267d9ac886b6d52dcf36102605267e48ec270cc638b3f6102805267effc4c29a368dd4b6102a05267fbfc1cc551fae4a56102c05268010895849bfc7a47ae6102e052680115d031a3c91abe5361030052680123b4341f2cc22504610320526801324a03872231bd81610340526801419a83b44a4e7fd661036052680151af0a4a1ad221bd6103805268016291646768f604b56103a0526801744bdc9fc7cef15c6103c052680186e941415e997a816103e05268019a74eaeb09ba95ed610400526801aefac376ca37551f610420526801c4874d3cbabaf161610440526801db27aab2f7435f10610460526801f2e9a66f1d3aaa496104805268020bdbbb8e45172dda6104a0526802260d1e889557c6566104c0526802418dc675d003b1496104e05268025e6e76c880d110606105005268027cc0c985ba74ac1d6105205268029c9739ff9d60e2f8610540526802be053019320b2287610560526802e11f0c1a748bbd6e61058052680305fa331bc72ddd546105a05268032cad1c105defcb8f6105c0526803554f5d7795d52d4f6105e05268037ff9bbbd9086fff3610600526803acc63853d7bf5aab610620526803dbd0218b3c21617a6106405268040d34233898bda41b6106605268044110582ea063c9e261068052680477845c975b9b79a56106a0526804b0b161388696c3636106c0526804ecba3fae8d506cf16106e05268052bc38faa7ac8b5e96107005268056df3bd3fcdb90f20610720526805b373204fcb3264b1610740526805fc6c1520955e30a0610760526806490b162f033af3c1610780526806997ed74af69939d86107a0526806edf8620eb61e6bd96107c052680746ab33c2a5a589656107e0526807a3cd5cbf944e44276108005268080597a162c21c6ab76108205268086c459ca7b23a4a5d610840526808d815e47ce18d44cf610860526809494a2fe9866c1847610880526809c0277f1b99f3122f6108a052680a3cf6457694db001c6108c052680ac00295bc82abe26a6108e052680b499c506c560654da61090052680bda175471c0ba98f561092052680c71cbb2443d93251d61094052680d1115e19473daa5b461096052680db856f9a8acd95c2061098052680e67f4ec8ab570b9746109a052680f205ac52b3e904ffc6109c052680fe1f8e8a09b4e7fe16109e0526810ad455aa8a306d81b610a0052681182bc059777fe1c07610a2052681262df05df0accc5f2610a405268134e36f95d64f0b566610a60526814455352a210625270610a8052681548cab05d5e038bbd610aa0526816593b392ed5f04fee610ac0526817774afc0ac706f3b5610ae0526818a3a85571b75f0fec610b00526819df0a59b766eccba5610b2052681b2a31449a2c0cfd32610b4052681c85e6ee6eae4e9e6f610b6052681df2ff47276a25e629610b8052681f7258d782fc4f76e9610ba052682104dd48afef538f01610bc0526822ab81f2b8bb4eb540610be05268246748720ec4a0a9be610c00526826393f448f81c34407610c2052682822826e637b734ee2610c4052682a243c271ba7fb9315610c6052682c3fa58f76a38a8ebb610c8052682e7607703c9215d2e3610ca0526830c8bb02a5ffcc0c8f610cc0526833392ac2c7e62b042c610ce0526835c8d34c85181ec8ea610d005268387944438bbfba5bf6610d205262000588906008906065620008fd565b503480156200059657600080fd5b5060405162001c0038038062001c00833981016040819052620005b991620009fc565b6040518060400160405280600581526020016408ccae8c6d60db1b8152506040518060400160405280600581526020016408c8aa886960db1b81525081600390805190602001906200060d9291906200094b565b508051620006239060049060208401906200094b565b505050620006406200063a620007e460201b60201c565b620007e8565b6001600160a01b0384166200068b5760405162461bcd60e51b8152602060048201526012602482015260008051602062001be083398151915260448201526064015b60405180910390fd5b6001600160a01b038316620006d25760405162461bcd60e51b8152602060048201526012602482015260008051602062001be0833981519152604482015260640162000682565b6001600160a01b038216620007195760405162461bcd60e51b8152602060048201526012602482015260008051602062001be0833981519152604482015260640162000682565b6001600160a01b038116620007605760405162461bcd60e51b8152602060048201526012602482015260008051602062001be0833981519152604482015260640162000682565b62000783846200077d6acecb8f27f4200f3a000000600762000a73565b6200083a565b620007a0836200077d6acecb8f27f4200f3a000000600562000a73565b620007b8826b033b2e3c9fd0803ce80000006200083a565b620007d0816b033b2e3c9fd0803ce80000006200083a565b50504260808190526006555062000ae89050565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620008925760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640162000682565b8060026000828254620008a6919062000a58565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b826065810192821562000939579160200282015b828111156200093957825182906001600160481b031690559160200191906001019062000911565b5062000947929150620009c8565b5090565b828054620009599062000a95565b90600052602060002090601f0160209004810192826200097d576000855562000939565b82601f106200099857805160ff191683800117855562000939565b8280016001018555821562000939579182015b8281111562000939578251825591602001919060010190620009ab565b5b80821115620009475760008155600101620009c9565b80516001600160a01b0381168114620009f757600080fd5b919050565b6000806000806080858703121562000a12578384fd5b62000a1d85620009df565b935062000a2d60208601620009df565b925062000a3d60408601620009df565b915062000a4d60608601620009df565b905092959194509250565b6000821982111562000a6e5762000a6e62000ad2565b500190565b600081600019048311821515161562000a905762000a9062000ad2565b500290565b600181811c9082168062000aaa57607f821691505b6020821081141562000acc57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6080516110ce62000b12600039600081816101ca01528181610b6c0152610b9f01526110ce6000f3fe608060405234801561001057600080fd5b506004361061010b5760003560e01c8063715018a6116100a2578063a457c2d711610071578063a457c2d714610211578063a9059cbb14610224578063b67f8cbd14610237578063dd62ed3e1461023f578063f2fde38b146102785761010b565b8063715018a6146101c05780637e05f5a8146101c85780638da5cb5b146101ee57806395d89b41146102095761010b565b8063313ce567116100de578063313ce5671461017657806339509351146101855780634c69c00f1461019857806370a08231146101ad5761010b565b806306fdde0314610110578063095ea7b31461012e57806318160ddd1461015157806323b872dd14610163575b600080fd5b61011861028b565b6040516101259190610f6b565b60405180910390f35b61014161013c366004610f42565b61031d565b6040519015158152602001610125565b6002545b604051908152602001610125565b610141610171366004610f07565b610335565b60405160128152602001610125565b610141610193366004610f42565b610359565b6101ab6101a6366004610ebb565b610398565b005b6101556101bb366004610ebb565b610416565b6101ab610435565b7f0000000000000000000000000000000000000000000000000000000000000000610155565b6005546040516001600160a01b039091168152602001610125565b610118610449565b61014161021f366004610f42565b610458565b610141610232366004610f42565b6104ea565b6101ab6104f8565b61015561024d366004610ed5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101ab610286366004610ebb565b6106d6565b60606003805461029a9061102c565b80601f01602080910402602001604051908101604052809291908181526020018280546102c69061102c565b80156103135780601f106102e857610100808354040283529160200191610313565b820191906000526020600020905b8154815290600101906020018083116102f657829003601f168201915b5050505050905090565b60003361032b81858561074c565b5060019392505050565b600033610343858285610870565b61034e858585610902565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061032b9082908690610393908790610fbe565b61074c565b6103a0610aa6565b6001600160a01b0381166103f05760405162461bcd60e51b81526020600482015260126024820152714552524f525f5a45524f5f4144445245535360701b60448201526064015b60405180910390fd5b600780546001600160a01b0319166001600160a01b038316179055610413610435565b50565b6001600160a01b0381166000908152602081905260409020545b919050565b61043d610aa6565b6104476000610b00565b565b60606004805461029a9061102c565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104dd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103e7565b61034e828686840361074c565b60003361032b818585610902565b6007546001600160a01b03166105505760405162461bcd60e51b815260206004820152601460248201527f4552524f525f4f5241434c455f4e4f545f53455400000000000000000000000060448201526064016103e7565b600061055a610b52565b90508015610413574260065560006064610575836028610ff6565b61057f9190610fd6565b6007549091506105a1906001600160a01b031661059c8385611015565b610dcd565b6105ab3082610dcd565b6007546105c39030906001600160a01b03168361074c565b600754604051633671473560e21b8152600481018390526001600160a01b039091169063d9c51cd490602401600060405180830381600087803b15801561060957600080fd5b505af115801561061d573d6000803e3d6000fd5b50505050427fcc9c58b575eabd3f6a1ee653e91fcea3ff546867ffc3782a3bbca1f9b6dbb8df8360405161065391815260200190565b60405180910390a2427f9b2a0c57e494730490d8ba0dda5626727ad58a7f4853cdc6fc11239c6909e37b6106878385611015565b60405190815260200160405180910390a2427f1160274d1059307f99a59548589cdd9c5ed92b1c6b7f57c73df72ef4856bbdb1826040516106ca91815260200190565b60405180910390a25050565b6106de610aa6565b6001600160a01b0381166107435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103e7565b61041381610b00565b6001600160a01b0383166107ae5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e7565b6001600160a01b03821661080f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e7565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146108fc57818110156108ef5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103e7565b6108fc848484840361074c565b50505050565b6001600160a01b0383166109665760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103e7565b6001600160a01b0382166109c85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103e7565b6001600160a01b03831660009081526020819052604090205481811015610a405760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103e7565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36108fc565b6005546001600160a01b031633146104475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e7565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060065442610b639190611015565b90506000610b917f000000000000000000000000000000000000000000000000000000000000000042611015565b90506000610bdc6301e187e07f0000000000000000000000000000000000000000000000000000000000000000600654610bcb9190611015565b610bd59190610fd6565b6064610e8c565b90506000610bf1610bd56301e187e085610fd6565b9050808214610d5e57815b600085118015610c0c5750606481105b15610d58576000606d8260648110610c3457634e487b7160e01b600052603260045260246000fd5b0154610c44906301e187e0611015565b905080861115610cd05760088260658110610c6f57634e487b7160e01b600052603260045260246000fd5b0154610c7b9082610ff6565b610c859088610fbe565b965080606d8360648110610ca957634e487b7160e01b600052603260045260246000fd5b016000828254610cb99190610fbe565b90915550610cc990508187611015565b9550610d45565b60088260658110610cf157634e487b7160e01b600052603260045260246000fd5b0154610cfd9087610ff6565b610d079088610fbe565b965085606d8360648110610d2b57634e487b7160e01b600052603260045260246000fd5b016000828254610d3b9190610fbe565b9091555060009650505b5080610d5081611067565b915050610bfc565b50610dc6565b83606d8360648110610d8057634e487b7160e01b600052603260045260246000fd5b016000828254610d909190610fbe565b90915550600890508260658110610db757634e487b7160e01b600052603260045260246000fd5b0154610dc39085610ff6565b94505b5050505090565b6001600160a01b038216610e235760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103e7565b8060026000828254610e359190610fbe565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6000818310610e9b5781610e9d565b825b9392505050565b80356001600160a01b038116811461043057600080fd5b600060208284031215610ecc578081fd5b610e9d82610ea4565b60008060408385031215610ee7578081fd5b610ef083610ea4565b9150610efe60208401610ea4565b90509250929050565b600080600060608486031215610f1b578081fd5b610f2484610ea4565b9250610f3260208501610ea4565b9150604084013590509250925092565b60008060408385031215610f54578182fd5b610f5d83610ea4565b946020939093013593505050565b6000602080835283518082850152825b81811015610f9757858101830151858201604001528201610f7b565b81811115610fa85783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610fd157610fd1611082565b500190565b600082610ff157634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561101057611010611082565b500290565b60008282101561102757611027611082565b500390565b600181811c9082168061104057607f821691505b6020821081141561106157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561107b5761107b611082565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220fdf7586ef494645dcf19e44f73eed6b34c6d890e0635817bf7163471b9faeb3964736f6c634300080300334552524f525f5a45524f5f4144445245535300000000000000000000000000000000000000000000000000009718ff27282861f62bc00bd410254c2768cc954a000000000000000000000000ad95b97ff769464bca0811814613f92abc5d31120000000000000000000000001d33d9ddcc8a3a42e25fd1401c53a54a3db8672900000000000000000000000035eae501a5499fd9fcca9d73fc78ecbd79b0e615
Deployed ByteCode
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063715018a6116100a2578063a457c2d711610071578063a457c2d714610211578063a9059cbb14610224578063b67f8cbd14610237578063dd62ed3e1461023f578063f2fde38b146102785761010b565b8063715018a6146101c05780637e05f5a8146101c85780638da5cb5b146101ee57806395d89b41146102095761010b565b8063313ce567116100de578063313ce5671461017657806339509351146101855780634c69c00f1461019857806370a08231146101ad5761010b565b806306fdde0314610110578063095ea7b31461012e57806318160ddd1461015157806323b872dd14610163575b600080fd5b61011861028b565b6040516101259190610f6b565b60405180910390f35b61014161013c366004610f42565b61031d565b6040519015158152602001610125565b6002545b604051908152602001610125565b610141610171366004610f07565b610335565b60405160128152602001610125565b610141610193366004610f42565b610359565b6101ab6101a6366004610ebb565b610398565b005b6101556101bb366004610ebb565b610416565b6101ab610435565b7f00000000000000000000000000000000000000000000000000000000674925f7610155565b6005546040516001600160a01b039091168152602001610125565b610118610449565b61014161021f366004610f42565b610458565b610141610232366004610f42565b6104ea565b6101ab6104f8565b61015561024d366004610ed5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6101ab610286366004610ebb565b6106d6565b60606003805461029a9061102c565b80601f01602080910402602001604051908101604052809291908181526020018280546102c69061102c565b80156103135780601f106102e857610100808354040283529160200191610313565b820191906000526020600020905b8154815290600101906020018083116102f657829003601f168201915b5050505050905090565b60003361032b81858561074c565b5060019392505050565b600033610343858285610870565b61034e858585610902565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061032b9082908690610393908790610fbe565b61074c565b6103a0610aa6565b6001600160a01b0381166103f05760405162461bcd60e51b81526020600482015260126024820152714552524f525f5a45524f5f4144445245535360701b60448201526064015b60405180910390fd5b600780546001600160a01b0319166001600160a01b038316179055610413610435565b50565b6001600160a01b0381166000908152602081905260409020545b919050565b61043d610aa6565b6104476000610b00565b565b60606004805461029a9061102c565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156104dd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103e7565b61034e828686840361074c565b60003361032b818585610902565b6007546001600160a01b03166105505760405162461bcd60e51b815260206004820152601460248201527f4552524f525f4f5241434c455f4e4f545f53455400000000000000000000000060448201526064016103e7565b600061055a610b52565b90508015610413574260065560006064610575836028610ff6565b61057f9190610fd6565b6007549091506105a1906001600160a01b031661059c8385611015565b610dcd565b6105ab3082610dcd565b6007546105c39030906001600160a01b03168361074c565b600754604051633671473560e21b8152600481018390526001600160a01b039091169063d9c51cd490602401600060405180830381600087803b15801561060957600080fd5b505af115801561061d573d6000803e3d6000fd5b50505050427fcc9c58b575eabd3f6a1ee653e91fcea3ff546867ffc3782a3bbca1f9b6dbb8df8360405161065391815260200190565b60405180910390a2427f9b2a0c57e494730490d8ba0dda5626727ad58a7f4853cdc6fc11239c6909e37b6106878385611015565b60405190815260200160405180910390a2427f1160274d1059307f99a59548589cdd9c5ed92b1c6b7f57c73df72ef4856bbdb1826040516106ca91815260200190565b60405180910390a25050565b6106de610aa6565b6001600160a01b0381166107435760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103e7565b61041381610b00565b6001600160a01b0383166107ae5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103e7565b6001600160a01b03821661080f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103e7565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383811660009081526001602090815260408083209386168352929052205460001981146108fc57818110156108ef5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103e7565b6108fc848484840361074c565b50505050565b6001600160a01b0383166109665760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103e7565b6001600160a01b0382166109c85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103e7565b6001600160a01b03831660009081526020819052604090205481811015610a405760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103e7565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36108fc565b6005546001600160a01b031633146104475760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e7565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60008060065442610b639190611015565b90506000610b917f00000000000000000000000000000000000000000000000000000000674925f742611015565b90506000610bdc6301e187e07f00000000000000000000000000000000000000000000000000000000674925f7600654610bcb9190611015565b610bd59190610fd6565b6064610e8c565b90506000610bf1610bd56301e187e085610fd6565b9050808214610d5e57815b600085118015610c0c5750606481105b15610d58576000606d8260648110610c3457634e487b7160e01b600052603260045260246000fd5b0154610c44906301e187e0611015565b905080861115610cd05760088260658110610c6f57634e487b7160e01b600052603260045260246000fd5b0154610c7b9082610ff6565b610c859088610fbe565b965080606d8360648110610ca957634e487b7160e01b600052603260045260246000fd5b016000828254610cb99190610fbe565b90915550610cc990508187611015565b9550610d45565b60088260658110610cf157634e487b7160e01b600052603260045260246000fd5b0154610cfd9087610ff6565b610d079088610fbe565b965085606d8360648110610d2b57634e487b7160e01b600052603260045260246000fd5b016000828254610d3b9190610fbe565b9091555060009650505b5080610d5081611067565b915050610bfc565b50610dc6565b83606d8360648110610d8057634e487b7160e01b600052603260045260246000fd5b016000828254610d909190610fbe565b90915550600890508260658110610db757634e487b7160e01b600052603260045260246000fd5b0154610dc39085610ff6565b94505b5050505090565b6001600160a01b038216610e235760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103e7565b8060026000828254610e359190610fbe565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6000818310610e9b5781610e9d565b825b9392505050565b80356001600160a01b038116811461043057600080fd5b600060208284031215610ecc578081fd5b610e9d82610ea4565b60008060408385031215610ee7578081fd5b610ef083610ea4565b9150610efe60208401610ea4565b90509250929050565b600080600060608486031215610f1b578081fd5b610f2484610ea4565b9250610f3260208501610ea4565b9150604084013590509250925092565b60008060408385031215610f54578182fd5b610f5d83610ea4565b946020939093013593505050565b6000602080835283518082850152825b81811015610f9757858101830151858201604001528201610f7b565b81811115610fa85783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610fd157610fd1611082565b500190565b600082610ff157634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561101057611010611082565b500290565b60008282101561102757611027611082565b500390565b600181811c9082168061104057607f821691505b6020821081141561106157634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561107b5761107b611082565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220fdf7586ef494645dcf19e44f73eed6b34c6d890e0635817bf7163471b9faeb3964736f6c63430008030033