Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
10004135 | 3 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
BackedAutoFeeTokenImplementation
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2021-2024 Backed Finance AG * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Disclaimer and Terms of Use * * These ERC-20 tokens have not been registered under the U.S. Securities Act of 1933, as * amended or with any securities regulatory authority of any State or other jurisdiction * of the United States and (i) may not be offered, sold or delivered within the United States * to, or for the account or benefit of U.S. Persons, and (ii) may be offered, sold or otherwise * delivered at any time only to transferees that are Non-United States Persons (as defined by * the U.S. Commodities Futures Trading Commission). * For more information and restrictions please refer to the issuer's [Website](https://www.backedassets.fi/legal-documentation) */ pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./BackedTokenImplementation.sol"; /** * @dev * * This token contract is following the ERC20 standard. * It inherits BackedTokenImplementation.sol, which is base Backed token implementation. BackedAutoFeeTokenImplementation extends it * with logic of multiplier, which is used for rebasing logic of the token, thus becoming rebase token itself. Additionally, it contains * mechanism, which changes this multiplier per configured fee periodically, on defined period length. * It contains one additional role: * - A multiplierUpdater, that can update value of a multiplier. * */ contract BackedAutoFeeTokenImplementation is BackedTokenImplementation { // Calculating the Delegated Transfer Shares typehash: bytes32 constant public DELEGATED_TRANSFER_SHARES_TYPEHASH = keccak256( "DELEGATED_TRANSFER_SHARES(address owner,address to,uint256 value,uint256 nonce,uint256 deadline)" ); // Roles: address public multiplierUpdater; // Management Fee uint256 public lastTimeFeeApplied; uint256 public feePerPeriod; // in 1e18 precision uint256 public periodLength; /** * @dev Defines ratio between a single share of a token to balance of a token. * Defined in 1e18 precision. * */ uint256 public multiplier; mapping(address => uint256) private _shares; uint256 internal _totalShares; uint256 public multiplierNonce; // Events: /** * @dev Emitted when multiplier updater is changed */ event NewMultiplierUpdater(address indexed newMultiplierUpdater); /** * @dev Emitted when `value` token shares are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event TransferShares( address indexed from, address indexed to, uint256 value ); /** * @dev Emitted when multiplier value is updated */ event MultiplierUpdated(uint256 value); // Modifiers: modifier updateMultiplier() { (uint256 newMultiplier, uint256 periodsPassed, uint256 newMultiplierNonce) = getCurrentMultiplier(); lastTimeFeeApplied = lastTimeFeeApplied + periodLength * periodsPassed; if (multiplier != newMultiplier) { _updateMultiplier(newMultiplier, newMultiplierNonce); } _; } modifier onlyMultiplierUpdater() { require( _msgSender() == multiplierUpdater, "BackedToken: Only multiplier updater" ); _; } modifier onlyUpdatedMultiplier(uint256 oldMultiplier) { require( multiplier == oldMultiplier, "BackedToken: Multiplier changed in the meantime" ); _; } modifier onlyNewerMultiplierNonce(uint256 newMultiplierNonce) { require( multiplierNonce < newMultiplierNonce, "BackedToken: Multiplier nonce is outdated." ); _; } // constructor, set lastTimeFeeApplied to lock the implementation instance. constructor () { lastTimeFeeApplied = 1; } // Initializers: function initialize( string memory name_, string memory symbol_ ) public virtual override { super.initialize(name_, symbol_); _initialize_auto_fee(24 * 3600, block.timestamp, 0); } function initialize( string memory name_, string memory symbol_, uint256 _periodLength, uint256 _lastTimeFeeApplied, uint256 _feePerPeriod ) external virtual { super.initialize(name_, symbol_); _initialize_auto_fee(_periodLength, _lastTimeFeeApplied, _feePerPeriod); } // Should it be only callable by authorized address? function initialize_v2( uint256 _periodLength, uint256 _lastTimeFeeApplied, uint256 _feePerPeriod ) external virtual { _initialize_auto_fee(_periodLength, _lastTimeFeeApplied, _feePerPeriod); } function _initialize_auto_fee( uint256 _periodLength, uint256 _lastTimeFeeApplied, uint256 _feePerPeriod ) internal virtual { require(lastTimeFeeApplied == 0, "BackedAutoFeeTokenImplementation already initialized"); require(_lastTimeFeeApplied != 0, "Invalid last time fee applied"); multiplier = 1e18; multiplierNonce = 0; periodLength = _periodLength; lastTimeFeeApplied = _lastTimeFeeApplied; feePerPeriod = _feePerPeriod; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { (uint256 newMultiplier, ,) = getCurrentMultiplier(); return _getUnderlyingAmountByShares(_totalShares, newMultiplier); } /** * @dev See {IERC20-balanceOf}. */ function balanceOf( address account ) public view virtual override returns (uint256) { (uint256 newMultiplier, ,) = getCurrentMultiplier(); return _getUnderlyingAmountByShares(sharesOf(account), newMultiplier); } /** * @dev Retrieves most up to date value of multiplier * */ function getCurrentMultiplier() public view virtual returns (uint256 newMultiplier, uint256 periodsPassed, uint256 newMultiplierNonce) { periodsPassed = (block.timestamp - lastTimeFeeApplied) / periodLength; newMultiplier = multiplier; newMultiplierNonce = multiplierNonce; if (feePerPeriod > 0) { for (uint256 index = 0; index < periodsPassed; index++) { newMultiplier = (newMultiplier * (1e18 - feePerPeriod)) / 1e18; } newMultiplierNonce += periodsPassed; } } /** * @dev Returns amount of shares owned by given account */ function sharesOf(address account) public view virtual returns (uint256) { return _shares[account]; } /** * @return the amount of shares that corresponds to `_underlyingAmount` underlying amount. */ function getSharesByUnderlyingAmount( uint256 _underlyingAmount ) external view returns (uint256) { (uint256 newMultiplier, ,) = getCurrentMultiplier(); return _getSharesByUnderlyingAmount(_underlyingAmount, newMultiplier); } /** * @return the amount of underlying that corresponds to `_sharesAmount` token shares. */ function getUnderlyingAmountByShares( uint256 _sharesAmount ) external view returns (uint256) { (uint256 newMultiplier, ,) = getCurrentMultiplier(); return _getUnderlyingAmountByShares(_sharesAmount, newMultiplier); } /** * @dev Delegated Transfer Shares, transfer shares via a sign message, using erc712. */ function delegatedTransferShares( address owner, address to, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external virtual allowedDelegate updateMultiplier { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256( abi.encode( DELEGATED_TRANSFER_SHARES_TYPEHASH, owner, to, value, _useNonce(owner), deadline ) ); _checkOwner(owner, structHash, v, r, s); uint256 amount = _getUnderlyingAmountByShares(value, multiplier); _transfer(owner, to, amount); } /** * @dev Transfers underlying shares to destination account * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `sharesAmount`. */ function transferShares( address to, uint256 sharesAmount ) external virtual updateMultiplier returns (bool) { address owner = _msgSender(); uint256 amount = _getUnderlyingAmountByShares(sharesAmount, multiplier); _transfer(owner, to, amount); return true; } /** * @dev Function to set the new fee. Allowed only for owner * * @param newFeePerPeriod The new fee per period value */ function updateFeePerPeriod( uint256 newFeePerPeriod ) external onlyOwner updateMultiplier { feePerPeriod = newFeePerPeriod; } /** * @dev Function to change the contract multiplier updater. Allowed only for owner * * Emits a { NewMultiplierUpdater } event * * @param newMultiplierUpdater The address of the new multiplier updater */ function setMultiplierUpdater( address newMultiplierUpdater ) external onlyOwner { multiplierUpdater = newMultiplierUpdater; emit NewMultiplierUpdater(newMultiplierUpdater); } /** * @dev Function to change the time of last fee accrual. Allowed only for owner * * @param newLastTimeFeeApplied A timestamp of last time fee was applied */ function setLastTimeFeeApplied( uint256 newLastTimeFeeApplied ) external onlyOwner updateMultiplier { require(newLastTimeFeeApplied != 0, "Invalid last time fee applied"); lastTimeFeeApplied = newLastTimeFeeApplied; } /** * @dev Function to change period length. Allowed only for owner * * @param newPeriodLength Length of a single accrual period in seconds */ function setPeriodLength(uint256 newPeriodLength) external onlyOwner updateMultiplier { periodLength = newPeriodLength; } /** * @dev Function to change the contract multiplier, only if oldMultiplier did not change in the meantime. Allowed only for multiplierUpdater * * Emits a { MultiplierChanged } event * * @param newMultiplier New multiplier value */ function updateMultiplierValue( uint256 newMultiplier, uint256 oldMultiplier ) public onlyMultiplierUpdater updateMultiplier onlyUpdatedMultiplier(oldMultiplier) { _updateMultiplier(newMultiplier, multiplierNonce + 1); } /** * @dev Function to change the contract multiplier with nonce, only if oldMultiplier did not change in the meantime. Allowed only for multiplierUpdater * * Emits a { MultiplierChanged } event * * @param newMultiplier New multiplier value * @param newMultiplierNonce New multplier nonce */ function updateMultiplierWithNonce( uint256 newMultiplier, uint256 oldMultiplier, uint256 newMultiplierNonce ) external onlyMultiplierUpdater updateMultiplier onlyUpdatedMultiplier(oldMultiplier) onlyNewerMultiplierNonce(newMultiplierNonce){ _updateMultiplier(newMultiplier, newMultiplierNonce); } /** * @return the amount of shares that corresponds to `_underlyingAmount` underlying amount. */ function _getSharesByUnderlyingAmount( uint256 _underlyingAmount, uint256 _multiplier ) internal pure returns (uint256) { return (_underlyingAmount * 1e18) / _multiplier; } /** * @return the amount of underlying that corresponds to `_sharesAmount` token shares. */ function _getUnderlyingAmountByShares( uint256 _sharesAmount, uint256 _multiplier ) internal pure returns (uint256) { return (_sharesAmount * _multiplier) / 1e18; } /** * @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. * Emits a {TransferShares} 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 override { 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 _sharesAmount = _getSharesByUnderlyingAmount( amount, multiplier ); uint256 currentSenderShares = _shares[from]; require( currentSenderShares >= _sharesAmount, "ERC20: transfer amount exceeds balance" ); unchecked { _shares[from] = currentSenderShares - (_sharesAmount); } _shares[to] = _shares[to] + (_sharesAmount); emit Transfer(from, to, amount); emit TransferShares(from, to, _sharesAmount); _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. * Emits a {TransferShares} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual override { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); uint256 sharesAmount = _getSharesByUnderlyingAmount(amount, multiplier); _totalShares += sharesAmount; _shares[account] += sharesAmount; emit Transfer(address(0), account, amount); emit TransferShares(address(0), account, sharesAmount); _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. * Emits a {TransferShares} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `sharesAmount` token shares. */ function _burn(address account, uint256 amount) internal virtual override { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 sharesAmount = _getSharesByUnderlyingAmount(amount, multiplier); uint256 accountBalance = _shares[account]; require( accountBalance >= sharesAmount, "ERC20: burn amount exceeds balance" ); unchecked { _shares[account] = accountBalance - sharesAmount; } _totalShares -= sharesAmount; emit Transfer(account, address(0), amount); emit TransferShares(account, address(0), sharesAmount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Updates currently stored multiplier with a new value * * Emit an {MultiplierUpdated} event. */ function _updateMultiplier(uint256 newMultiplier, uint256 newMultiplierNonce) internal virtual { multiplier = newMultiplier; multiplierNonce = newMultiplierNonce; emit MultiplierUpdated(newMultiplier); } // Implement the update multiplier functionality before transfer: function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override updateMultiplier { super._beforeTokenTransfer(from, to, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20Upgradeable.sol"; import "./extensions/IERC20MetadataUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable { 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. */ function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC20_init_unchained(name_, symbol_); } function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[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 = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, 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: * * - `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; } _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; _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; } _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 Spend `amount` form the allowance of `owner` toward `spender`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @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 {} /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[45] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20MetadataUpgradeable is IERC20Upgradeable { /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../StringsUpgradeable.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSAUpgradeable { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2021-2022 Backed Finance AG * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /** * Disclaimer and Terms of Use * * These ERC-20 tokens have not been registered under the U.S. Securities Act of 1933, as * amended or with any securities regulatory authority of any State or other jurisdiction * of the United States and (i) may not be offered, sold or delivered within the United States * to, or for the account or benefit of U.S. Persons, and (ii) may be offered, sold or otherwise * delivered at any time only to transferees that are Non-United States Persons (as defined by * the U.S. Commodities Futures Trading Commission). * For more information and restrictions please refer to the issuer's [Website](https://www.backedassets.fi/legal-documentation) */ pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "./ERC20PermitDelegateTransfer.sol"; import "./SanctionsList.sol"; /** * @dev * * This token contract is following the ERC20 standard. * It inherits ERC20PermitDelegateTransfer.sol, which extends the basic ERC20 to also allow permit and delegateTransfer EIP-712 functionality. * Enforces Sanctions List via the Chainalysis standard interface. * The contract contains three roles: * - A minter, that can mint new tokens. * - A burner, that can burn its own tokens, or contract's tokens. * - A pauser, that can pause or restore all transfers in the contract. * - An owner, that can set the three above, and also the sanctionsList pointer. * The owner can also set who can use the EIP-712 functionality, either specific accounts via a whitelist, or everyone. * */ contract BackedTokenImplementation is OwnableUpgradeable, ERC20PermitDelegateTransfer { string constant public VERSION = "1.1.0"; // Roles: address public minter; address public burner; address public pauser; // EIP-712 Delegate Functionality: bool public delegateMode; mapping(address => bool) public delegateWhitelist; // Pause: bool public isPaused; // SanctionsList: SanctionsList public sanctionsList; // Terms: string public terms; // Events: event NewMinter(address indexed newMinter); event NewBurner(address indexed newBurner); event NewPauser(address indexed newPauser); event NewSanctionsList(address indexed newSanctionsList); event DelegateWhitelistChange(address indexed whitelistAddress, bool status); event DelegateModeChange(bool delegateMode); event PauseModeChange(bool pauseMode); event NewTerms(string newTerms); modifier allowedDelegate { require(delegateMode || delegateWhitelist[_msgSender()], "BackedToken: Unauthorized delegate"); _; } // constructor, call initializer to lock the implementation instance. constructor () { initialize("Backed Token Implementation", "BTI"); } function initialize(string memory name_, string memory symbol_) public virtual initializer { __ERC20_init(name_, symbol_); __Ownable_init(); _buildDomainSeparator(); _setTerms("https://www.backedassets.fi/legal-documentation"); // Default Terms } /** * @dev Update allowance with a signed permit. Allowed only if * the sender is whitelisted, or the delegateMode is set to true * * @param owner Token owner's address (Authorizer) * @param spender Spender's address * @param value Amount of allowance * @param deadline Expiration time, seconds since the epoch * @param v v part of the signature * @param r r part of the signature * @param s s part of the signature */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public override allowedDelegate { super.permit(owner, spender, value, deadline, v, r, s); } /** * @dev Perform an intended transfer on one account's behalf, from another account, * who actually pays fees for the transaction. Allowed only if the sender * is whitelisted, or the delegateMode is set to true * * @param owner The account that provided the signature and from which the tokens will be taken * @param to The account that will receive the tokens * @param value The amount of tokens to transfer * @param deadline Expiration time, seconds since the epoch * @param v v part of the signature * @param r r part of the signature * @param s s part of the signature */ function delegatedTransfer( address owner, address to, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override allowedDelegate { super.delegatedTransfer(owner, to, value, deadline, v, r, s); } /** * @dev Function to mint tokens. Allowed only for minter * * @param account The address that will receive the minted tokens * @param amount The amount of tokens to mint */ function mint(address account, uint256 amount) virtual external { require(_msgSender() == minter, "BackedToken: Only minter"); _mint(account, amount); } /** * @dev Function to burn tokens. Allowed only for burner. The burned tokens * must be from the burner (msg.sender), or from the contract itself * * @param account The account from which the tokens will be burned * @param amount The amount of tokens to be burned */ function burn(address account, uint256 amount) virtual external { require(_msgSender() == burner, "BackedToken: Only burner"); require(account == _msgSender() || account == address(this), "BackedToken: Cannot burn account"); _burn(account, amount); } /** * @dev Function to set the pause in order to block or restore all * transfers. Allowed only for pauser * * Emits a { PauseModeChange } event * * @param newPauseMode The new pause mode */ function setPause(bool newPauseMode) external { require(_msgSender() == pauser, "BackedToken: Only pauser"); isPaused = newPauseMode; emit PauseModeChange(newPauseMode); } /** * @dev Function to change the contract minter. Allowed only for owner * * Emits a { NewMinter } event * * @param newMinter The address of the new minter */ function setMinter(address newMinter) external onlyOwner { minter = newMinter; emit NewMinter(newMinter); } /** * @dev Function to change the contract burner. Allowed only for owner * * Emits a { NewBurner } event * * @param newBurner The address of the new burner */ function setBurner(address newBurner) external onlyOwner { burner = newBurner; emit NewBurner(newBurner); } /** * @dev Function to change the contract pauser. Allowed only for owner * * Emits a { NewPauser } event * * @param newPauser The address of the new pauser */ function setPauser(address newPauser) external onlyOwner { pauser = newPauser; emit NewPauser(newPauser); } /** * @dev Function to change the contract Senctions List. Allowed only for owner * * Emits a { NewSanctionsList } event * * @param newSanctionsList The address of the new Senctions List following the Chainalysis standard */ function setSanctionsList(address newSanctionsList) external onlyOwner { // Check the proposed sanctions list contract has the right interface: require(!SanctionsList(newSanctionsList).isSanctioned(address(this)), "BackedToken: Wrong List interface"); sanctionsList = SanctionsList(newSanctionsList); emit NewSanctionsList(newSanctionsList); } /** * @dev EIP-712 Function to change the delegate status of account. * Allowed only for owner * * Emits a { DelegateWhitelistChange } event * * @param whitelistAddress The address for which to change the delegate status * @param status The new delegate status */ function setDelegateWhitelist(address whitelistAddress, bool status) external onlyOwner { delegateWhitelist[whitelistAddress] = status; emit DelegateWhitelistChange(whitelistAddress, status); } /** * @dev EIP-712 Function to change the contract delegate mode. Allowed * only for owner * * Emits a { DelegateModeChange } event * * @param _delegateMode The new delegate mode for the contract */ function setDelegateMode(bool _delegateMode) external onlyOwner { delegateMode = _delegateMode; emit DelegateModeChange(_delegateMode); } /** * @dev Function to change the contract terms. Allowed only for owner * * Emits a { NewTerms } event * * @param newTerms A string with the terms. Usually a web or IPFS link. */ function setTerms(string memory newTerms) external onlyOwner { _setTerms(newTerms); } // Implement setTerms, tp allow also to use from initializer: function _setTerms(string memory newTerms) internal virtual { terms = newTerms; emit NewTerms(newTerms); } // Implement the pause and SanctionsList functionality before transfer: function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual override { // Check not paused: require(!isPaused, "BackedToken: token transfer while paused"); // Check Sanctions List, but do not prevent minting burning: if (from != address(0) && to != address(0)) { require(!sanctionsList.isSanctioned(from), "BackedToken: sender is sanctioned"); require(!sanctionsList.isSanctioned(to), "BackedToken: receiver is sanctioned"); } super._beforeTokenTransfer(from, to, amount); } // Implement the SanctionsList functionality for spender: function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual override { require(!sanctionsList.isSanctioned(spender), "BackedToken: spender is sanctioned"); super._spendAllowance(owner, spender, amount); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
/** * SPDX-License-Identifier: MIT * * Copyright (c) 2021-2022 Backed Finance AG * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ pragma solidity 0.8.9; import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; /** * @dev * * This contract is a based (copy-paste with changes) on OpenZeppelin's draft-ERC20Permit.sol (token/ERC20/extensions/draft-ERC20Permit.sol). * * The changes are: * - Adding also delegated transfer functionality, that is similar to permit, but doing the actual transfer and not approval. * - Cutting some of the generalities to make the contacts more straight forward for this case (e.g. removing the counters library). * */ contract ERC20PermitDelegateTransfer is ERC20Upgradeable { mapping(address => uint256) public nonces; // Calculating the Permit typehash: bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // Calculating the Delegated Transfer typehash: bytes32 public constant DELEGATED_TRANSFER_TYPEHASH = keccak256("DELEGATED_TRANSFER(address owner,address to,uint256 value,uint256 nonce,uint256 deadline)"); // Immutable variable for Domain Separator: // solhint-disable-next-line var-name-mixedcase bytes32 public DOMAIN_SEPARATOR; // A version number: // solhint-disable-next-line var-name-mixedcase string internal constant DOMAIN_SEPARATOR_VERSION = "1"; /** * @dev Permit, approve via a sign message, using erc712. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); _checkOwner(owner, structHash, v, r, s); _approve(owner, spender, value); } /** * @dev Delegated Transfer, transfer via a sign message, using erc712. */ function delegatedTransfer( address owner, address to, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(DELEGATED_TRANSFER_TYPEHASH, owner, to, value, _useNonce(owner), deadline)); _checkOwner(owner, structHash, v, r, s); _transfer(owner, to, value); } /** * @dev "Consume a nonce": return the current value and increment. */ function _useNonce(address owner) internal virtual returns (uint256 current) { current = nonces[owner]; nonces[owner]++; } function _checkOwner(address owner, bytes32 structHash, uint8 v, bytes32 r, bytes32 s) internal view { bytes32 hash = ECDSAUpgradeable.toTypedDataHash(DOMAIN_SEPARATOR, structHash); address signer = ECDSAUpgradeable.recover(hash, v, r, s); require(signer == owner, "ERC20Permit: invalid signature"); } function _buildDomainSeparator() internal { DOMAIN_SEPARATOR = keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name())), keccak256(bytes(DOMAIN_SEPARATOR_VERSION)), block.chainid, address(this) ) ); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
pragma solidity 0.8.9; /** * SPDX-License-Identifier: MIT * * Copyright (c) 2021-2022 Backed Finance AG * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ interface SanctionsList { function isSanctioned(address addr) external view returns (bool); }
{ "optimizer": { "enabled": true, "runs": 10 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"delegateMode","type":"bool"}],"name":"DelegateModeChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"whitelistAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"DelegateWhitelistChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"MultiplierUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newBurner","type":"address"}],"name":"NewBurner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newMinter","type":"address"}],"name":"NewMinter","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newMultiplierUpdater","type":"address"}],"name":"NewMultiplierUpdater","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newPauser","type":"address"}],"name":"NewPauser","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newSanctionsList","type":"address"}],"name":"NewSanctionsList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newTerms","type":"string"}],"name":"NewTerms","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"pauseMode","type":"bool"}],"name":"PauseModeChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferShares","type":"event"},{"inputs":[],"name":"DELEGATED_TRANSFER_SHARES_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATED_TRANSFER_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"delegateMode","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"delegateWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegatedTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegatedTransferShares","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feePerPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentMultiplier","outputs":[{"internalType":"uint256","name":"newMultiplier","type":"uint256"},{"internalType":"uint256","name":"periodsPassed","type":"uint256"},{"internalType":"uint256","name":"newMultiplierNonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_underlyingAmount","type":"uint256"}],"name":"getSharesByUnderlyingAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_sharesAmount","type":"uint256"}],"name":"getUnderlyingAmountByShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint256","name":"_periodLength","type":"uint256"},{"internalType":"uint256","name":"_lastTimeFeeApplied","type":"uint256"},{"internalType":"uint256","name":"_feePerPeriod","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_periodLength","type":"uint256"},{"internalType":"uint256","name":"_lastTimeFeeApplied","type":"uint256"},{"internalType":"uint256","name":"_feePerPeriod","type":"uint256"}],"name":"initialize_v2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastTimeFeeApplied","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiplierNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"multiplierUpdater","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pauser","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sanctionsList","outputs":[{"internalType":"contract SanctionsList","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newBurner","type":"address"}],"name":"setBurner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_delegateMode","type":"bool"}],"name":"setDelegateMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"whitelistAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setDelegateWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newLastTimeFeeApplied","type":"uint256"}],"name":"setLastTimeFeeApplied","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMultiplierUpdater","type":"address"}],"name":"setMultiplierUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"newPauseMode","type":"bool"}],"name":"setPause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPauser","type":"address"}],"name":"setPauser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newPeriodLength","type":"uint256"}],"name":"setPeriodLength","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newSanctionsList","type":"address"}],"name":"setSanctionsList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newTerms","type":"string"}],"name":"setTerms","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"sharesOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"terms","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"sharesAmount","type":"uint256"}],"name":"transferShares","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeePerPeriod","type":"uint256"}],"name":"updateFeePerPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMultiplier","type":"uint256"},{"internalType":"uint256","name":"oldMultiplier","type":"uint256"}],"name":"updateMultiplierValue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMultiplier","type":"uint256"},{"internalType":"uint256","name":"oldMultiplier","type":"uint256"},{"internalType":"uint256","name":"newMultiplierNonce","type":"uint256"}],"name":"updateMultiplierWithNonce","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50620000746040518060400160405280601b81526020017f4261636b656420546f6b656e20496d706c656d656e746174696f6e00000000008152506040518060400160405280600381526020016242544960e81b8152506200008060201b60201c565b60016101035562000739565b620000978282620000ac60201b620018791760201c565b620000a862015180426000620001bb565b5050565b600054610100900460ff16620000c95760005460ff1615620000d3565b620000d3620002a7565b6200013c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b600054610100900460ff161580156200015f576000805461ffff19166101011790555b6200016b8383620002c5565b62000175620002fb565b6200017f62000331565b620001a36040518060600160405280602f815260200162003b7f602f9139620003dc565b8015620001b6576000805461ff00191690555b505050565b6101035415620002345760405162461bcd60e51b815260206004820152603460248201527f4261636b65644175746f466565546f6b656e496d706c656d656e746174696f6e60448201527f20616c726561647920696e697469616c697a6564000000000000000000000000606482015260840162000133565b81620002835760405162461bcd60e51b815260206004820152601d60248201527f496e76616c6964206c6173742074696d6520666565206170706c696564000000604482015260640162000133565b670de0b6b3a764000061010655600061010955610105929092556101035561010455565b6000620002bf306200042e60201b620019721760201c565b15905090565b600054610100900460ff16620002ef5760405162461bcd60e51b8152600401620001339062000659565b620000a882826200043d565b600054610100900460ff16620003255760405162461bcd60e51b8152600401620001339062000659565b6200032f62000492565b565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6200035c620004c7565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120609855565b8051620003f19060d0906020840190620005b3565b507f9c1e1a17a78053ad78b3801837ad5e515d429987252f2e1371b7b50fa8ff8bec81604051620004239190620006a4565b60405180910390a150565b6001600160a01b03163b151590565b600054610100900460ff16620004675760405162461bcd60e51b8152600401620001339062000659565b81516200047c906068906020850190620005b3565b508051620001b6906069906020840190620005b3565b600054610100900460ff16620004bc5760405162461bcd60e51b8152600401620001339062000659565b6200032f3362000561565b606060688054620004d890620006fc565b80601f01602080910402602001604051908101604052809291908181526020018280546200050690620006fc565b8015620005575780601f106200052b5761010080835404028352916020019162000557565b820191906000526020600020905b8154815290600101906020018083116200053957829003601f168201915b5050505050905090565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620005c190620006fc565b90600052602060002090601f016020900481019282620005e5576000855562000630565b82601f106200060057805160ff191683800117855562000630565b8280016001018555821562000630579182015b828111156200063057825182559160200191906001019062000613565b506200063e92915062000642565b5090565b5b808211156200063e576000815560010162000643565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b600060208083528351808285015260005b81811015620006d357858101830151858201604001528201620006b5565b81811115620006e6576000604083870101525b50601f01601f1916929092016040019392505050565b600181811c908216806200071157607f821691505b602082108114156200073357634e487b7160e01b600052602260045260246000fd5b50919050565b61343680620007496000396000f3fe608060405234801561001057600080fd5b50600436106102cf5760003560e01c80637f120587116101845780637f120587146105415780638da5cb5b146105565780638fcb4e5b1461055e578063944b511c1461057157806395d89b41146105845780639dc29fac1461058c5780639fd0506d1461059f578063a15f84da146105b2578063a457c2d7146105c5578063a879a9db146105d8578063a9059cbb146105eb578063a996d6ce146105fe578063aea77ac314610611578063b187bd2614610624578063b6ca6e1214610631578063bedb86fb14610644578063d2ca211514610657578063d502562514610661578063d505accf14610669578063d904be121461067c578063dd62ed3e1461068f578063deeb8bfd146106a2578063ec571c6a146106b7578063f00c1dff146106cf578063f2fde38b146106d9578063f5eb42dc146106ec578063f5f68898146106ff578063f9e4789614610712578063fca3b5aa1461071c578063ff29130c1461072f578063ffa1ad741461074257600080fd5b80630194b09b146102d457806305602501146102fe57806306fdde03146103135780630754617214610328578063095ea7b31461033b57806318160ddd1461035e5780631b3ed722146103745780631c5633d71461037e57806323b872dd1461039157806327810b6e146103a45780632b63c300146103b75780632cc5ecd5146103da5780632d88af4a146103fd57806330adf81f14610410578063313ce567146104255780633644e51514610434578063395093511461043d5780633dfa34cd1461045057806340c10f191461045a578063430c777c1461046d57806344acb51b1461048057806349dc5e8d146104935780634cd88b76146104a65780635add8efc146104b95780635c575ef3146104cc57806370a08231146104e0578063715018a6146104f35780637544e6b3146104fb57806378f86afc1461050e5780637ecebe0014610521575b600080fd5b610102546102e8906001600160a01b031681565b6040516102f59190612bf7565b60405180910390f35b61031161030c366004612c0b565b610766565b005b61031b610776565b6040516102f59190612c37565b60cb546102e8906001600160a01b031681565b61034e610349366004612ca8565b610808565b60405190151581526020016102f5565b610366610820565b6040519081526020016102f5565b6103666101065481565b61031161038c366004612cd2565b610842565b61034e61039f366004612ceb565b6108cb565b60cc546102e8906001600160a01b031681565b6103bf6108ef565b604080519384526020840192909252908201526060016102f5565b61034e6103e8366004612d27565b60ce6020526000908152604090205460ff1681565b61031161040b366004612d27565b610991565b6103666000805160206133e183398151915281565b604051601281526020016102f5565b61036660985481565b61034e61044b366004612ca8565b610a0a565b6103666101035481565b610311610468366004612ca8565b610a49565b61031161047b366004612cd2565b610ab5565b61036661048e366004612cd2565b610b52565b6103116104a1366004612d27565b610b72565b6103116104b4366004612de4565b610cc6565b6103116104c7366004612cd2565b610cdf565b60cd5461034e90600160a01b900460ff1681565b6103666104ee366004612d27565b610d5f565b610311610d80565b610311610509366004612e47565b610dbb565b61031161051c366004612ec5565b610dd7565b61036661052f366004612d27565b60976020526000908152604090205481565b61036660008051602061338183398151915281565b6102e8610e12565b61034e61056c366004612ca8565b610e21565b61036661057f366004612cd2565b610e99565b61031b610eb2565b61031161059a366004612ca8565b610ec1565b60cd546102e8906001600160a01b031681565b6103116105c0366004612f0f565b610f94565b61034e6105d3366004612ca8565b61101b565b6103116105e6366004612f2c565b6110ad565b61034e6105f9366004612ca8565b61116d565b61031161060c366004612d27565b61117b565b61031161061f366004612f4e565b6111f4565b60cf5461034e9060ff1681565b61031161063f366004612fc1565b61124f565b610311610652366004612f0f565b6112dd565b6103666101055481565b61031b61137c565b610311610677366004612f4e565b61140a565b61031161068a366004612c0b565b61145c565b61036661069d366004612ff8565b611575565b6103666000805160206133a183398151915281565b60cf546102e89061010090046001600160a01b031681565b6103666101045481565b6103116106e7366004612d27565b6115a0565b6103666106fa366004612d27565b61163d565b61031161070d366004612d27565b611659565b6103666101095481565b61031161072a366004612d27565b6116d3565b61031161073d366004612f4e565b61174c565b61031b604051806040016040528060058152602001640312e312e360dc1b81525081565b610771838383611981565b505050565b6060606880546107859061302b565b80601f01602080910402602001604051908101604052809291908181526020018280546107b19061302b565b80156107fe5780601f106107d3576101008083540402835291602001916107fe565b820191906000526020600020905b8154815290600101906020018083116107e157829003601f168201915b5050505050905090565b600033610816818585611a30565b5060019392505050565b60008061082b6108ef565b5050905061083c6101085482611b54565b91505090565b3361084b610e12565b6001600160a01b03161461087a5760405162461bcd60e51b815260040161087190613066565b60405180910390fd5b60008060006108876108ef565b925092509250816101055461089c91906130b1565b610103546108aa91906130d0565b610103556101065483146108c2576108c28382611b73565b50505061010555565b6000336108d9858285611bb6565b6108e4858585611c9d565b506001949350505050565b600080600061010554610103544261090791906130e8565b61091191906130ff565b9150610106549250610109549050600061010454111561098c5760005b8281101561097e57670de0b6b3a764000061010454670de0b6b3a764000061095691906130e8565b61096090866130b1565b61096a91906130ff565b93508061097681613121565b91505061092e565b5061098982826130d0565b90505b909192565b3361099a610e12565b6001600160a01b0316146109c05760405162461bcd60e51b815260040161087190613066565b60cd80546001600160a01b0319166001600160a01b0383169081179091556040517f4f68150eb56c53cc9373649e35bc37dd235a0c86e10aa23b8a835378136ac6a090600090a250565b3360008181526066602090815260408083206001600160a01b03871684529091528120549091906108169082908690610a449087906130d0565b611a30565b60cb546001600160a01b0316336001600160a01b031614610aa75760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c9036b4b73a32b960411b6044820152606401610871565b610ab18282611eb6565b5050565b33610abe610e12565b6001600160a01b031614610ae45760405162461bcd60e51b815260040161087190613066565b6000806000610af16108ef565b9250925092508161010554610b0691906130b1565b61010354610b1491906130d0565b61010355610106548314610b2c57610b2c8382611b73565b83610b495760405162461bcd60e51b81526004016108719061313c565b50505061010355565b600080610b5d6108ef565b50509050610b6b8382611fd2565b9392505050565b33610b7b610e12565b6001600160a01b031614610ba15760405162461bcd60e51b815260040161087190613066565b60405163df592f7d60e01b81526001600160a01b0382169063df592f7d90610bcd903090600401612bf7565b60206040518083038186803b158015610be557600080fd5b505afa158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1d9190613173565b15610c745760405162461bcd60e51b815260206004820152602160248201527f4261636b6564546f6b656e3a2057726f6e67204c69737420696e7465726661636044820152606560f81b6064820152608401610871565b60cf8054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517feff538eaa91b9b5384df4354f3841681487784258ac4b209182aef0755f9e0be90600090a250565b610cd08282611879565b610ab162015180426000611981565b33610ce8610e12565b6001600160a01b031614610d0e5760405162461bcd60e51b815260040161087190613066565b6000806000610d1b6108ef565b9250925092508161010554610d3091906130b1565b61010354610d3e91906130d0565b61010355610106548314610d5657610d568382611b73565b50505061010455565b600080610d6a6108ef565b50509050610b6b610d7a8461163d565b82611b54565b33610d89610e12565b6001600160a01b031614610daf5760405162461bcd60e51b815260040161087190613066565b610db96000611fe7565b565b610dc58585611879565b610dd0838383611981565b5050505050565b33610de0610e12565b6001600160a01b031614610e065760405162461bcd60e51b815260040161087190613066565b610e0f81612039565b50565b6033546001600160a01b031690565b600080600080610e2f6108ef565b9250925092508161010554610e4491906130b1565b61010354610e5291906130d0565b61010355610106548314610e6a57610e6a8382611b73565b60003390506000610e7e8761010654611b54565b9050610e8b828983611c9d565b506001979650505050505050565b600080610ea46108ef565b50509050610b6b8382611b54565b6060606980546107859061302b565b60cc546001600160a01b0316336001600160a01b031614610f1f5760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c90313ab93732b960411b6044820152606401610871565b6001600160a01b038216331480610f3e57506001600160a01b03821630145b610f8a5760405162461bcd60e51b815260206004820181905260248201527f4261636b6564546f6b656e3a2043616e6e6f74206275726e206163636f756e746044820152606401610871565b610ab1828261207c565b33610f9d610e12565b6001600160a01b031614610fc35760405162461bcd60e51b815260040161087190613066565b60cd8054821515600160a01b0260ff60a01b199091161790556040517f238422c0d720060023911dceeb8ba506952801637ad007844edcd4416364fecf9061101090831515815260200190565b60405180910390a150565b3360008181526066602090815260408083206001600160a01b0387168452909152812054909190838110156110a05760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610871565b6108e48286868403611a30565b610102546001600160a01b0316336001600160a01b0316146110e15760405162461bcd60e51b815260040161087190613190565b60008060006110ee6108ef565b925092509250816101055461110391906130b1565b6101035461111191906130d0565b61010355610106548314611129576111298382611b73565b8380610106541461114c5760405162461bcd60e51b8152600401610871906131d4565b6111658661010954600161116091906130d0565b611b73565b505050505050565b600033610816818585611c9d565b33611184610e12565b6001600160a01b0316146111aa5760405162461bcd60e51b815260040161087190613066565b60cc80546001600160a01b0319166001600160a01b0383169081179091556040517f5bb1db06eeb30d85c1e53ae2285b460ce83e4318c623bd1ca51df912f64c45a490600090a250565b60cd54600160a01b900460ff168061121b575033600090815260ce602052604090205460ff165b6112375760405162461bcd60e51b815260040161087190613223565b6112468787878787878761220a565b50505050505050565b33611258610e12565b6001600160a01b03161461127e5760405162461bcd60e51b815260040161087190613066565b6001600160a01b038216600081815260ce6020908152604091829020805460ff191685151590811790915591519182527f7459b9d2544fdaf790226b129ff473f8c8ce56bfc10bc3bdbe1c71b9d426a546910160405180910390a25050565b60cd546001600160a01b0316336001600160a01b03161461133b5760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c903830bab9b2b960411b6044820152606401610871565b60cf805460ff19168215159081179091556040519081527fb9bcdd890b4d4c213bab99cf96dc1adb9ede36bb2a54610c91a86de844b05fb890602001611010565b60d080546113899061302b565b80601f01602080910402602001604051908101604052809291908181526020018280546113b59061302b565b80156114025780601f106113d757610100808354040283529160200191611402565b820191906000526020600020905b8154815290600101906020018083116113e557829003601f168201915b505050505081565b60cd54600160a01b900460ff1680611431575033600090815260ce602052604090205460ff165b61144d5760405162461bcd60e51b815260040161087190613223565b6112468787878787878761228d565b610102546001600160a01b0316336001600160a01b0316146114905760405162461bcd60e51b815260040161087190613190565b600080600061149d6108ef565b92509250925081610105546114b291906130b1565b610103546114c091906130d0565b610103556101065483146114d8576114d88382611b73565b848061010654146114fb5760405162461bcd60e51b8152600401610871906131d4565b848061010954106115615760405162461bcd60e51b815260206004820152602a60248201527f4261636b6564546f6b656e3a204d756c7469706c696572206e6f6e63652069736044820152691037baba3230ba32b21760b11b6064820152608401610871565b61156b8887611b73565b5050505050505050565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b336115a9610e12565b6001600160a01b0316146115cf5760405162461bcd60e51b815260040161087190613066565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610871565b610e0f81611fe7565b6001600160a01b03166000908152610107602052604090205490565b33611662610e12565b6001600160a01b0316146116885760405162461bcd60e51b815260040161087190613066565b61010280546001600160a01b0319166001600160a01b0383169081179091556040517f352ee13cfd2e4909f0a0c7b78a6079921377f6377d8af594509ff9aaf4f925da90600090a250565b336116dc610e12565b6001600160a01b0316146117025760405162461bcd60e51b815260040161087190613066565b60cb80546001600160a01b0319166001600160a01b0383169081179091556040517f6adffd5c93085d835dac6f3b40adf7c242ca4b3284048d20c3d8a501748dc97390600090a250565b60cd54600160a01b900460ff1680611773575033600090815260ce602052604090205460ff165b61178f5760405162461bcd60e51b815260040161087190613223565b600080600061179c6108ef565b92509250925081610105546117b191906130b1565b610103546117bf91906130d0565b610103556101065483146117d7576117d78382611b73565b864211156117f75760405162461bcd60e51b815260040161087190613265565b60006000805160206133a18339815191528b8b8b6118148f612310565b8c60405160200161182a9695949392919061329c565b60405160208183030381529060405280519060200120905061184f8b82898989612341565b600061185e8a61010654611b54565b905061186b8c8c83611c9d565b505050505050505050505050565b600054610100900460ff166118945760005460ff161561189c565b61189c6123fd565b6118ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610871565b600054610100900460ff16158015611921576000805461ffff19166101011790555b61192b838361240e565b61193361243f565b61193b61246e565b61195c6040518060600160405280602f8152602001613332602f9139612039565b8015610771576000805461ff0019169055505050565b6001600160a01b03163b151590565b61010354156119ef5760405162461bcd60e51b815260206004820152603460248201527f4261636b65644175746f466565546f6b656e496d706c656d656e746174696f6e60448201527308185b1c9958591e481a5b9a5d1a585b1a5e995960621b6064820152608401610871565b81611a0c5760405162461bcd60e51b81526004016108719061313c565b670de0b6b3a764000061010655600061010955610105929092556101035561010455565b6001600160a01b038316611a925760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610871565b6001600160a01b038216611af35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610871565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000670de0b6b3a7640000611b6983856130b1565b610b6b91906130ff565b6101068290556101098190556040518281527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a15050565b60cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d90611bea908590600401612bf7565b60206040518083038186803b158015611c0257600080fd5b505afa158015611c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3a9190613173565b15611c925760405162461bcd60e51b815260206004820152602260248201527f4261636b6564546f6b656e3a207370656e6465722069732073616e6374696f6e604482015261195960f21b6064820152608401610871565b610771838383612517565b6001600160a01b038316611d015760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610871565b6001600160a01b038216611d635760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610871565b611d6e83838361258b565b6000611d7d8261010654611fd2565b6001600160a01b0385166000908152610107602052604090205490915081811015611df95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610871565b6001600160a01b0380861660009081526101076020526040808220858503905591861681522054611e2b9083906130d0565b6001600160a01b038086166000818152610107602052604090819020939093559151908716906000805160206133c183398151915290611e6e9087815260200190565b60405180910390a3836001600160a01b0316856001600160a01b031660008051602061336183398151915284604051611ea991815260200190565b60405180910390a3610dd0565b6001600160a01b038216611f0c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610871565b611f186000838361258b565b6000611f278261010654611fd2565b9050806101086000828254611f3c91906130d0565b90915550506001600160a01b0383166000908152610107602052604081208054839290611f6a9084906130d0565b90915550506040518281526001600160a01b038416906000906000805160206133c18339815191529060200160405180910390a36040518181526001600160a01b038416906000906000805160206133618339815191529060200160405180910390a3505050565b600081611b6984670de0b6b3a76400006130b1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b805161204c9060d0906020840190612b5e565b507f9c1e1a17a78053ad78b3801837ad5e515d429987252f2e1371b7b50fa8ff8bec816040516110109190612c37565b6001600160a01b0382166120dc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610871565b6120e88260008361258b565b60006120f78261010654611fd2565b6001600160a01b038416600090815261010760205260409020549091508181101561216f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610871565b6001600160a01b038416600090815261010760205260408120838303905561010880548492906121a09084906130e8565b90915550506040518381526000906001600160a01b038616906000805160206133c18339815191529060200160405180910390a36040518281526000906001600160a01b038616906000805160206133618339815191529060200160405180910390a35b50505050565b8342111561222a5760405162461bcd60e51b815260040161087190613265565b60006000805160206133818339815191528888886122478c612310565b8960405160200161225d9695949392919061329c565b6040516020818303038152906040528051906020012090506122828882868686612341565b61156b888888611c9d565b834211156122ad5760405162461bcd60e51b815260040161087190613265565b60006000805160206133e18339815191528888886122ca8c612310565b896040516020016122e09695949392919061329c565b6040516020818303038152906040528051906020012090506123058882868686612341565b61156b888888611a30565b6001600160a01b038116600090815260976020526040812080549182919061233783613121565b9190505550919050565b600061238a6098548660405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061239a828686866125de565b9050866001600160a01b0316816001600160a01b0316146112465760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610871565b600061240830611972565b15905090565b600054610100900460ff166124355760405162461bcd60e51b8152600401610871906132d0565b610ab18282612606565b600054610100900460ff166124665760405162461bcd60e51b8152600401610871906132d0565b610db9612654565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612497610776565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120609855565b60006125238484611575565b90506000198114612204578181101561257e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610871565b6122048484848403611a30565b60008060006125986108ef565b92509250925081610105546125ad91906130b1565b610103546125bb91906130d0565b610103556101065483146125d3576125d38382611b73565b611165868686612684565b60008060006125ef878787876128c5565b915091506125fc816129a8565b5095945050505050565b600054610100900460ff1661262d5760405162461bcd60e51b8152600401610871906132d0565b8151612640906068906020850190612b5e565b508051610771906069906020840190612b5e565b600054610100900460ff1661267b5760405162461bcd60e51b8152600401610871906132d0565b610db933611fe7565b60cf5460ff16156126e85760405162461bcd60e51b815260206004820152602860248201527f4261636b6564546f6b656e3a20746f6b656e207472616e73666572207768696c60448201526719481c185d5cd95960c21b6064820152608401610871565b6001600160a01b0383161580159061270857506001600160a01b03821615155b156107715760cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d90612741908690600401612bf7565b60206040518083038186803b15801561275957600080fd5b505afa15801561276d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127919190613173565b156127e85760405162461bcd60e51b815260206004820152602160248201527f4261636b6564546f6b656e3a2073656e6465722069732073616e6374696f6e656044820152601960fa1b6064820152608401610871565b60cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d9061281c908590600401612bf7565b60206040518083038186803b15801561283457600080fd5b505afa158015612848573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286c9190613173565b156107715760405162461bcd60e51b815260206004820152602360248201527f4261636b6564546f6b656e3a2072656365697665722069732073616e6374696f6044820152621b995960ea1b6064820152608401610871565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156128f2575060009050600361299f565b8460ff16601b1415801561290a57508460ff16601c14155b1561291b575060009050600461299f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561296f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129985760006001925092505061299f565b9150600090505b94509492505050565b60008160048111156129bc576129bc61331b565b14156129c55750565b60018160048111156129d9576129d961331b565b1415612a225760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610871565b6002816004811115612a3657612a3661331b565b1415612a845760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610871565b6003816004811115612a9857612a9861331b565b1415612af15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610871565b6004816004811115612b0557612b0561331b565b1415610e0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610871565b828054612b6a9061302b565b90600052602060002090601f016020900481019282612b8c5760008555612bd2565b82601f10612ba557805160ff1916838001178555612bd2565b82800160010185558215612bd2579182015b82811115612bd2578251825591602001919060010190612bb7565b50612bde929150612be2565b5090565b5b80821115612bde5760008155600101612be3565b6001600160a01b0391909116815260200190565b600080600060608486031215612c2057600080fd5b505081359360208301359350604090920135919050565b600060208083528351808285015260005b81811015612c6457858101830151858201604001528201612c48565b81811115612c76576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114612ca357600080fd5b919050565b60008060408385031215612cbb57600080fd5b612cc483612c8c565b946020939093013593505050565b600060208284031215612ce457600080fd5b5035919050565b600080600060608486031215612d0057600080fd5b612d0984612c8c565b9250612d1760208501612c8c565b9150604084013590509250925092565b600060208284031215612d3957600080fd5b610b6b82612c8c565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612d6957600080fd5b81356001600160401b0380821115612d8357612d83612d42565b604051601f8301601f19908116603f01168101908282118183101715612dab57612dab612d42565b81604052838152866020858801011115612dc457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612df757600080fd5b82356001600160401b0380821115612e0e57600080fd5b612e1a86838701612d58565b93506020850135915080821115612e3057600080fd5b50612e3d85828601612d58565b9150509250929050565b600080600080600060a08688031215612e5f57600080fd5b85356001600160401b0380821115612e7657600080fd5b612e8289838a01612d58565b96506020880135915080821115612e9857600080fd5b50612ea588828901612d58565b959895975050505060408401359360608101359360809091013592509050565b600060208284031215612ed757600080fd5b81356001600160401b03811115612eed57600080fd5b612ef984828501612d58565b949350505050565b8015158114610e0f57600080fd5b600060208284031215612f2157600080fd5b8135610b6b81612f01565b60008060408385031215612f3f57600080fd5b50508035926020909101359150565b600080600080600080600060e0888a031215612f6957600080fd5b612f7288612c8c565b9650612f8060208901612c8c565b95506040880135945060608801359350608088013560ff81168114612fa457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612fd457600080fd5b612fdd83612c8c565b91506020830135612fed81612f01565b809150509250929050565b6000806040838503121561300b57600080fd5b61301483612c8c565b915061302260208401612c8c565b90509250929050565b600181811c9082168061303f57607f821691505b6020821081141561306057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156130cb576130cb61309b565b500290565b600082198211156130e3576130e361309b565b500190565b6000828210156130fa576130fa61309b565b500390565b60008261311c57634e487b7160e01b600052601260045260246000fd5b500490565b60006000198214156131355761313561309b565b5060010190565b6020808252601d908201527f496e76616c6964206c6173742074696d6520666565206170706c696564000000604082015260600190565b60006020828403121561318557600080fd5b8151610b6b81612f01565b60208082526024908201527f4261636b6564546f6b656e3a204f6e6c79206d756c7469706c6965722075706460408201526330ba32b960e11b606082015260800190565b6020808252602f908201527f4261636b6564546f6b656e3a204d756c7469706c696572206368616e6765642060408201526e696e20746865206d65616e74696d6560881b606082015260800190565b60208082526022908201527f4261636b6564546f6b656e3a20556e617574686f72697a65642064656c656761604082015261746560f01b606082015260800190565b6020808252601d908201527f45524332305065726d69743a206578706972656420646561646c696e65000000604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fdfe68747470733a2f2f7777772e6261636b65646173736574732e66692f6c6567616c2d646f63756d656e746174696f6e9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb4eba51a08f56c21035fcbda11b779f91748d3ae295b24c3e032d1eeff84edc2e9e94967fdaa8d9ec120d5cd909b051117451405dec84a6cd95bb12f2eb37bf75ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9a26469706673582212200b2e900b56c826b7237e724042c1e9120ba936c68dce131a2f8145348b2ebc3464736f6c6343000809003368747470733a2f2f7777772e6261636b65646173736574732e66692f6c6567616c2d646f63756d656e746174696f6e
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102cf5760003560e01c80637f120587116101845780637f120587146105415780638da5cb5b146105565780638fcb4e5b1461055e578063944b511c1461057157806395d89b41146105845780639dc29fac1461058c5780639fd0506d1461059f578063a15f84da146105b2578063a457c2d7146105c5578063a879a9db146105d8578063a9059cbb146105eb578063a996d6ce146105fe578063aea77ac314610611578063b187bd2614610624578063b6ca6e1214610631578063bedb86fb14610644578063d2ca211514610657578063d502562514610661578063d505accf14610669578063d904be121461067c578063dd62ed3e1461068f578063deeb8bfd146106a2578063ec571c6a146106b7578063f00c1dff146106cf578063f2fde38b146106d9578063f5eb42dc146106ec578063f5f68898146106ff578063f9e4789614610712578063fca3b5aa1461071c578063ff29130c1461072f578063ffa1ad741461074257600080fd5b80630194b09b146102d457806305602501146102fe57806306fdde03146103135780630754617214610328578063095ea7b31461033b57806318160ddd1461035e5780631b3ed722146103745780631c5633d71461037e57806323b872dd1461039157806327810b6e146103a45780632b63c300146103b75780632cc5ecd5146103da5780632d88af4a146103fd57806330adf81f14610410578063313ce567146104255780633644e51514610434578063395093511461043d5780633dfa34cd1461045057806340c10f191461045a578063430c777c1461046d57806344acb51b1461048057806349dc5e8d146104935780634cd88b76146104a65780635add8efc146104b95780635c575ef3146104cc57806370a08231146104e0578063715018a6146104f35780637544e6b3146104fb57806378f86afc1461050e5780637ecebe0014610521575b600080fd5b610102546102e8906001600160a01b031681565b6040516102f59190612bf7565b60405180910390f35b61031161030c366004612c0b565b610766565b005b61031b610776565b6040516102f59190612c37565b60cb546102e8906001600160a01b031681565b61034e610349366004612ca8565b610808565b60405190151581526020016102f5565b610366610820565b6040519081526020016102f5565b6103666101065481565b61031161038c366004612cd2565b610842565b61034e61039f366004612ceb565b6108cb565b60cc546102e8906001600160a01b031681565b6103bf6108ef565b604080519384526020840192909252908201526060016102f5565b61034e6103e8366004612d27565b60ce6020526000908152604090205460ff1681565b61031161040b366004612d27565b610991565b6103666000805160206133e183398151915281565b604051601281526020016102f5565b61036660985481565b61034e61044b366004612ca8565b610a0a565b6103666101035481565b610311610468366004612ca8565b610a49565b61031161047b366004612cd2565b610ab5565b61036661048e366004612cd2565b610b52565b6103116104a1366004612d27565b610b72565b6103116104b4366004612de4565b610cc6565b6103116104c7366004612cd2565b610cdf565b60cd5461034e90600160a01b900460ff1681565b6103666104ee366004612d27565b610d5f565b610311610d80565b610311610509366004612e47565b610dbb565b61031161051c366004612ec5565b610dd7565b61036661052f366004612d27565b60976020526000908152604090205481565b61036660008051602061338183398151915281565b6102e8610e12565b61034e61056c366004612ca8565b610e21565b61036661057f366004612cd2565b610e99565b61031b610eb2565b61031161059a366004612ca8565b610ec1565b60cd546102e8906001600160a01b031681565b6103116105c0366004612f0f565b610f94565b61034e6105d3366004612ca8565b61101b565b6103116105e6366004612f2c565b6110ad565b61034e6105f9366004612ca8565b61116d565b61031161060c366004612d27565b61117b565b61031161061f366004612f4e565b6111f4565b60cf5461034e9060ff1681565b61031161063f366004612fc1565b61124f565b610311610652366004612f0f565b6112dd565b6103666101055481565b61031b61137c565b610311610677366004612f4e565b61140a565b61031161068a366004612c0b565b61145c565b61036661069d366004612ff8565b611575565b6103666000805160206133a183398151915281565b60cf546102e89061010090046001600160a01b031681565b6103666101045481565b6103116106e7366004612d27565b6115a0565b6103666106fa366004612d27565b61163d565b61031161070d366004612d27565b611659565b6103666101095481565b61031161072a366004612d27565b6116d3565b61031161073d366004612f4e565b61174c565b61031b604051806040016040528060058152602001640312e312e360dc1b81525081565b610771838383611981565b505050565b6060606880546107859061302b565b80601f01602080910402602001604051908101604052809291908181526020018280546107b19061302b565b80156107fe5780601f106107d3576101008083540402835291602001916107fe565b820191906000526020600020905b8154815290600101906020018083116107e157829003601f168201915b5050505050905090565b600033610816818585611a30565b5060019392505050565b60008061082b6108ef565b5050905061083c6101085482611b54565b91505090565b3361084b610e12565b6001600160a01b03161461087a5760405162461bcd60e51b815260040161087190613066565b60405180910390fd5b60008060006108876108ef565b925092509250816101055461089c91906130b1565b610103546108aa91906130d0565b610103556101065483146108c2576108c28382611b73565b50505061010555565b6000336108d9858285611bb6565b6108e4858585611c9d565b506001949350505050565b600080600061010554610103544261090791906130e8565b61091191906130ff565b9150610106549250610109549050600061010454111561098c5760005b8281101561097e57670de0b6b3a764000061010454670de0b6b3a764000061095691906130e8565b61096090866130b1565b61096a91906130ff565b93508061097681613121565b91505061092e565b5061098982826130d0565b90505b909192565b3361099a610e12565b6001600160a01b0316146109c05760405162461bcd60e51b815260040161087190613066565b60cd80546001600160a01b0319166001600160a01b0383169081179091556040517f4f68150eb56c53cc9373649e35bc37dd235a0c86e10aa23b8a835378136ac6a090600090a250565b3360008181526066602090815260408083206001600160a01b03871684529091528120549091906108169082908690610a449087906130d0565b611a30565b60cb546001600160a01b0316336001600160a01b031614610aa75760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c9036b4b73a32b960411b6044820152606401610871565b610ab18282611eb6565b5050565b33610abe610e12565b6001600160a01b031614610ae45760405162461bcd60e51b815260040161087190613066565b6000806000610af16108ef565b9250925092508161010554610b0691906130b1565b61010354610b1491906130d0565b61010355610106548314610b2c57610b2c8382611b73565b83610b495760405162461bcd60e51b81526004016108719061313c565b50505061010355565b600080610b5d6108ef565b50509050610b6b8382611fd2565b9392505050565b33610b7b610e12565b6001600160a01b031614610ba15760405162461bcd60e51b815260040161087190613066565b60405163df592f7d60e01b81526001600160a01b0382169063df592f7d90610bcd903090600401612bf7565b60206040518083038186803b158015610be557600080fd5b505afa158015610bf9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1d9190613173565b15610c745760405162461bcd60e51b815260206004820152602160248201527f4261636b6564546f6b656e3a2057726f6e67204c69737420696e7465726661636044820152606560f81b6064820152608401610871565b60cf8054610100600160a81b0319166101006001600160a01b038416908102919091179091556040517feff538eaa91b9b5384df4354f3841681487784258ac4b209182aef0755f9e0be90600090a250565b610cd08282611879565b610ab162015180426000611981565b33610ce8610e12565b6001600160a01b031614610d0e5760405162461bcd60e51b815260040161087190613066565b6000806000610d1b6108ef565b9250925092508161010554610d3091906130b1565b61010354610d3e91906130d0565b61010355610106548314610d5657610d568382611b73565b50505061010455565b600080610d6a6108ef565b50509050610b6b610d7a8461163d565b82611b54565b33610d89610e12565b6001600160a01b031614610daf5760405162461bcd60e51b815260040161087190613066565b610db96000611fe7565b565b610dc58585611879565b610dd0838383611981565b5050505050565b33610de0610e12565b6001600160a01b031614610e065760405162461bcd60e51b815260040161087190613066565b610e0f81612039565b50565b6033546001600160a01b031690565b600080600080610e2f6108ef565b9250925092508161010554610e4491906130b1565b61010354610e5291906130d0565b61010355610106548314610e6a57610e6a8382611b73565b60003390506000610e7e8761010654611b54565b9050610e8b828983611c9d565b506001979650505050505050565b600080610ea46108ef565b50509050610b6b8382611b54565b6060606980546107859061302b565b60cc546001600160a01b0316336001600160a01b031614610f1f5760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c90313ab93732b960411b6044820152606401610871565b6001600160a01b038216331480610f3e57506001600160a01b03821630145b610f8a5760405162461bcd60e51b815260206004820181905260248201527f4261636b6564546f6b656e3a2043616e6e6f74206275726e206163636f756e746044820152606401610871565b610ab1828261207c565b33610f9d610e12565b6001600160a01b031614610fc35760405162461bcd60e51b815260040161087190613066565b60cd8054821515600160a01b0260ff60a01b199091161790556040517f238422c0d720060023911dceeb8ba506952801637ad007844edcd4416364fecf9061101090831515815260200190565b60405180910390a150565b3360008181526066602090815260408083206001600160a01b0387168452909152812054909190838110156110a05760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610871565b6108e48286868403611a30565b610102546001600160a01b0316336001600160a01b0316146110e15760405162461bcd60e51b815260040161087190613190565b60008060006110ee6108ef565b925092509250816101055461110391906130b1565b6101035461111191906130d0565b61010355610106548314611129576111298382611b73565b8380610106541461114c5760405162461bcd60e51b8152600401610871906131d4565b6111658661010954600161116091906130d0565b611b73565b505050505050565b600033610816818585611c9d565b33611184610e12565b6001600160a01b0316146111aa5760405162461bcd60e51b815260040161087190613066565b60cc80546001600160a01b0319166001600160a01b0383169081179091556040517f5bb1db06eeb30d85c1e53ae2285b460ce83e4318c623bd1ca51df912f64c45a490600090a250565b60cd54600160a01b900460ff168061121b575033600090815260ce602052604090205460ff165b6112375760405162461bcd60e51b815260040161087190613223565b6112468787878787878761220a565b50505050505050565b33611258610e12565b6001600160a01b03161461127e5760405162461bcd60e51b815260040161087190613066565b6001600160a01b038216600081815260ce6020908152604091829020805460ff191685151590811790915591519182527f7459b9d2544fdaf790226b129ff473f8c8ce56bfc10bc3bdbe1c71b9d426a546910160405180910390a25050565b60cd546001600160a01b0316336001600160a01b03161461133b5760405162461bcd60e51b81526020600482015260186024820152772130b1b5b2b22a37b5b2b71d1027b7363c903830bab9b2b960411b6044820152606401610871565b60cf805460ff19168215159081179091556040519081527fb9bcdd890b4d4c213bab99cf96dc1adb9ede36bb2a54610c91a86de844b05fb890602001611010565b60d080546113899061302b565b80601f01602080910402602001604051908101604052809291908181526020018280546113b59061302b565b80156114025780601f106113d757610100808354040283529160200191611402565b820191906000526020600020905b8154815290600101906020018083116113e557829003601f168201915b505050505081565b60cd54600160a01b900460ff1680611431575033600090815260ce602052604090205460ff165b61144d5760405162461bcd60e51b815260040161087190613223565b6112468787878787878761228d565b610102546001600160a01b0316336001600160a01b0316146114905760405162461bcd60e51b815260040161087190613190565b600080600061149d6108ef565b92509250925081610105546114b291906130b1565b610103546114c091906130d0565b610103556101065483146114d8576114d88382611b73565b848061010654146114fb5760405162461bcd60e51b8152600401610871906131d4565b848061010954106115615760405162461bcd60e51b815260206004820152602a60248201527f4261636b6564546f6b656e3a204d756c7469706c696572206e6f6e63652069736044820152691037baba3230ba32b21760b11b6064820152608401610871565b61156b8887611b73565b5050505050505050565b6001600160a01b03918216600090815260666020908152604080832093909416825291909152205490565b336115a9610e12565b6001600160a01b0316146115cf5760405162461bcd60e51b815260040161087190613066565b6001600160a01b0381166116345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610871565b610e0f81611fe7565b6001600160a01b03166000908152610107602052604090205490565b33611662610e12565b6001600160a01b0316146116885760405162461bcd60e51b815260040161087190613066565b61010280546001600160a01b0319166001600160a01b0383169081179091556040517f352ee13cfd2e4909f0a0c7b78a6079921377f6377d8af594509ff9aaf4f925da90600090a250565b336116dc610e12565b6001600160a01b0316146117025760405162461bcd60e51b815260040161087190613066565b60cb80546001600160a01b0319166001600160a01b0383169081179091556040517f6adffd5c93085d835dac6f3b40adf7c242ca4b3284048d20c3d8a501748dc97390600090a250565b60cd54600160a01b900460ff1680611773575033600090815260ce602052604090205460ff165b61178f5760405162461bcd60e51b815260040161087190613223565b600080600061179c6108ef565b92509250925081610105546117b191906130b1565b610103546117bf91906130d0565b610103556101065483146117d7576117d78382611b73565b864211156117f75760405162461bcd60e51b815260040161087190613265565b60006000805160206133a18339815191528b8b8b6118148f612310565b8c60405160200161182a9695949392919061329c565b60405160208183030381529060405280519060200120905061184f8b82898989612341565b600061185e8a61010654611b54565b905061186b8c8c83611c9d565b505050505050505050505050565b600054610100900460ff166118945760005460ff161561189c565b61189c6123fd565b6118ff5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610871565b600054610100900460ff16158015611921576000805461ffff19166101011790555b61192b838361240e565b61193361243f565b61193b61246e565b61195c6040518060600160405280602f8152602001613332602f9139612039565b8015610771576000805461ff0019169055505050565b6001600160a01b03163b151590565b61010354156119ef5760405162461bcd60e51b815260206004820152603460248201527f4261636b65644175746f466565546f6b656e496d706c656d656e746174696f6e60448201527308185b1c9958591e481a5b9a5d1a585b1a5e995960621b6064820152608401610871565b81611a0c5760405162461bcd60e51b81526004016108719061313c565b670de0b6b3a764000061010655600061010955610105929092556101035561010455565b6001600160a01b038316611a925760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610871565b6001600160a01b038216611af35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610871565b6001600160a01b0383811660008181526066602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000670de0b6b3a7640000611b6983856130b1565b610b6b91906130ff565b6101068290556101098190556040518281527f4dbe4840d7465bd162f67814cea0b519567a2e0e578bcde61e7f4ced361e5a3d9060200160405180910390a15050565b60cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d90611bea908590600401612bf7565b60206040518083038186803b158015611c0257600080fd5b505afa158015611c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3a9190613173565b15611c925760405162461bcd60e51b815260206004820152602260248201527f4261636b6564546f6b656e3a207370656e6465722069732073616e6374696f6e604482015261195960f21b6064820152608401610871565b610771838383612517565b6001600160a01b038316611d015760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610871565b6001600160a01b038216611d635760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610871565b611d6e83838361258b565b6000611d7d8261010654611fd2565b6001600160a01b0385166000908152610107602052604090205490915081811015611df95760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610871565b6001600160a01b0380861660009081526101076020526040808220858503905591861681522054611e2b9083906130d0565b6001600160a01b038086166000818152610107602052604090819020939093559151908716906000805160206133c183398151915290611e6e9087815260200190565b60405180910390a3836001600160a01b0316856001600160a01b031660008051602061336183398151915284604051611ea991815260200190565b60405180910390a3610dd0565b6001600160a01b038216611f0c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610871565b611f186000838361258b565b6000611f278261010654611fd2565b9050806101086000828254611f3c91906130d0565b90915550506001600160a01b0383166000908152610107602052604081208054839290611f6a9084906130d0565b90915550506040518281526001600160a01b038416906000906000805160206133c18339815191529060200160405180910390a36040518181526001600160a01b038416906000906000805160206133618339815191529060200160405180910390a3505050565b600081611b6984670de0b6b3a76400006130b1565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b805161204c9060d0906020840190612b5e565b507f9c1e1a17a78053ad78b3801837ad5e515d429987252f2e1371b7b50fa8ff8bec816040516110109190612c37565b6001600160a01b0382166120dc5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610871565b6120e88260008361258b565b60006120f78261010654611fd2565b6001600160a01b038416600090815261010760205260409020549091508181101561216f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610871565b6001600160a01b038416600090815261010760205260408120838303905561010880548492906121a09084906130e8565b90915550506040518381526000906001600160a01b038616906000805160206133c18339815191529060200160405180910390a36040518281526000906001600160a01b038616906000805160206133618339815191529060200160405180910390a35b50505050565b8342111561222a5760405162461bcd60e51b815260040161087190613265565b60006000805160206133818339815191528888886122478c612310565b8960405160200161225d9695949392919061329c565b6040516020818303038152906040528051906020012090506122828882868686612341565b61156b888888611c9d565b834211156122ad5760405162461bcd60e51b815260040161087190613265565b60006000805160206133e18339815191528888886122ca8c612310565b896040516020016122e09695949392919061329c565b6040516020818303038152906040528051906020012090506123058882868686612341565b61156b888888611a30565b6001600160a01b038116600090815260976020526040812080549182919061233783613121565b9190505550919050565b600061238a6098548660405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b9050600061239a828686866125de565b9050866001600160a01b0316816001600160a01b0316146112465760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610871565b600061240830611972565b15905090565b600054610100900460ff166124355760405162461bcd60e51b8152600401610871906132d0565b610ab18282612606565b600054610100900460ff166124665760405162461bcd60e51b8152600401610871906132d0565b610db9612654565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f612497610776565b805160209182012060408051808201825260018152603160f81b90840152805192830193909352918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f198184030181529190528051602090910120609855565b60006125238484611575565b90506000198114612204578181101561257e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610871565b6122048484848403611a30565b60008060006125986108ef565b92509250925081610105546125ad91906130b1565b610103546125bb91906130d0565b610103556101065483146125d3576125d38382611b73565b611165868686612684565b60008060006125ef878787876128c5565b915091506125fc816129a8565b5095945050505050565b600054610100900460ff1661262d5760405162461bcd60e51b8152600401610871906132d0565b8151612640906068906020850190612b5e565b508051610771906069906020840190612b5e565b600054610100900460ff1661267b5760405162461bcd60e51b8152600401610871906132d0565b610db933611fe7565b60cf5460ff16156126e85760405162461bcd60e51b815260206004820152602860248201527f4261636b6564546f6b656e3a20746f6b656e207472616e73666572207768696c60448201526719481c185d5cd95960c21b6064820152608401610871565b6001600160a01b0383161580159061270857506001600160a01b03821615155b156107715760cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d90612741908690600401612bf7565b60206040518083038186803b15801561275957600080fd5b505afa15801561276d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127919190613173565b156127e85760405162461bcd60e51b815260206004820152602160248201527f4261636b6564546f6b656e3a2073656e6465722069732073616e6374696f6e656044820152601960fa1b6064820152608401610871565b60cf5460405163df592f7d60e01b81526101009091046001600160a01b03169063df592f7d9061281c908590600401612bf7565b60206040518083038186803b15801561283457600080fd5b505afa158015612848573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061286c9190613173565b156107715760405162461bcd60e51b815260206004820152602360248201527f4261636b6564546f6b656e3a2072656365697665722069732073616e6374696f6044820152621b995960ea1b6064820152608401610871565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b038311156128f2575060009050600361299f565b8460ff16601b1415801561290a57508460ff16601c14155b1561291b575060009050600461299f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561296f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129985760006001925092505061299f565b9150600090505b94509492505050565b60008160048111156129bc576129bc61331b565b14156129c55750565b60018160048111156129d9576129d961331b565b1415612a225760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610871565b6002816004811115612a3657612a3661331b565b1415612a845760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610871565b6003816004811115612a9857612a9861331b565b1415612af15760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610871565b6004816004811115612b0557612b0561331b565b1415610e0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610871565b828054612b6a9061302b565b90600052602060002090601f016020900481019282612b8c5760008555612bd2565b82601f10612ba557805160ff1916838001178555612bd2565b82800160010185558215612bd2579182015b82811115612bd2578251825591602001919060010190612bb7565b50612bde929150612be2565b5090565b5b80821115612bde5760008155600101612be3565b6001600160a01b0391909116815260200190565b600080600060608486031215612c2057600080fd5b505081359360208301359350604090920135919050565b600060208083528351808285015260005b81811015612c6457858101830151858201604001528201612c48565b81811115612c76576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114612ca357600080fd5b919050565b60008060408385031215612cbb57600080fd5b612cc483612c8c565b946020939093013593505050565b600060208284031215612ce457600080fd5b5035919050565b600080600060608486031215612d0057600080fd5b612d0984612c8c565b9250612d1760208501612c8c565b9150604084013590509250925092565b600060208284031215612d3957600080fd5b610b6b82612c8c565b634e487b7160e01b600052604160045260246000fd5b600082601f830112612d6957600080fd5b81356001600160401b0380821115612d8357612d83612d42565b604051601f8301601f19908116603f01168101908282118183101715612dab57612dab612d42565b81604052838152866020858801011115612dc457600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060408385031215612df757600080fd5b82356001600160401b0380821115612e0e57600080fd5b612e1a86838701612d58565b93506020850135915080821115612e3057600080fd5b50612e3d85828601612d58565b9150509250929050565b600080600080600060a08688031215612e5f57600080fd5b85356001600160401b0380821115612e7657600080fd5b612e8289838a01612d58565b96506020880135915080821115612e9857600080fd5b50612ea588828901612d58565b959895975050505060408401359360608101359360809091013592509050565b600060208284031215612ed757600080fd5b81356001600160401b03811115612eed57600080fd5b612ef984828501612d58565b949350505050565b8015158114610e0f57600080fd5b600060208284031215612f2157600080fd5b8135610b6b81612f01565b60008060408385031215612f3f57600080fd5b50508035926020909101359150565b600080600080600080600060e0888a031215612f6957600080fd5b612f7288612c8c565b9650612f8060208901612c8c565b95506040880135945060608801359350608088013560ff81168114612fa457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215612fd457600080fd5b612fdd83612c8c565b91506020830135612fed81612f01565b809150509250929050565b6000806040838503121561300b57600080fd5b61301483612c8c565b915061302260208401612c8c565b90509250929050565b600181811c9082168061303f57607f821691505b6020821081141561306057634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156130cb576130cb61309b565b500290565b600082198211156130e3576130e361309b565b500190565b6000828210156130fa576130fa61309b565b500390565b60008261311c57634e487b7160e01b600052601260045260246000fd5b500490565b60006000198214156131355761313561309b565b5060010190565b6020808252601d908201527f496e76616c6964206c6173742074696d6520666565206170706c696564000000604082015260600190565b60006020828403121561318557600080fd5b8151610b6b81612f01565b60208082526024908201527f4261636b6564546f6b656e3a204f6e6c79206d756c7469706c6965722075706460408201526330ba32b960e11b606082015260800190565b6020808252602f908201527f4261636b6564546f6b656e3a204d756c7469706c696572206368616e6765642060408201526e696e20746865206d65616e74696d6560881b606082015260800190565b60208082526022908201527f4261636b6564546f6b656e3a20556e617574686f72697a65642064656c656761604082015261746560f01b606082015260800190565b6020808252601d908201527f45524332305065726d69743a206578706972656420646561646c696e65000000604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fdfe68747470733a2f2f7777772e6261636b65646173736574732e66692f6c6567616c2d646f63756d656e746174696f6e9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb4eba51a08f56c21035fcbda11b779f91748d3ae295b24c3e032d1eeff84edc2e9e94967fdaa8d9ec120d5cd909b051117451405dec84a6cd95bb12f2eb37bf75ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9a26469706673582212200b2e900b56c826b7237e724042c1e9120ba936c68dce131a2f8145348b2ebc3464736f6c63430008090033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.