Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- FakeERC20
- Optimization enabled
- true
- Compiler version
- v0.8.23+commit.f704f362
- Optimization runs
- 200
- EVM Version
- london
- Verified at
- 2024-06-12T16:15:30.979950Z
Constructor Arguments
0x000000000000000000000000183faff6997c98a812a3b98748fc80241d08f3120000000000000000000000005a11fa259c898e6973db2f3c9e82339a53c777c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c5465737420555344436f696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000087465737455534443000000000000000000000000000000000000000000000000
Arg [0] (address) : 0x183faff6997c98a812a3b98748fc80241d08f312
Arg [1] (address) : 0x5a11fa259c898e6973db2f3c9e82339a53c777c0
Arg [2] (string) : Test USDCoin
Arg [3] (string) : testUSDC
Arg [4] (uint8) : 6
contracts/fasset/mock/FakeERC20.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; import "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../../governance/implementation/Governed.sol"; contract FakeERC20 is ERC20, Governed, IERC165 { uint8 private immutable decimals_; constructor( IGovernanceSettings _governanceSettings, address _initialGovernance, string memory _name, string memory _symbol, uint8 _decimals ) ERC20(_name, _symbol) Governed(_governanceSettings, _initialGovernance) { decimals_ = _decimals; } function mintAmount(address _target, uint256 amount) public onlyGovernance { _mint(_target, amount); } function burnAmount(uint256 _amount) public { _burn(msg.sender, _amount); } function decimals() public view override returns (uint8) { return decimals_; } /** * Implementation of ERC-165 interface. */ function supportsInterface(bytes4 _interfaceId) external pure override returns (bool) { return _interfaceId == type(IERC165).interfaceId || _interfaceId == type(IERC20).interfaceId || _interfaceId == type(IERC20Metadata).interfaceId; } }
@openzeppelin/contracts/token/ERC20/ERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the default value returned by this function, unless * it's overridden. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `from` to `to`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer(address from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by // decrementing then incrementing. _balances[to] += amount; } emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; unchecked { // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above. _balances[account] += amount; } emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; // Overflow not possible: amount <= accountBalance <= totalSupply. _totalSupply -= amount; } emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance(address owner, address spender, uint256 amount) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {} }
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
@openzeppelin/contracts/utils/Context.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
@openzeppelin/contracts/utils/introspection/IERC165.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
contracts/governance/implementation/Governed.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; import { GovernedBase } from "./GovernedBase.sol"; import { IGovernanceSettings } from "flare-smart-contracts/contracts/userInterfaces/IGovernanceSettings.sol"; /** * @title Governed * @dev For deployed, governed contracts, enforce non-zero addresses at create time. **/ abstract contract Governed is GovernedBase { constructor(IGovernanceSettings _governanceSettings, address _initialGovernance) { initialise(_governanceSettings, _initialGovernance); } }
contracts/governance/implementation/GovernedBase.sol
// SPDX-License-Identifier: MIT pragma solidity 0.8.23; import "flare-smart-contracts/contracts/userInterfaces/IGovernanceSettings.sol"; import "../interfaces/IGoverned.sol"; /** * @title Governed Base * @notice This abstract base class defines behaviors for a governed contract. * @dev This class is abstract so that specific behaviors can be defined for the constructor. * Contracts should not be left ungoverned, but not all contract will have a constructor * (for example those pre-defined in genesis). * @dev This version is compatible with both Flare (where governance settings is in genesis at the address * 0x1000000000000000000000000000000000000007) and Songbird (where governance settings is a deployed contract). * @dev It also uses diamond storage for state, so it is safer tp use in diamond structures or proxies. **/ abstract contract GovernedBase is IGoverned { struct GovernedState { IGovernanceSettings governanceSettings; bool initialised; bool productionMode; bool executing; address initialGovernance; mapping(bytes32 encodedCallHash => uint256 allowedAfterTimestamp) timelockedCalls; } modifier onlyGovernance { if (_timeToExecute()) { _beforeExecute(); _; } else { _recordTimelockedCall(msg.data, 0); } } modifier onlyGovernanceWithTimelockAtLeast(uint256 _minimumTimelock) { if (_timeToExecute()) { _beforeExecute(); _; } else { _recordTimelockedCall(msg.data, _minimumTimelock); } } modifier onlyImmediateGovernance { _checkOnlyGovernance(); _; } constructor() { } /** * @notice Execute the timelocked governance calls once the timelock period expires. * @dev Only executor can call this method. * @param _encodedCall ABI encoded call data (signature and parameters). */ function executeGovernanceCall(bytes calldata _encodedCall) external override { GovernedState storage state = _governedState(); require(isExecutor(msg.sender), "only executor"); bytes32 encodedCallHash = keccak256(_encodedCall); uint256 allowedAfterTimestamp = state.timelockedCalls[encodedCallHash]; require(allowedAfterTimestamp != 0, "timelock: invalid selector"); require(block.timestamp >= allowedAfterTimestamp, "timelock: not allowed yet"); delete state.timelockedCalls[encodedCallHash]; state.executing = true; //solhint-disable-next-line avoid-low-level-calls (bool success,) = address(this).call(_encodedCall); state.executing = false; emit TimelockedGovernanceCallExecuted(encodedCallHash); _passReturnOrRevert(success); } /** * Cancel a timelocked governance call before it has been executed. * @dev Only governance can call this method. * @param _encodedCall ABI encoded call data (signature and parameters). */ function cancelGovernanceCall(bytes calldata _encodedCall) external override onlyImmediateGovernance { GovernedState storage state = _governedState(); bytes32 encodedCallHash = keccak256(_encodedCall); require(state.timelockedCalls[encodedCallHash] != 0, "timelock: invalid selector"); emit TimelockedGovernanceCallCanceled(encodedCallHash); delete state.timelockedCalls[encodedCallHash]; } /** * Enter the production mode after all the initial governance settings have been set. * This enables timelocks and the governance is afterwards obtained by calling * governanceSettings.getGovernanceAddress(). */ function switchToProductionMode() external onlyImmediateGovernance { GovernedState storage state = _governedState(); require(!state.productionMode, "already in production mode"); state.initialGovernance = address(0); state.productionMode = true; emit GovernedProductionModeEntered(address(state.governanceSettings)); } /** * @notice Initialize the governance address if not first initialized. */ function initialise(IGovernanceSettings _governanceSettings, address _initialGovernance) public virtual { GovernedState storage state = _governedState(); require(state.initialised == false, "initialised != false"); require(address(_governanceSettings) != address(0), "governance settings zero"); require(_initialGovernance != address(0), "_governance zero"); state.initialised = true; state.governanceSettings = _governanceSettings; state.initialGovernance = _initialGovernance; emit GovernanceInitialised(_initialGovernance); } /** * Returns the governance settings contract address. */ function governanceSettings() public view returns (IGovernanceSettings) { return _governedState().governanceSettings; } /** * True after switching to production mode (see `switchToProductionMode()`). */ function productionMode() public view returns (bool) { return _governedState().productionMode; } /** * Returns the current effective governance address. */ function governance() public view returns (address) { GovernedState storage state = _governedState(); return state.productionMode ? state.governanceSettings.getGovernanceAddress() : state.initialGovernance; } /** * Check if an address is one of the executors defined in governanceSettings. */ function isExecutor(address _address) public view returns (bool) { GovernedState storage state = _governedState(); return state.initialised && state.governanceSettings.isExecutor(_address); } function _beforeExecute() private { GovernedState storage state = _governedState(); if (state.executing) { // can only be run from executeGovernanceCall(), where we check that only executor can call // make sure nothing else gets executed, even in case of reentrancy assert(msg.sender == address(this)); state.executing = false; } else { // must be called with: productionMode=false // must check governance in this case _checkOnlyGovernance(); } } function _recordTimelockedCall(bytes calldata _encodedCall, uint256 _minimumTimelock) private { GovernedState storage state = _governedState(); _checkOnlyGovernance(); bytes32 encodedCallHash = keccak256(_encodedCall); uint256 timelock = state.governanceSettings.getTimelock(); if (timelock < _minimumTimelock) { timelock = _minimumTimelock; } uint256 allowedAt = block.timestamp + timelock; state.timelockedCalls[encodedCallHash] = allowedAt; emit GovernanceCallTimelocked(_encodedCall, encodedCallHash, allowedAt); } function _timeToExecute() private view returns (bool) { GovernedState storage state = _governedState(); return state.executing || !state.productionMode; } function _checkOnlyGovernance() private view { require(msg.sender == governance(), "only governance"); } function _governedState() private pure returns (GovernedState storage _state) { bytes32 position = keccak256("fasset.GovernedBase.GovernedState"); // solhint-disable-next-line no-inline-assembly assembly { _state.slot := position } } function _passReturnOrRevert(bool _success) private pure { // pass exact return or revert data - needs to be done in assembly //solhint-disable-next-line no-inline-assembly assembly { let size := returndatasize() let ptr := mload(0x40) mstore(0x40, add(ptr, size)) returndatacopy(ptr, 0, size) if _success { return(ptr, size) } revert(ptr, size) } } }
contracts/governance/interfaces/IGoverned.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6 <0.9; import "flare-smart-contracts/contracts/userInterfaces/IGovernanceSettings.sol"; interface IGoverned { /** * Governance call was timelocked. It can be executed after `allowedAfterTimestamp` by one of the executors. * @param encodedCall ABI encoded call data, to be used in executeGovernanceCall * @param encodedCallHash keccak256 hash of the ABI encoded call data * @param allowedAfterTimestamp the earliest timestamp when the call can be executed */ event GovernanceCallTimelocked(bytes encodedCall, bytes32 encodedCallHash, uint256 allowedAfterTimestamp); /** * Previously timelocked governance call was executed. * @param encodedCallHash keccak256 hash of the ABI encoded call data * (same as `GovernanceCallTimelocked.encodedCallHash`) */ event TimelockedGovernanceCallExecuted(bytes32 encodedCallHash); /** * Previously timelocked governance call was canceled. * @param encodedCallHash keccak256 hash of the ABI encoded call data * (same as `GovernanceCallTimelocked.encodedCallHash`) */ event TimelockedGovernanceCallCanceled(bytes32 encodedCallHash); /** * Governed contract was initialised (not yet in production mode). * @param initialGovernance the governance address used until switch to production mode */ event GovernanceInitialised(address initialGovernance); /** * The governed contract has switched to production mode * Timelocks are now enabled and the governance address is `governanceSettings.getGovernanceAddress()`. * @param governanceSettings the system contract holding governance address, timelock and executors settings */ event GovernedProductionModeEntered(address governanceSettings); /** * @notice Execute the timelocked governance calls once the timelock period expires. * @dev Only executor can call this method. * @param _encodedCall ABI encoded call data (signature and parameters). * You should use `encodedCall` parameter from `GovernanceCallTimelocked` event. */ function executeGovernanceCall(bytes calldata _encodedCall) external; /** * Cancel a timelocked governance call before it has been executed. * @dev Only governance can call this method. * @param _encodedCall ABI encoded call data (signature and parameters). * You should use `encodedCall` parameter from `GovernanceCallTimelocked` event. */ function cancelGovernanceCall(bytes calldata _encodedCall) external; /** * Enter the production mode after all the initial governance settings have been set. * This enables timelocks and the governance is afterwards obtained by calling * `governanceSettings.getGovernanceAddress()`. */ function switchToProductionMode() external; /** * Returns the governance settings contract address. */ function governanceSettings() external view returns (IGovernanceSettings); /** * True after switching to production mode (see `switchToProductionMode()`). */ function productionMode() external view returns (bool); /** * Returns the current effective governance address. * Before switching to production, the effective governance is `initialGovernance`, * and afterwards it is `governanceSettings.getGovernanceAddress()`. */ function governance() external view returns (address); /** * Check if an address is one of the executors defined in `governanceSettings`. */ function isExecutor(address _address) external view returns (bool); }
flare-smart-contracts/contracts/userInterfaces/IGovernanceSettings.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.7.6 <0.9; /** * A special contract that holds Flare governance address. * This contract enables updating governance address and timelock only by hard forking the network, * meaning only by updating validator code. */ interface IGovernanceSettings { /** * Get the governance account address. * The governance address can only be changed by a hardfork. */ function getGovernanceAddress() external view returns (address); /** * Get the time in seconds that must pass between a governance call and execution. * The timelock value can only be changed by a hardfork. */ function getTimelock() external view returns (uint256); /** * Get the addresses of the accounts that are allowed to execute the timelocked governance calls * once the timelock period expires. * Executors can be changed without a hardfork, via a normal governance call. */ function getExecutors() external view returns (address[] memory); /** * Check whether an address is one of the executors. */ function isExecutor(address _address) external view returns (bool); }
Compiler Settings
{"outputSelection":{"*":{"*":["*"],"":["*"]}},"optimizer":{"runs":200,"enabled":true},"libraries":{},"evmVersion":"london"}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"},{"type":"string","name":"_name","internalType":"string"},{"type":"string","name":"_symbol","internalType":"string"},{"type":"uint8","name":"_decimals","internalType":"uint8"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceCallTimelocked","inputs":[{"type":"bytes","name":"encodedCall","internalType":"bytes","indexed":false},{"type":"bytes32","name":"encodedCallHash","internalType":"bytes32","indexed":false},{"type":"uint256","name":"allowedAfterTimestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"GovernanceInitialised","inputs":[{"type":"address","name":"initialGovernance","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"GovernedProductionModeEntered","inputs":[{"type":"address","name":"governanceSettings","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallCanceled","inputs":[{"type":"bytes32","name":"encodedCallHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"TimelockedGovernanceCallExecuted","inputs":[{"type":"bytes32","name":"encodedCallHash","internalType":"bytes32","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"burnAmount","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelGovernanceCall","inputs":[{"type":"bytes","name":"_encodedCall","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"decreaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"subtractedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeGovernanceCall","inputs":[{"type":"bytes","name":"_encodedCall","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"governance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IGovernanceSettings"}],"name":"governanceSettings","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"increaseAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"addedValue","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialise","inputs":[{"type":"address","name":"_governanceSettings","internalType":"contract IGovernanceSettings"},{"type":"address","name":"_initialGovernance","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isExecutor","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintAmount","inputs":[{"type":"address","name":"_target","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"productionMode","inputs":[]},{"type":"function","stateMutability":"pure","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"_interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"switchToProductionMode","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]}]
Contract Creation Code
0x60a06040523480156200001157600080fd5b5060405162001b8938038062001b898339810160408190526200003491620002f7565b84848484600362000046838262000439565b50600462000055828262000439565b5050506200006a82826200007d60201b60201c565b505060ff16608052506200050592505050565b7f2aa47ee5db910f3b2a06970c443249cc77dbd9f96100cfebc1775ab7fb1d18248054600160a01b900460ff1615620000fd5760405162461bcd60e51b815260206004820152601460248201527f696e697469616c6973656420213d2066616c736500000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038316620001555760405162461bcd60e51b815260206004820152601860248201527f676f7665726e616e63652073657474696e6773207a65726f00000000000000006044820152606401620000f4565b6001600160a01b038216620001a05760405162461bcd60e51b815260206004820152601060248201526f5f676f7665726e616e6365207a65726f60801b6044820152606401620000f4565b80546001600160a01b038481166001600160a81b031990921691909117600160a01b1782556001820180549184166001600160a01b0319909216821790556040519081527f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db9060200160405180910390a1505050565b6001600160a01b03811681146200022c57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200025757600080fd5b81516001600160401b03808211156200027457620002746200022f565b604051601f8301601f19908116603f011681019082821181831017156200029f576200029f6200022f565b8160405283815260209250866020858801011115620002bd57600080fd5b600091505b83821015620002e15785820183015181830184015290820190620002c2565b6000602085830101528094505050505092915050565b600080600080600060a086880312156200031057600080fd5b85516200031d8162000216565b6020870151909550620003308162000216565b60408701519094506001600160401b03808211156200034e57600080fd5b6200035c89838a0162000245565b945060608801519150808211156200037357600080fd5b50620003828882890162000245565b925050608086015160ff811681146200039a57600080fd5b809150509295509295909350565b600181811c90821680620003bd57607f821691505b602082108103620003de57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000434576000816000526020600020601f850160051c810160208610156200040f5750805b601f850160051c820191505b8181101562000430578281556001016200041b565b5050505b505050565b81516001600160401b038111156200045557620004556200022f565b6200046d81620004668454620003a8565b84620003e4565b602080601f831160018114620004a557600084156200048c5750858301515b600019600386901b1c1916600185901b17855562000430565b600085815260208120601f198616915b82811015620004d657888601518255948401946001909101908401620004b5565b5085821015620004f55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080516116686200052160003960006101fe01526116686000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c806362354e03116100b8578063a9059cbb1161007c578063a9059cbb146102d0578063dd62ed3e146102e3578063debfda30146102f6578063e17f212e14610309578063ef88bf1314610328578063f5a983831461033b57600080fd5b806362354e031461025b5780636fafdf831461027957806370a082311461028c57806395d89b41146102b5578063a457c2d7146102bd57600080fd5b806318160ddd1161010a57806318160ddd146101bf57806320c5f99d146101d157806323b872dd146101e4578063313ce567146101f757806339509351146102285780635aa6e6751461023b57600080fd5b806301ffc9a71461014757806306fdde031461016f578063095ea7b3146101845780630e583dd21461019757806316fc2f6d146101ac575b600080fd5b61015a61015536600461131d565b610343565b60405190151581526020015b60405180910390f35b610177610395565b6040516101669190611347565b61015a6101923660046113ab565b610427565b6101aa6101a53660046113ab565b61043f565b005b6101aa6101ba3660046113d7565b61046f565b6002545b604051908152602001610166565b6101aa6101df3660046113d7565b610557565b61015a6101f2366004611449565b610746565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610166565b61015a6102363660046113ab565b61076a565b61024361078c565b6040516001600160a01b039091168152602001610166565b600080516020611613833981519152546001600160a01b0316610243565b6101aa61028736600461148a565b610835565b6101c361029a3660046114a3565b6001600160a01b031660009081526020819052604090205490565b610177610842565b61015a6102cb3660046113ab565b610851565b61015a6102de3660046113ab565b6108cc565b6101c36102f13660046114c0565b6108da565b61015a6103043660046114a3565b610905565b60008051602061161383398151915254600160a81b900460ff1661015a565b6101aa6103363660046114c0565b61099f565b6101aa610b13565b60006001600160e01b031982166301ffc9a760e01b148061037457506001600160e01b031982166336372b0760e01b145b8061038f57506001600160e01b0319821663a219a02560e01b145b92915050565b6060600380546103a4906114f9565b80601f01602080910402602001604051908101604052809291908181526020018280546103d0906114f9565b801561041d5780601f106103f25761010080835404028352916020019161041d565b820191906000526020600020905b81548152906001019060200180831161040057829003601f168201915b5050505050905090565b600033610435818585610be7565b5060019392505050565b610447610d0c565b1561046257610454610d42565b61045e8282610d86565b5050565b61045e6000366000610e45565b610477610f5c565b6040516000805160206116138339815191529060009061049a9085908590611533565b604051809103902090508160020160008281526020019081526020016000205460000361050e5760405162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f7200000000000060448201526064015b60405180910390fd5b6040518181527f69b058d6225c01c1f2a25801ca5b05705fa2e9118e93d518390ba804398c87b19060200160405180910390a16000908152600290910160205260408120555050565b60008051602061161383398151915261056f33610905565b6105ab5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9032bc32b1baba37b960991b6044820152606401610505565b600083836040516105bd929190611533565b6040805191829003909120600081815260028501602052918220549092509081900361062b5760405162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f720000000000006044820152606401610505565b8042101561067b5760405162461bcd60e51b815260206004820152601960248201527f74696d656c6f636b3a206e6f7420616c6c6f77656420796574000000000000006044820152606401610505565b6000828152600284016020526040808220829055845460ff60b01b1916600160b01b1785555130906106b09088908890611533565b6000604051808303816000865af19150503d80600081146106ed576040519150601f19603f3d011682016040523d82523d6000602084013e6106f2565b606091505b5050845460ff60b01b191685556040518481529091507fec1225e5a8a8acb91e03ce648c683c74f5d152a775b9715980999441d714c44f9060200160405180910390a161073e81610fb8565b505050505050565b600033610754858285610fd5565b61075f85858561104f565b506001949350505050565b60003361043581858561077d83836108da565b6107879190611543565b610be7565b600080516020611613833981519152805460009190600160a81b900460ff166107c25760018101546001600160a01b031661082f565b805460408051631cc9492560e21b815290516001600160a01b03909216916373252494916004808201926020929091908290030181865afa15801561080b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082f9190611564565b91505090565b61083f33826111f3565b50565b6060600480546103a4906114f9565b6000338161085f82866108da565b9050838110156108bf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610505565b61075f8286868403610be7565b60003361043581858561104f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600080516020611613833981519152805460009190600160a01b900460ff16801561099857508054604051630debfda360e41b81526001600160a01b0385811660048301529091169063debfda3090602401602060405180830381865afa158015610974573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109989190611581565b9392505050565b6000805160206116138339815191528054600160a01b900460ff16156109fe5760405162461bcd60e51b8152602060048201526014602482015273696e697469616c6973656420213d2066616c736560601b6044820152606401610505565b6001600160a01b038316610a545760405162461bcd60e51b815260206004820152601860248201527f676f7665726e616e63652073657474696e6773207a65726f00000000000000006044820152606401610505565b6001600160a01b038216610a9d5760405162461bcd60e51b815260206004820152601060248201526f5f676f7665726e616e6365207a65726f60801b6044820152606401610505565b80546001600160a01b038481166001600160a81b031990921691909117600160a01b1782556001820180549184166001600160a01b0319909216821790556040519081527f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db9060200160405180910390a1505050565b610b1b610f5c565b6000805160206116138339815191528054600160a81b900460ff1615610b835760405162461bcd60e51b815260206004820152601a60248201527f616c726561647920696e2070726f64756374696f6e206d6f64650000000000006044820152606401610505565b6001810180546001600160a01b03191690558054600160a81b60ff60a81b1982161782556040516001600160a01b0390911681527f83af113638b5422f9e977cebc0aaf0eaf2188eb9a8baae7f9d46c42b33a1560c9060200160405180910390a150565b6001600160a01b038316610c495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610505565b6001600160a01b038216610caa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610505565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080516020611613833981519152805460009190600160b01b900460ff168061082f575054600160a81b900460ff1615919050565b6000805160206116138339815191528054600160b01b900460ff1615610d7e57333014610d7157610d716115a3565b805460ff60b01b19169055565b61083f610f5c565b6001600160a01b038216610ddc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610505565b8060026000828254610dee9190611543565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080516020611613833981519152610e5c610f5c565b60008484604051610e6e929190611533565b604080519182900382208454636221a54b60e01b845291519093506000926001600160a01b0390921691636221a54b9160048083019260209291908290030181865afa158015610ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee691906115b9565b905083811015610ef35750825b6000610eff8242611543565b600084815260028601602052604090819020829055519091507f8c02104dfc280f713854f25297de671710c544c58de69dbde8fb66974ce1ab9e90610f4b9089908990879086906115d2565b60405180910390a150505050505050565b610f6461078c565b6001600160a01b0316336001600160a01b031614610fb65760405162461bcd60e51b815260206004820152600f60248201526e6f6e6c7920676f7665726e616e636560881b6044820152606401610505565b565b3d604051818101604052816000823e8215610fd1578181f35b8181fd5b6000610fe184846108da565b90506000198114611049578181101561103c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610505565b6110498484848403610be7565b50505050565b6001600160a01b0383166110b35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610505565b6001600160a01b0382166111155760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610505565b6001600160a01b0383166000908152602081905260409020548181101561118d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610505565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611049565b6001600160a01b0382166112535760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610505565b6001600160a01b038216600090815260208190526040902054818110156112c75760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610505565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610cff565b60006020828403121561132f57600080fd5b81356001600160e01b03198116811461099857600080fd5b60006020808352835180602085015260005b8181101561137557858101830151858201604001528201611359565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461083f57600080fd5b600080604083850312156113be57600080fd5b82356113c981611396565b946020939093013593505050565b600080602083850312156113ea57600080fd5b823567ffffffffffffffff8082111561140257600080fd5b818501915085601f83011261141657600080fd5b81358181111561142557600080fd5b86602082850101111561143757600080fd5b60209290920196919550909350505050565b60008060006060848603121561145e57600080fd5b833561146981611396565b9250602084013561147981611396565b929592945050506040919091013590565b60006020828403121561149c57600080fd5b5035919050565b6000602082840312156114b557600080fd5b813561099881611396565b600080604083850312156114d357600080fd5b82356114de81611396565b915060208301356114ee81611396565b809150509250929050565b600181811c9082168061150d57607f821691505b60208210810361152d57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b8082018082111561038f57634e487b7160e01b600052601160045260246000fd5b60006020828403121561157657600080fd5b815161099881611396565b60006020828403121561159357600080fd5b8151801515811461099857600080fd5b634e487b7160e01b600052600160045260246000fd5b6000602082840312156115cb57600080fd5b5051919050565b606081528360608201528385608083013760006080858301015260006080601f19601f87011683010190508360208301528260408301529594505050505056fe2aa47ee5db910f3b2a06970c443249cc77dbd9f96100cfebc1775ab7fb1d1824a2646970667358221220a4ead2718c47e9a8368183b5fd118a7b09950021f1cc8a53b196f32bc6fe1c9564736f6c63430008170033000000000000000000000000183faff6997c98a812a3b98748fc80241d08f3120000000000000000000000005a11fa259c898e6973db2f3c9e82339a53c777c000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c5465737420555344436f696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000087465737455534443000000000000000000000000000000000000000000000000
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106101425760003560e01c806362354e03116100b8578063a9059cbb1161007c578063a9059cbb146102d0578063dd62ed3e146102e3578063debfda30146102f6578063e17f212e14610309578063ef88bf1314610328578063f5a983831461033b57600080fd5b806362354e031461025b5780636fafdf831461027957806370a082311461028c57806395d89b41146102b5578063a457c2d7146102bd57600080fd5b806318160ddd1161010a57806318160ddd146101bf57806320c5f99d146101d157806323b872dd146101e4578063313ce567146101f757806339509351146102285780635aa6e6751461023b57600080fd5b806301ffc9a71461014757806306fdde031461016f578063095ea7b3146101845780630e583dd21461019757806316fc2f6d146101ac575b600080fd5b61015a61015536600461131d565b610343565b60405190151581526020015b60405180910390f35b610177610395565b6040516101669190611347565b61015a6101923660046113ab565b610427565b6101aa6101a53660046113ab565b61043f565b005b6101aa6101ba3660046113d7565b61046f565b6002545b604051908152602001610166565b6101aa6101df3660046113d7565b610557565b61015a6101f2366004611449565b610746565b60405160ff7f0000000000000000000000000000000000000000000000000000000000000006168152602001610166565b61015a6102363660046113ab565b61076a565b61024361078c565b6040516001600160a01b039091168152602001610166565b600080516020611613833981519152546001600160a01b0316610243565b6101aa61028736600461148a565b610835565b6101c361029a3660046114a3565b6001600160a01b031660009081526020819052604090205490565b610177610842565b61015a6102cb3660046113ab565b610851565b61015a6102de3660046113ab565b6108cc565b6101c36102f13660046114c0565b6108da565b61015a6103043660046114a3565b610905565b60008051602061161383398151915254600160a81b900460ff1661015a565b6101aa6103363660046114c0565b61099f565b6101aa610b13565b60006001600160e01b031982166301ffc9a760e01b148061037457506001600160e01b031982166336372b0760e01b145b8061038f57506001600160e01b0319821663a219a02560e01b145b92915050565b6060600380546103a4906114f9565b80601f01602080910402602001604051908101604052809291908181526020018280546103d0906114f9565b801561041d5780601f106103f25761010080835404028352916020019161041d565b820191906000526020600020905b81548152906001019060200180831161040057829003601f168201915b5050505050905090565b600033610435818585610be7565b5060019392505050565b610447610d0c565b1561046257610454610d42565b61045e8282610d86565b5050565b61045e6000366000610e45565b610477610f5c565b6040516000805160206116138339815191529060009061049a9085908590611533565b604051809103902090508160020160008281526020019081526020016000205460000361050e5760405162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f7200000000000060448201526064015b60405180910390fd5b6040518181527f69b058d6225c01c1f2a25801ca5b05705fa2e9118e93d518390ba804398c87b19060200160405180910390a16000908152600290910160205260408120555050565b60008051602061161383398151915261056f33610905565b6105ab5760405162461bcd60e51b815260206004820152600d60248201526c37b7363c9032bc32b1baba37b960991b6044820152606401610505565b600083836040516105bd929190611533565b6040805191829003909120600081815260028501602052918220549092509081900361062b5760405162461bcd60e51b815260206004820152601a60248201527f74696d656c6f636b3a20696e76616c69642073656c6563746f720000000000006044820152606401610505565b8042101561067b5760405162461bcd60e51b815260206004820152601960248201527f74696d656c6f636b3a206e6f7420616c6c6f77656420796574000000000000006044820152606401610505565b6000828152600284016020526040808220829055845460ff60b01b1916600160b01b1785555130906106b09088908890611533565b6000604051808303816000865af19150503d80600081146106ed576040519150601f19603f3d011682016040523d82523d6000602084013e6106f2565b606091505b5050845460ff60b01b191685556040518481529091507fec1225e5a8a8acb91e03ce648c683c74f5d152a775b9715980999441d714c44f9060200160405180910390a161073e81610fb8565b505050505050565b600033610754858285610fd5565b61075f85858561104f565b506001949350505050565b60003361043581858561077d83836108da565b6107879190611543565b610be7565b600080516020611613833981519152805460009190600160a81b900460ff166107c25760018101546001600160a01b031661082f565b805460408051631cc9492560e21b815290516001600160a01b03909216916373252494916004808201926020929091908290030181865afa15801561080b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082f9190611564565b91505090565b61083f33826111f3565b50565b6060600480546103a4906114f9565b6000338161085f82866108da565b9050838110156108bf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610505565b61075f8286868403610be7565b60003361043581858561104f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600080516020611613833981519152805460009190600160a01b900460ff16801561099857508054604051630debfda360e41b81526001600160a01b0385811660048301529091169063debfda3090602401602060405180830381865afa158015610974573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109989190611581565b9392505050565b6000805160206116138339815191528054600160a01b900460ff16156109fe5760405162461bcd60e51b8152602060048201526014602482015273696e697469616c6973656420213d2066616c736560601b6044820152606401610505565b6001600160a01b038316610a545760405162461bcd60e51b815260206004820152601860248201527f676f7665726e616e63652073657474696e6773207a65726f00000000000000006044820152606401610505565b6001600160a01b038216610a9d5760405162461bcd60e51b815260206004820152601060248201526f5f676f7665726e616e6365207a65726f60801b6044820152606401610505565b80546001600160a01b038481166001600160a81b031990921691909117600160a01b1782556001820180549184166001600160a01b0319909216821790556040519081527f9789733827840833afc031fb2ef9ab6894271f77bad2085687cf4ae5c7bee4db9060200160405180910390a1505050565b610b1b610f5c565b6000805160206116138339815191528054600160a81b900460ff1615610b835760405162461bcd60e51b815260206004820152601a60248201527f616c726561647920696e2070726f64756374696f6e206d6f64650000000000006044820152606401610505565b6001810180546001600160a01b03191690558054600160a81b60ff60a81b1982161782556040516001600160a01b0390911681527f83af113638b5422f9e977cebc0aaf0eaf2188eb9a8baae7f9d46c42b33a1560c9060200160405180910390a150565b6001600160a01b038316610c495760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610505565b6001600160a01b038216610caa5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610505565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b600080516020611613833981519152805460009190600160b01b900460ff168061082f575054600160a81b900460ff1615919050565b6000805160206116138339815191528054600160b01b900460ff1615610d7e57333014610d7157610d716115a3565b805460ff60b01b19169055565b61083f610f5c565b6001600160a01b038216610ddc5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610505565b8060026000828254610dee9190611543565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600080516020611613833981519152610e5c610f5c565b60008484604051610e6e929190611533565b604080519182900382208454636221a54b60e01b845291519093506000926001600160a01b0390921691636221a54b9160048083019260209291908290030181865afa158015610ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee691906115b9565b905083811015610ef35750825b6000610eff8242611543565b600084815260028601602052604090819020829055519091507f8c02104dfc280f713854f25297de671710c544c58de69dbde8fb66974ce1ab9e90610f4b9089908990879086906115d2565b60405180910390a150505050505050565b610f6461078c565b6001600160a01b0316336001600160a01b031614610fb65760405162461bcd60e51b815260206004820152600f60248201526e6f6e6c7920676f7665726e616e636560881b6044820152606401610505565b565b3d604051818101604052816000823e8215610fd1578181f35b8181fd5b6000610fe184846108da565b90506000198114611049578181101561103c5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610505565b6110498484848403610be7565b50505050565b6001600160a01b0383166110b35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610505565b6001600160a01b0382166111155760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610505565b6001600160a01b0383166000908152602081905260409020548181101561118d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610505565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611049565b6001600160a01b0382166112535760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610505565b6001600160a01b038216600090815260208190526040902054818110156112c75760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610505565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9101610cff565b60006020828403121561132f57600080fd5b81356001600160e01b03198116811461099857600080fd5b60006020808352835180602085015260005b8181101561137557858101830151858201604001528201611359565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b038116811461083f57600080fd5b600080604083850312156113be57600080fd5b82356113c981611396565b946020939093013593505050565b600080602083850312156113ea57600080fd5b823567ffffffffffffffff8082111561140257600080fd5b818501915085601f83011261141657600080fd5b81358181111561142557600080fd5b86602082850101111561143757600080fd5b60209290920196919550909350505050565b60008060006060848603121561145e57600080fd5b833561146981611396565b9250602084013561147981611396565b929592945050506040919091013590565b60006020828403121561149c57600080fd5b5035919050565b6000602082840312156114b557600080fd5b813561099881611396565b600080604083850312156114d357600080fd5b82356114de81611396565b915060208301356114ee81611396565b809150509250929050565b600181811c9082168061150d57607f821691505b60208210810361152d57634e487b7160e01b600052602260045260246000fd5b50919050565b8183823760009101908152919050565b8082018082111561038f57634e487b7160e01b600052601160045260246000fd5b60006020828403121561157657600080fd5b815161099881611396565b60006020828403121561159357600080fd5b8151801515811461099857600080fd5b634e487b7160e01b600052600160045260246000fd5b6000602082840312156115cb57600080fd5b5051919050565b606081528360608201528385608083013760006080858301015260006080601f19601f87011683010190508360208301528260408301529594505050505056fe2aa47ee5db910f3b2a06970c443249cc77dbd9f96100cfebc1775ab7fb1d1824a2646970667358221220a4ead2718c47e9a8368183b5fd118a7b09950021f1cc8a53b196f32bc6fe1c9564736f6c63430008170033