Contract 0x0EFc598FFA88fa416dE729A78EB357B0dc45Dbc0

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x67cde15d31d66ca00b53d5e51509f4a4b17985424efac8b67a24f2857371ef15Transfer Ownersh...319042802022-02-25 2:07:01213 days 3 hrs ago0xb98d4d4e205aff4d4755e9df19bd0b8bd4e0f148 IN  0x0efc598ffa88fa416de729a78eb357b0dc45dbc00 FTM0.079514225424
0x51a13515e2c814789cc22b353374db5b00adba9ac0331fb8d4411cf708e31ddcSet Fuji Admin319037132022-02-25 1:57:30213 days 4 hrs ago0xb98d4d4e205aff4d4755e9df19bd0b8bd4e0f148 IN  0x0efc598ffa88fa416de729a78eb357b0dc45dbc00 FTM0.06915724854
0x5f38b2dcc951a3309075bc04a652210f110525c420d93280e5734121138064600x60c06040319037082022-02-25 1:57:26213 days 4 hrs ago0xb98d4d4e205aff4d4755e9df19bd0b8bd4e0f148 IN  Create: FlasherFTM0 FTM3.422263837059
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x5f38b2dcc951a3309075bc04a652210f110525c420d93280e573412113806460319037082022-02-25 1:57:26213 days 4 hrs ago 0xb98d4d4e205aff4d4755e9df19bd0b8bd4e0f148  Contract Creation0 FTM
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FlasherFTM

Compiler Version
v0.8.2+commit.661d1103

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 19 : FlasherFTM.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "../../abstracts/claimable/Claimable.sol";
import "../../interfaces/IFujiAdmin.sol";
import "../../interfaces/IVault.sol";
import "../../interfaces/IFlasher.sol";
import "../../interfaces/IFliquidator.sol";
import "../../interfaces/IFujiMappings.sol";
import "../../interfaces/IWETH.sol";
import "../../libraries/FlashLoans.sol";
import "../../libraries/Errors.sol";
import "../../interfaces/aave/IFlashLoanReceiver.sol";
import "../../interfaces/aave/IAaveLendingPool.sol";
import "../../interfaces/cream/ICTokenFlashloan.sol";
import "../../interfaces/cream/ICFlashloanReceiver.sol";
import "../libraries/LibUniversalERC20FTM.sol";

/**
 * @dev Contract that handles Fuji protocol flash loan logic and
 * the specific logic of all active flash loan providers used by Fuji protocol.
 */

contract FlasherFTM is IFlasher, Claimable, IFlashLoanReceiver, ICFlashloanReceiver {
  using LibUniversalERC20FTM for IERC20;

  IFujiAdmin private _fujiAdmin;

  address private constant _FTM = 0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF;
  address private constant _WFTM = 0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83;

  address private immutable _geistLendingPool = 0x9FAD24f572045c7869117160A571B2e50b10d068;
  IFujiMappings private immutable _crMappings =
    IFujiMappings(0x1eEdE44b91750933C96d2125b6757C4F89e63E20);

  bytes32 private _paramsHash;

  // need to be payable because of the conversion ETH <> WETH
  receive() external payable {}

  /**
   * @dev Throws if caller is not 'owner'.
   */
  modifier isAuthorized() {
    require(
      msg.sender == _fujiAdmin.getController() ||
        msg.sender == _fujiAdmin.getFliquidator() ||
        msg.sender == owner(),
      Errors.VL_NOT_AUTHORIZED
    );
    _;
  }

  /**
   * @dev Sets the fujiAdmin Address
   * @param _newFujiAdmin: FujiAdmin Contract Address
   * Emits a {FujiAdminChanged} event.
   */
  function setFujiAdmin(address _newFujiAdmin) public onlyOwner {
    _fujiAdmin = IFujiAdmin(_newFujiAdmin);
    emit FujiAdminChanged(_newFujiAdmin);
  }

  /**
   * @dev Routing Function for Flashloan Provider
   * @param info: struct information for flashLoan
   * @param _flashnum: integer identifier of flashloan provider
   */
  function initiateFlashloan(FlashLoan.Info calldata info, uint8 _flashnum)
    external
    override
    isAuthorized
  {
    _paramsHash = keccak256(abi.encode(info));
    if (_flashnum == 0) {
      _initiateGeistFlashLoan(info);
    } else if (_flashnum == 2) {
      _initiateCreamFlashLoan(info);
    } else {
      revert(Errors.VL_INVALID_FLASH_NUMBER);
    }
  }

  /**
   * @dev Initiates an Geist flashloan.
   * @param info: data to be passed between functions executing flashloan logic
   */
  function _initiateGeistFlashLoan(FlashLoan.Info calldata info) internal {
    //Initialize Instance of Geist Lending Pool
    IAaveLendingPool geistLp = IAaveLendingPool(_geistLendingPool);

    //Passing arguments to construct Geist flashloan -limited to 1 asset type for now.
    address receiverAddress = address(this);
    address[] memory assets = new address[](1);
    assets[0] = address(info.asset == _FTM ? _WFTM : info.asset);
    uint256[] memory amounts = new uint256[](1);
    amounts[0] = info.amount;

    // 0 = no debt, 1 = stable, 2 = variable
    uint256[] memory modes = new uint256[](1);
    //modes[0] = 0;

    //address onBehalfOf = address(this);
    //bytes memory params = abi.encode(info);
    //uint16 referralCode = 0;

    //Geist Flashloan initiated.
    geistLp.flashLoan(receiverAddress, assets, amounts, modes, address(this), abi.encode(info), 0);
  }

  /**
   * @dev Executes Geist Flashloan, this operation is required
   * and called by Geistflashloan when sending loaned amount
   */
  function executeOperation(
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata premiums,
    address initiator,
    bytes calldata params
  ) external override returns (bool) {
    require(
      msg.sender == _geistLendingPool && initiator == address(this),
      Errors.VL_NOT_AUTHORIZED
    );

    FlashLoan.Info memory info = abi.decode(params, (FlashLoan.Info));
    require( _paramsHash == keccak256(abi.encode(info)), "False entry point!");

    uint256 _value;
    if (info.asset == _FTM) {
      // Convert WETH to ETH and assign amount to be set as msg.value
      _convertWethToEth(amounts[0]);
      _value = info.amount;
    } else {
      // Transfer to Vault the flashloan Amount
      // _value is 0
      IERC20(assets[0]).univTransfer(payable(info.vault), amounts[0]);
    }

    _executeAction(info, amounts[0], premiums[0], _value);

    //Approve geistLP to spend to repay flashloan
    _approveBeforeRepay(info.asset == _FTM, assets[0], amounts[0] + premiums[0], _geistLendingPool);

    _paramsHash = "";

    return true;
  }

  // ===================== CreamFinance FlashLoan ===================================

  /**
   * @dev Initiates an CreamFinance flashloan.
   * @param info: data to be passed between functions executing flashloan logic
   */
  function _initiateCreamFlashLoan(FlashLoan.Info calldata info) internal {
    address crToken = info.asset == _FTM
      ? 0xd528697008aC67A21818751A5e3c58C8daE54696
      : _crMappings.addressMapping(info.asset);

    // Prepara data for flashloan execution
    bytes memory params = abi.encode(info);

    // Initialize Instance of Cream crLendingContract
    ICTokenFlashloan(crToken).flashLoan(address(this), address(this), info.amount, params);
  }

  /**
   * @dev Executes CreamFinance Flashloan, this operation is required
   * and called by CreamFinanceflashloan when sending loaned amount
   */
  function onFlashLoan(
    address sender,
    address underlying,
    uint256 amount,
    uint256 fee,
    bytes calldata params
  ) external override returns (bytes32) {
    // Check Msg. Sender is crToken Lending Contract
    // from IronBank because ETH on Cream cannot perform a flashloan
    address crToken = underlying == _WFTM
      ? 0xd528697008aC67A21818751A5e3c58C8daE54696
      : _crMappings.addressMapping(underlying);
    require(msg.sender == crToken && address(this) == sender, Errors.VL_NOT_AUTHORIZED);
    require(IERC20(underlying).balanceOf(address(this)) >= amount, Errors.VL_FLASHLOAN_FAILED);
    FlashLoan.Info memory info = abi.decode(params, (FlashLoan.Info));
    require( _paramsHash == keccak256(abi.encode(info)), "False entry point!");
    uint256 _value;
    if (info.asset == _FTM) {
      // Convert WFTM to FTM and assign amount to be set as msg.value
      _convertWethToEth(amount);
      _value = amount;
    } else {
      // Transfer to Vault the flashloan Amount
      // _value is 0
      IERC20(underlying).univTransfer(payable(info.vault), amount);
    }
    // Do task according to CallType
    _executeAction(info, amount, fee, _value);

    if (info.asset == _FTM) _convertEthToWeth(amount + fee);
    // Transfer flashloan + fee back to crToken Lending Contract
    IERC20(underlying).univApprove(payable(crToken), amount + fee);

    _paramsHash = "";

    return keccak256("ERC3156FlashBorrowerInterface.onFlashLoan");
  }

  // ========================================================
  //
  // flash loans come here....
  //
  // ========================================================

  function _executeAction(
    FlashLoan.Info memory _info,
    uint256 _amount,
    uint256 _fee,
    uint256 _value
  ) internal {
    if (_info.callType == FlashLoan.CallType.Switch) {
      IVault(_info.vault).executeSwitch{ value: _value }(_info.newProvider, _amount, _fee);
    } else if (_info.callType == FlashLoan.CallType.Close) {
      IFliquidator(_info.fliquidator).executeFlashClose{ value: _value }(
        _info.userAddrs[0],
        _info.vault,
        _amount,
        _fee
      );
    } else {
      IFliquidator(_info.fliquidator).executeFlashBatchLiquidation{ value: _value }(
        _info.userAddrs,
        _info.userBalances,
        _info.userliquidator,
        _info.vault,
        _amount,
        _fee
      );
    }
  }

  function _approveBeforeRepay(
    bool _isFTM,
    address _asset,
    uint256 _amount,
    address _spender
  ) internal {
    if (_isFTM) {
      _convertEthToWeth(_amount);
      IERC20(_WFTM).univApprove(payable(_spender), _amount);
    } else {
      IERC20(_asset).univApprove(payable(_spender), _amount);
    }
  }

  function _convertEthToWeth(uint256 _amount) internal {
    IWETH(_WFTM).deposit{ value: _amount }();
  }

  function _convertWethToEth(uint256 _amount) internal {
    IWETH token = IWETH(_WFTM);
    token.withdraw(_amount);
  }
}

File 2 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @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);
}

File 3 of 19 : Claimable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/Context.sol";

/**
 * @dev Abstract contract that implements a modified version of  Openzeppelin {Ownable.sol} contract.
 * It creates a two step process for the transfer of ownership.
 */

abstract contract Claimable is Context {
  address private _owner;

  address public pendingOwner;

  // Claimable Events

  /**
   * @dev Emits when step two in ownership transfer is completed.
   */
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
  /**
   * @dev Emits when step one in ownership transfer is initiated.
   */
  event NewPendingOwner(address indexed owner);

  /**
   * @dev Initializes the contract setting the deployer as the initial owner.
   */
  constructor() {
    address msgSender = _msgSender();
    _owner = msgSender;
    emit OwnershipTransferred(address(0), 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(_msgSender() == owner(), "Ownable: caller is not the owner");
    _;
  }

  /**
   * @dev Throws if called by any account other than the pendingOwner.
   */
  modifier onlyPendingOwner() {
    require(_msgSender() == pendingOwner);
    _;
  }

  /**
   * @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 {
    emit OwnershipTransferred(owner(), address(0));
    _owner = address(0);
  }

  /**
   * @dev Step one of ownership transfer.
   * Initiates transfer of ownership of the contract to a new account (`newOwner`).
   * Can only be called by the current owner.
   *
   * NOTE:`newOwner` requires to claim ownership in order to be able to call
   * {onlyOwner} modified functions.
   */
  function transferOwnership(address newOwner) public virtual onlyOwner {
    require(newOwner != address(0), "Cannot pass zero address!");
    require(pendingOwner == address(0), "There is a pending owner!");
    pendingOwner = newOwner;
    emit NewPendingOwner(newOwner);
  }

  /**
   * @dev Cancels the transfer of ownership of the contract.
   * Can only be called by the current owner.
   */
  function cancelTransferOwnership() public onlyOwner {
    require(pendingOwner != address(0));
    delete pendingOwner;
    emit NewPendingOwner(address(0));
  }

  /**
   * @dev Step two of ownership transfer.
   * 'pendingOwner' claims ownership of the contract.
   * Can only be called by the pending owner.
   */
  function claimOwnership() public onlyPendingOwner {
    emit OwnershipTransferred(owner(), pendingOwner);
    _owner = pendingOwner;
    delete pendingOwner;
  }
}

File 4 of 19 : IFujiAdmin.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IFujiAdmin {
  // FujiAdmin Events

  /**
   * @dev Log change of flasher address
   */
  event FlasherChanged(address newFlasher);
  /**
   * @dev Log change of fliquidator address
   */
  event FliquidatorChanged(address newFliquidator);
  /**
   * @dev Log change of treasury address
   */
  event TreasuryChanged(address newTreasury);
  /**
   * @dev Log change of controller address
   */
  event ControllerChanged(address newController);
  /**
   * @dev Log change of vault harvester address
   */
  event VaultHarvesterChanged(address newHarvester);
  /**
   * @dev Log change of swapper address
   */
  event SwapperChanged(address newSwapper);
  /**
   * @dev Log change of vault address permission
   */
  event VaultPermitChanged(address vaultAddress, bool newPermit);

  function validVault(address _vaultAddr) external view returns (bool);

  function getFlasher() external view returns (address);

  function getFliquidator() external view returns (address);

  function getController() external view returns (address);

  function getTreasury() external view returns (address payable);

  function getVaultHarvester() external view returns (address);

  function getSwapper() external view returns (address);
}

File 5 of 19 : IVault.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IVault {
  // Vault Events

  /**
   * @dev Log a deposit transaction done by a user
   */
  event Deposit(address indexed userAddrs, address indexed asset, uint256 amount);
  /**
   * @dev Log a withdraw transaction done by a user
   */
  event Withdraw(address indexed userAddrs, address indexed asset, uint256 amount);
  /**
   * @dev Log a borrow transaction done by a user
   */
  event Borrow(address indexed userAddrs, address indexed asset, uint256 amount);
  /**
   * @dev Log a payback transaction done by a user
   */
  event Payback(address indexed userAddrs, address indexed asset, uint256 amount);
  /**
   * @dev Log a switch from provider to new provider in vault
   */
  event Switch(
    address fromProviderAddrs,
    address toProviderAddr,
    uint256 debtamount,
    uint256 collattamount
  );
  /**
   * @dev Log a change in active provider
   */
  event SetActiveProvider(address newActiveProviderAddress);
  /**
   * @dev Log a change in the array of provider addresses
   */
  event ProvidersChanged(address[] newProviderArray);
  /**
   * @dev Log a change in F1155 address
   */
  event F1155Changed(address newF1155Address);
  /**
   * @dev Log a change in fuji admin address
   */
  event FujiAdminChanged(address newFujiAdmin);
  /**
   * @dev Log a change in the factor values
   */
  event FactorChanged(FactorType factorType, uint64 newFactorA, uint64 newFactorB);
  /**
   * @dev Log a change in the oracle address
   */
  event OracleChanged(address newOracle);

  enum FactorType {
    Safety,
    Collateralization,
    ProtocolFee,
    BonusLiquidation
  }

  struct Factor {
    uint64 a;
    uint64 b;
  }

  // Core Vault Functions

  function deposit(uint256 _collateralAmount) external payable;

  function withdraw(int256 _withdrawAmount) external;

  function withdrawLiq(int256 _withdrawAmount) external;

  function borrow(uint256 _borrowAmount) external;

  function payback(int256 _repayAmount) external payable;

  function paybackLiq(address[] memory _users, uint256 _repayAmount) external payable;

  function executeSwitch(
    address _newProvider,
    uint256 _flashLoanDebt,
    uint256 _fee
  ) external payable;

  //Getter Functions

  function activeProvider() external view returns (address);

  function borrowBalance(address _provider) external view returns (uint256);

  function depositBalance(address _provider) external view returns (uint256);

  function userDebtBalance(address _user) external view returns (uint256);

  function userProtocolFee(address _user) external view returns (uint256);

  function userDepositBalance(address _user) external view returns (uint256);

  function getNeededCollateralFor(uint256 _amount, bool _withFactors)
    external
    view
    returns (uint256);

  function getLiquidationBonusFor(uint256 _amount) external view returns (uint256);

  function getProviders() external view returns (address[] memory);

  function fujiERC1155() external view returns (address);

  //Setter Functions

  function setActiveProvider(address _provider) external;

  function updateF1155Balances() external;

  function protocolFee() external view returns (uint64, uint64);
}

File 6 of 19 : IFlasher.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../libraries/FlashLoans.sol";

interface IFlasher {
  /**
   * @dev Logs a change in FujiAdmin address.
   */
  event FujiAdminChanged(address newFujiAdmin);

  function initiateFlashloan(FlashLoan.Info calldata info, uint8 amount) external;
}

File 7 of 19 : IFliquidator.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IFliquidator {
  function executeFlashClose(
    address _userAddr,
    address _vault,
    uint256 _amount,
    uint256 _flashloanfee
  ) external payable;

  function executeFlashBatchLiquidation(
    address[] calldata _userAddrs,
    uint256[] calldata _usrsBals,
    address _liquidatorAddr,
    address _vault,
    uint256 _amount,
    uint256 _flashloanFee
  ) external payable;
}

File 8 of 19 : IFujiMappings.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IFujiMappings {
  // FujiMapping Events

  /**
   * @dev Log a change in address mapping
   */
  event MappingChanged(address keyAddress, address mappedAddress);
  /**
   * @dev Log a change in URI
   */
  event UriChanged(string newUri);

  function addressMapping(address) external view returns (address);
}

File 9 of 19 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IWETH {
  function approve(address, uint256) external;

  function deposit() external payable;

  function withdraw(uint256) external;
}

File 10 of 19 : FlashLoans.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

library Account {
  enum Status {
    Normal,
    Liquid,
    Vapor
  }
  struct Info {
    address owner; // The address that owns the account
    uint256 number; // A nonce that allows a single address to control many accounts
  }
}

library Actions {
  enum ActionType {
    Deposit, // supply tokens
    Withdraw, // borrow tokens
    Transfer, // transfer balance between accounts
    Buy, // buy an amount of some token (publicly)
    Sell, // sell an amount of some token (publicly)
    Trade, // trade tokens against another account
    Liquidate, // liquidate an undercollateralized or expiring account
    Vaporize, // use excess tokens to zero-out a completely negative account
    Call // send arbitrary data to an address
  }

  struct ActionArgs {
    ActionType actionType;
    uint256 accountId;
    Types.AssetAmount amount;
    uint256 primaryMarketId;
    uint256 secondaryMarketId;
    address otherAddress;
    uint256 otherAccountId;
    bytes data;
  }
}

library Types {
  enum AssetDenomination {
    Wei, // the amount is denominated in wei
    Par // the amount is denominated in par
  }

  enum AssetReference {
    Delta, // the amount is given as a delta from the current value
    Target // the amount is given as an exact number to end up at
  }

  struct AssetAmount {
    bool sign; // true if positive
    AssetDenomination denomination;
    AssetReference ref;
    uint256 value;
  }
}

library FlashLoan {
  /**
   * @dev Used to determine which vault's function to call post-flashloan:
   * - Switch for executeSwitch(...)
   * - Close for executeFlashClose(...)
   * - Liquidate for executeFlashLiquidation(...)
   * - BatchLiquidate for executeFlashBatchLiquidation(...)
   */
  enum CallType {
    Switch,
    Close,
    BatchLiquidate
  }

  /**
   * @dev Struct of params to be passed between functions executing flashloan logic
   * @param asset: Address of asset to be borrowed with flashloan
   * @param amount: Amount of asset to be borrowed with flashloan
   * @param vault: Vault's address on which the flashloan logic to be executed
   * @param newProvider: New provider's address. Used when callType is Switch
   * @param userAddrs: User's address array Used when callType is BatchLiquidate
   * @param userBals:  Array of user's balances, Used when callType is BatchLiquidate
   * @param userliquidator: The user's address who is  performing liquidation. Used when callType is Liquidate
   * @param fliquidator: Fujis Liquidator's address.
   */
  struct Info {
    CallType callType;
    address asset;
    uint256 amount;
    address vault;
    address newProvider;
    address[] userAddrs;
    uint256[] userBalances;
    address userliquidator;
    address fliquidator;
  }
}

File 11 of 19 : Errors.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
 * @title Errors library
 * @author Fuji
 * @notice Defines the error messages emitted by the different contracts
 * @dev Error messages prefix glossary:
 *  - VL = Validation Logic 100 series
 *  - MATH = Math libraries 200 series
 *  - RF = Refinancing 300 series
 *  - VLT = vault 400 series
 *  - SP = Special 900 series
 */
library Errors {
  //Errors
  string public constant VL_INDEX_OVERFLOW = "100"; // index overflows uint128
  string public constant VL_INVALID_MINT_AMOUNT = "101"; //invalid amount to mint
  string public constant VL_INVALID_BURN_AMOUNT = "102"; //invalid amount to burn
  string public constant VL_AMOUNT_ERROR = "103"; //Input value >0, and for ETH msg.value and amount shall match
  string public constant VL_INVALID_WITHDRAW_AMOUNT = "104"; //Withdraw amount exceeds provided collateral, or falls undercollaterized
  string public constant VL_INVALID_BORROW_AMOUNT = "105"; //Borrow amount does not meet collaterization
  string public constant VL_NO_DEBT_TO_PAYBACK = "106"; //Msg sender has no debt amount to be payback
  string public constant VL_MISSING_ERC20_ALLOWANCE = "107"; //Msg sender has not approved ERC20 full amount to transfer
  string public constant VL_USER_NOT_LIQUIDATABLE = "108"; //User debt position is not liquidatable
  string public constant VL_DEBT_LESS_THAN_AMOUNT = "109"; //User debt is less than amount to partial close
  string public constant VL_PROVIDER_ALREADY_ADDED = "110"; // Provider is already added in Provider Array
  string public constant VL_NOT_AUTHORIZED = "111"; //Not authorized
  string public constant VL_INVALID_COLLATERAL = "112"; //There is no Collateral, or Collateral is not in active in vault
  string public constant VL_NO_ERC20_BALANCE = "113"; //User does not have ERC20 balance
  string public constant VL_INPUT_ERROR = "114"; //Check inputs. For ERC1155 batch functions, array sizes should match.
  string public constant VL_ASSET_EXISTS = "115"; //Asset intended to be added already exists in FujiERC1155
  string public constant VL_ZERO_ADDR_1155 = "116"; //ERC1155: balance/transfer for zero address
  string public constant VL_NOT_A_CONTRACT = "117"; //Address is not a contract.
  string public constant VL_INVALID_ASSETID_1155 = "118"; //ERC1155 Asset ID is invalid.
  string public constant VL_NO_ERC1155_BALANCE = "119"; //ERC1155: insufficient balance for transfer.
  string public constant VL_MISSING_ERC1155_APPROVAL = "120"; //ERC1155: transfer caller is not owner nor approved.
  string public constant VL_RECEIVER_REJECT_1155 = "121"; //ERC1155Receiver rejected tokens
  string public constant VL_RECEIVER_CONTRACT_NON_1155 = "122"; //ERC1155: transfer to non ERC1155Receiver implementer
  string public constant VL_OPTIMIZER_FEE_SMALL = "123"; //Fuji OptimizerFee has to be > 1 RAY (1e27)
  string public constant VL_UNDERCOLLATERIZED_ERROR = "124"; // Flashloan-Flashclose cannot be used when User's collateral is worth less than intended debt position to close.
  string public constant VL_MINIMUM_PAYBACK_ERROR = "125"; // Minimum Amount payback should be at least Fuji Optimizerfee accrued interest.
  string public constant VL_HARVESTING_FAILED = "126"; // Harvesting Function failed, check provided _farmProtocolNum or no claimable balance.
  string public constant VL_FLASHLOAN_FAILED = "127"; // Flashloan failed
  string public constant VL_ERC1155_NOT_TRANSFERABLE = "128"; // ERC1155: Not Transferable
  string public constant VL_SWAP_SLIPPAGE_LIMIT_EXCEED = "129"; // ERC1155: Not Transferable
  string public constant VL_ZERO_ADDR = "130"; // Zero Address
  string public constant VL_INVALID_FLASH_NUMBER = "131"; // invalid flashloan number
  string public constant VL_INVALID_HARVEST_PROTOCOL_NUMBER = "132"; // invalid flashloan number
  string public constant VL_INVALID_HARVEST_TYPE = "133"; // invalid flashloan number
  string public constant VL_INVALID_FACTOR = "134"; // invalid factor
  string public constant VL_INVALID_NEW_PROVIDER ="135"; // invalid newProvider in executeSwitch

  string public constant MATH_DIVISION_BY_ZERO = "201";
  string public constant MATH_ADDITION_OVERFLOW = "202";
  string public constant MATH_MULTIPLICATION_OVERFLOW = "203";

  string public constant RF_INVALID_RATIO_VALUES = "301"; // Ratio Value provided is invalid, _ratioA/_ratioB <= 1, and > 0, or activeProvider borrowBalance = 0
  string public constant RF_INVALID_NEW_ACTIVEPROVIDER = "302"; //Input '_newProvider' and vault's 'activeProvider' must be different

  string public constant VLT_CALLER_MUST_BE_VAULT = "401"; // The caller of this function must be a vault

  string public constant ORACLE_INVALID_LENGTH = "501"; // The assets length and price feeds length doesn't match
  string public constant ORACLE_NONE_PRICE_FEED = "502"; // The price feed is not found
}

File 12 of 19 : IFlashLoanReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IFlashLoanReceiver {
  function executeOperation(
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata premiums,
    address initiator,
    bytes calldata params
  ) external returns (bool);
}

File 13 of 19 : IAaveLendingPool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IAaveLendingPool {
  function flashLoan(
    address receiverAddress,
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata modes,
    address onBehalfOf,
    bytes calldata params,
    uint16 referralCode
  ) external;

  function deposit(
    address _asset,
    uint256 _amount,
    address _onBehalfOf,
    uint16 _referralCode
  ) external;

  function withdraw(
    address _asset,
    uint256 _amount,
    address _to
  ) external;

  function borrow(
    address _asset,
    uint256 _amount,
    uint256 _interestRateMode,
    uint16 _referralCode,
    address _onBehalfOf
  ) external;

  function repay(
    address _asset,
    uint256 _amount,
    uint256 _rateMode,
    address _onBehalfOf
  ) external;

  function setUserUseReserveAsCollateral(address _asset, bool _useAsCollateral) external;
}

File 14 of 19 : ICTokenFlashloan.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ICTokenFlashloan {
  function flashLoan(
    address receiver,
    address initiator,
    uint256 amount,
    bytes calldata params
  ) external;
}

File 15 of 19 : ICFlashloanReceiver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ICFlashloanReceiver {
  function onFlashLoan(
    address sender,
    address underlying,
    uint256 amount,
    uint256 fee,
    bytes calldata params
  ) external returns (bytes32);
}

File 16 of 19 : LibUniversalERC20FTM.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

library LibUniversalERC20FTM {
  using SafeERC20 for IERC20;

  IERC20 private constant _FTM_ADDRESS = IERC20(0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF);
  IERC20 private constant _ZERO_ADDRESS = IERC20(0x0000000000000000000000000000000000000000);

  function isFTM(IERC20 token) internal pure returns (bool) {
    return (token == _ZERO_ADDRESS || token == _FTM_ADDRESS);
  }

  function univBalanceOf(IERC20 token, address account) internal view returns (uint256) {
    if (isFTM(token)) {
      return account.balance;
    } else {
      return token.balanceOf(account);
    }
  }

  function univTransfer(
    IERC20 token,
    address payable to,
    uint256 amount
  ) internal {
    if (amount > 0) {
      if (isFTM(token)) {
        (bool sent, ) = to.call{ value: amount }("");
        require(sent, "Failed to send Ether");
      } else {
        token.safeTransfer(to, amount);
      }
    }
  }

  function univApprove(
    IERC20 token,
    address to,
    uint256 amount
  ) internal {
    require(!isFTM(token), "Approve called on ETH");

    if (amount == 0) {
      token.safeApprove(to, 0);
    } else {
      uint256 allowance = token.allowance(address(this), to);
      if (allowance < amount) {
        if (allowance > 0) {
          token.safeApprove(to, 0);
        }
        token.safeApprove(to, amount);
      }
    }
  }
}

File 17 of 19 : Context.sol
// SPDX-License-Identifier: MIT

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;
    }
}

File 18 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 19 of 19 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(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);
            }
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFujiAdmin","type":"address"}],"name":"FujiAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"}],"name":"NewPendingOwner","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"},{"inputs":[],"name":"cancelTransferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"premiums","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum FlashLoan.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"vault","type":"address"},{"internalType":"address","name":"newProvider","type":"address"},{"internalType":"address[]","name":"userAddrs","type":"address[]"},{"internalType":"uint256[]","name":"userBalances","type":"uint256[]"},{"internalType":"address","name":"userliquidator","type":"address"},{"internalType":"address","name":"fliquidator","type":"address"}],"internalType":"struct FlashLoan.Info","name":"info","type":"tuple"},{"internalType":"uint8","name":"_flashnum","type":"uint8"}],"name":"initiateFlashloan","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"underlying","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"onFlashLoan","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFujiAdmin","type":"address"}],"name":"setFujiAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60c06040527f9fad24f572045c7869117160a571b2e50b10d06800000000000000000000000060805272f76f225c8ba8499e4b69092db3abe27c4f31f160651b60a05234801561004e57600080fd5b50600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060805160601c60a05160601c61268f6100d06000396000818161027601526115dc0152600081816109dc01528181610cac01526113df015261268f6000f3fe6080604052600436106100b55760003560e01c806391c154321161006957806392fede001161004e57806392fede00146101c2578063e30c3978146101d7578063f2fde38b146101f7576100bc565b806391c1543214610172578063920f5c8414610192576100bc565b80635ccd808c1161009a5780635ccd808c1461010b578063715018a61461012b5780638da5cb5b14610140576100bc565b806323e30c8b146100c15780634e71e0c8146100f4576100bc565b366100bc57005b600080fd5b3480156100cd57600080fd5b506100e16100dc366004611de0565b610217565b6040519081526020015b60405180910390f35b34801561010057600080fd5b506101096105b2565b005b34801561011757600080fd5b50610109610126366004611f50565b61064c565b34801561013757600080fd5b5061010961087d565b34801561014c57600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016100eb565b34801561017e57600080fd5b5061010961018d366004611da8565b610921565b34801561019e57600080fd5b506101b26101ad366004611e5a565b6109cf565b60405190151581526020016100eb565b3480156101ce57600080fd5b50610109610ce7565b3480156101e357600080fd5b5060015461015a906001600160a01b031681565b34801561020357600080fd5b50610109610212366004611da8565b610d93565b6000806001600160a01b0387167321be370d5312f44cb42ce377bc9b8a0cef1a4c83146102f5576040517f0494cd9a0000000000000000000000000000000000000000000000000000000081526001600160a01b0388811660048301527f00000000000000000000000000000000000000000000000000000000000000001690630494cd9a9060240160206040518083038186803b1580156102b857600080fd5b505afa1580156102cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f09190611dc4565b61030b565b73d528697008ac67a21818751a5e3c58c8dae546965b9050336001600160a01b03821614801561032d5750306001600160a01b038916145b6040518060400160405280600381526020016231313160e81b815250906103705760405162461bcd60e51b8152600401610367919061233e565b60405180910390fd5b506040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015286906001600160a01b038916906370a082319060240160206040518083038186803b1580156103cb57600080fd5b505afa1580156103df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061040391906120b1565b10156040518060400160405280600381526020017f3132370000000000000000000000000000000000000000000000000000000000815250906104595760405162461bcd60e51b8152600401610367919061233e565b50600061046884860186611faa565b90508060405160200161047b919061246b565b60405160208183030381529060405280519060200120600354146104e15760405162461bcd60e51b815260206004820152601260248201527f46616c736520656e74727920706f696e742100000000000000000000000000006044820152606401610367565b60006001600160a01b03801682602001516001600160a01b031614156105115761050a88610ee6565b508661052b565b606082015161052b906001600160a01b038b16908a610f6a565b61053782898984611040565b60208201516001600160a01b03908116141561055f5761055f61055a888a6125db565b61124e565b61057e8361056d898b6125db565b6001600160a01b038c16919061129d565b50506000600355507f7968ba28153757de2da7bce4c2ba9ebaf94445061f3050de1b0de5c34bb7d5d8979650505050505050565b6001546001600160a01b0316336001600160a01b0316146105d257600080fd5b6001546001600160a01b03166105f06000546001600160a01b031690565b6001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600260009054906101000a90046001600160a01b03166001600160a01b0316633018205f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561069a57600080fd5b505afa1580156106ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106d29190611dc4565b6001600160a01b0316336001600160a01b031614806107875750600260009054906101000a90046001600160a01b03166001600160a01b031663b8491a846040518163ffffffff1660e01b815260040160206040518083038186803b15801561073a57600080fd5b505afa15801561074e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107729190611dc4565b6001600160a01b0316336001600160a01b0316145b8061079c57506000546001600160a01b031633145b6040518060400160405280600381526020016231313160e81b815250906107d65760405162461bcd60e51b8152600401610367919061233e565b50816040516020016107e89190612351565b60408051601f19818403018152919052805160209091012060035560ff811661081957610814826113ce565b610879565b8060ff166002141561082e57610814826115aa565b604080518082018252600381527f31333100000000000000000000000000000000000000000000000000000000006020820152905162461bcd60e51b8152610367919060040161233e565b5050565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461097b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527fa05e64ea7e34b372177317c71229808e25bdbfe5dc3e6bc4fc7ca66c97d932769060200160405180910390a150565b6000336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610a1157506001600160a01b03841630145b6040518060400160405280600381526020016231313160e81b81525090610a4b5760405162461bcd60e51b8152600401610367919061233e565b506000610a5a83850185611faa565b905080604051602001610a6d919061246b565b6040516020818303038152906040528051906020012060035414610ad35760405162461bcd60e51b815260206004820152601260248201527f46616c736520656e74727920706f696e742100000000000000000000000000006044820152606401610367565b60006001600160a01b03801682602001516001600160a01b03161415610b2e57610b238a8a6000818110610b1757634e487b7160e01b600052603260045260246000fd5b90506020020135610ee6565b506040810151610ba4565b610ba482606001518b8b6000818110610b5757634e487b7160e01b600052603260045260246000fd5b905060200201358e8e6000818110610b7f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610b949190611da8565b6001600160a01b03169190610f6a565b610bfe828b8b6000818110610bc957634e487b7160e01b600052603260045260246000fd5b905060200201358a8a6000818110610bf157634e487b7160e01b600052603260045260246000fd5b9050602002013584611040565b610cd06001600160a01b03801683602001516001600160a01b0316148d8d6000818110610c3b57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c509190611da8565b8a8a6000818110610c7157634e487b7160e01b600052603260045260246000fd5b905060200201358d8d6000818110610c9957634e487b7160e01b600052603260045260246000fd5b90506020020135610caa91906125db565b7f0000000000000000000000000000000000000000000000000000000000000000611764565b505060006003555060019998505050505050505050565b6000546001600160a01b03163314610d415760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b6001546001600160a01b0316610d5657600080fd5b600180546001600160a01b03191690556040516000907f69737d41162474a7ca514809b07d7becaecf72eae8c23bceb071f0e09af93ffc908290a2565b6000546001600160a01b03163314610ded5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610367565b6001600160a01b038116610e435760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f742070617373207a65726f206164647265737321000000000000006044820152606401610367565b6001546001600160a01b031615610e9c5760405162461bcd60e51b815260206004820152601960248201527f546865726520697320612070656e64696e67206f776e657221000000000000006044820152606401610367565b600180546001600160a01b0319166001600160a01b0383169081179091556040517f69737d41162474a7ca514809b07d7becaecf72eae8c23bceb071f0e09af93ffc90600090a250565b6040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527321be370d5312f44cb42ce377bc9b8a0cef1a4c83908190632e1a7d4d90602401600060405180830381600087803b158015610f4e57600080fd5b505af1158015610f62573d6000803e3d6000fd5b505050505050565b801561103b57610f79836117ab565b15611027576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fcb576040519150601f19603f3d011682016040523d82523d6000602084013e610fd0565b606091505b50509050806110215760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f2073656e642045746865720000000000000000000000006044820152606401610367565b5061103b565b61103b6001600160a01b03841683836117d3565b505050565b60008451600281111561106357634e487b7160e01b600052602160045260246000fd5b14156110fd57606084015160808501516040517fcf4f44580000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152602481018690526044810185905291169063cf4f44589083906064015b6000604051808303818588803b1580156110df57600080fd5b505af11580156110f3573d6000803e3d6000fd5b5050505050611248565b60018451600281111561112057634e487b7160e01b600052602160045260246000fd5b14156111c9578361010001516001600160a01b0316639df97b04828660a0015160008151811061116057634e487b7160e01b600052603260045260246000fd5b602090810291909101015160608801516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b1681526001600160a01b0392831660048201529116602482015260448101879052606481018690526084016110c6565b8361010001516001600160a01b0316639c6ce5aa828660a001518760c001518860e00151896060015189896040518863ffffffff1660e01b8152600401611215969594939291906122ea565b6000604051808303818588803b15801561122e57600080fd5b505af1158015611242573d6000803e3d6000fd5b50505050505b50505050565b7321be370d5312f44cb42ce377bc9b8a0cef1a4c836001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015610f4e57600080fd5b6112a6836117ab565b156112f35760405162461bcd60e51b815260206004820152601560248201527f417070726f76652063616c6c6564206f6e2045544800000000000000000000006044820152606401610367565b806113125761130d6001600160a01b03841683600061187c565b61103b565b604051636eb1769f60e11b81523060048201526001600160a01b0383811660248301526000919085169063dd62ed3e9060440160206040518083038186803b15801561135d57600080fd5b505afa158015611371573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139591906120b1565b9050818110156112485780156113ba576113ba6001600160a01b03851684600061187c565b6112486001600160a01b038516848461187c565b6040805160018082528183019092527f0000000000000000000000000000000000000000000000000000000000000000913091600091602080830190803683370190505090506001600160a01b0361142c6040860160208701611da8565b6001600160a01b03161461144f5761144a6040850160208601611da8565b611465565b7321be370d5312f44cb42ce377bc9b8a0cef1a4c835b8160008151811061148657634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392909216602092830291909101909101526040805160018082528183019092526000918160200160208202803683370190505090508460400135816000815181106114e957634e487b7160e01b600052603260045260246000fd5b6020908102919091010152604080516001808252818301909252600091816020016020820280368337019050509050846001600160a01b031663ab9c4b5d85858585308c60405160200161153d9190612351565b60405160208183030381529060405260006040518863ffffffff1660e01b8152600401611570979695949392919061226b565b600060405180830381600087803b15801561158a57600080fd5b505af115801561159e573d6000803e3d6000fd5b50505050505050505050565b60006001600160a01b036115c46040840160208501611da8565b6001600160a01b0316146116a5576001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016630494cd9a6116116040850160208601611da8565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b15801561166857600080fd5b505afa15801561167c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a09190611dc4565b6116bb565b73d528697008ac67a21818751a5e3c58c8dae546965b90506000826040516020016116d09190612351565b60408051601f198184030181528282527f5cffe9de00000000000000000000000000000000000000000000000000000000835292506001600160a01b03841691635cffe9de9161172d91309182919089013590879060040161222f565b600060405180830381600087803b15801561174757600080fd5b505af115801561175b573d6000803e3d6000fd5b50505050505050565b8315611797576117738261124e565b6117927321be370d5312f44cb42ce377bc9b8a0cef1a4c83828461129d565b611248565b6112486001600160a01b038416828461129d565b60006001600160a01b03821615806117cb57506001600160a01b03828116145b90505b919050565b6040516001600160a01b03831660248201526044810182905261103b9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526119c0565b8015806119055750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b1580156118cb57600080fd5b505afa1580156118df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061190391906120b1565b155b6119775760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000006064820152608401610367565b6040516001600160a01b03831660248201526044810182905261103b9084907f095ea7b30000000000000000000000000000000000000000000000000000000090606401611818565b6000611a15826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611aa59092919063ffffffff16565b80519091501561103b5780806020019051810190611a339190611f30565b61103b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610367565b6060611ab48484600085611abe565b90505b9392505050565b606082471015611b365760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610367565b843b611b845760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610367565b600080866001600160a01b03168587604051611ba09190612213565b60006040518083038185875af1925050503d8060008114611bdd576040519150601f19603f3d011682016040523d82523d6000602084013e611be2565b606091505b5091509150611bf2828286611bfd565b979650505050505050565b60608315611c0c575081611ab7565b825115611c1c5782518084602001fd5b8160405162461bcd60e51b8152600401610367919061233e565b80356117ce81612641565b60008083601f840112611c52578182fd5b50813567ffffffffffffffff811115611c69578182fd5b6020830191508360208083028501011115611c8357600080fd5b9250929050565b600082601f830112611c9a578081fd5b81356020611caf611caa8361256f565b61253e565b8281528181019085830183850287018401881015611ccb578586fd5b855b85811015611cf2578135611ce081612641565b84529284019290840190600101611ccd565b5090979650505050505050565b600082601f830112611d0f578081fd5b81356020611d1f611caa8361256f565b8281528181019085830183850287018401881015611d3b578586fd5b855b85811015611cf257813584529284019290840190600101611d3d565b60008083601f840112611d6a578182fd5b50813567ffffffffffffffff811115611d81578182fd5b602083019150836020828501011115611c8357600080fd5b8035600381106117ce57600080fd5b600060208284031215611db9578081fd5b8135611ab781612641565b600060208284031215611dd5578081fd5b8151611ab781612641565b60008060008060008060a08789031215611df8578182fd5b8635611e0381612641565b95506020870135611e1381612641565b94506040870135935060608701359250608087013567ffffffffffffffff811115611e3c578283fd5b611e4889828a01611d59565b979a9699509497509295939492505050565b600080600080600080600080600060a08a8c031215611e77578283fd5b893567ffffffffffffffff80821115611e8e578485fd5b611e9a8d838e01611c41565b909b50995060208c0135915080821115611eb2578485fd5b611ebe8d838e01611c41565b909950975060408c0135915080821115611ed6578485fd5b611ee28d838e01611c41565b909750955060608c01359150611ef782612641565b90935060808b01359080821115611f0c578384fd5b50611f198c828d01611d59565b915080935050809150509295985092959850929598565b600060208284031215611f41578081fd5b81518015158114611ab7578182fd5b60008060408385031215611f62578182fd5b823567ffffffffffffffff811115611f78578283fd5b83016101208186031215611f8a578283fd5b9150602083013560ff81168114611f9f578182fd5b809150509250929050565b600060208284031215611fbb578081fd5b813567ffffffffffffffff80821115611fd2578283fd5b8184019150610120808387031215611fe8578384fd5b611ff18161253e565b9050611ffc83611d99565b815261200a60208401611c36565b60208201526040830135604082015261202560608401611c36565b606082015261203660808401611c36565b608082015260a08301358281111561204c578485fd5b61205887828601611c8a565b60a08301525060c08301358281111561206f578485fd5b61207b87828601611cff565b60c08301525061208d60e08401611c36565b60e082015261010091506120a2828401611c36565b91810191909152949350505050565b6000602082840312156120c2578081fd5b5051919050565b60008284526020808501945082825b858110156121065781356120eb81612641565b6001600160a01b0316875295820195908201906001016120d8565b509495945050505050565b6000815180845260208085019450808401835b838110156121065781516001600160a01b031687529582019590820190600101612124565b60008284527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83111561217a578081fd5b6020830280836020870137939093016020019283525090919050565b6000815180845260208085019450808401835b83811015612106578151875295820195908201906001016121a9565b600081518084526121dd8160208601602086016125ff565b601f01601f19169290920160200192915050565b6003811061220f57634e487b7160e01b600052602160045260246000fd5b9052565b600082516122258184602087016125ff565b9190910192915050565b60006001600160a01b0380871683528086166020840152508360408301526080606083015261226160808301846121c5565b9695505050505050565b60006001600160a01b03808a16835260e0602084015261228e60e084018a612111565b83810360408501526122a0818a612196565b905083810360608501526122b48189612196565b9050818716608085015283810360a08501526122d081876121c5565b9250505061ffff831660c083015298975050505050505050565b600060c082526122fd60c0830189612111565b828103602084015261230f8189612196565b6001600160a01b03978816604085015295909616606083015250608081019290925260a0909101529392505050565b600060208252611ab760208301846121c5565b60006020825261236c6020830161236785611d99565b6121f1565b61237860208401611c36565b6001600160a01b0381166040840152506040830135606083015261239e60608401611c36565b6001600160a01b0381166080840152506123ba60808401611c36565b6001600160a01b03811660a0840152506123d760a0840184612593565b6101208060c08601526123ef610140860183856120c9565b92506123fe60c0870187612593565b868503601f190160e08801529250612417848483612149565b93505061242660e08701611c36565b915061010061243f818701846001600160a01b03169052565b61244a818801611c36565b925050612461818601836001600160a01b03169052565b5090949350505050565b60006020825261247f6020830184516121f1565b60208301516001600160a01b0381166040840152506040830151606083015260608301516124b860808401826001600160a01b03169052565b5060808301516001600160a01b03811660a08401525060a08301516101208060c08501526124ea610140850183612111565b915060c0850151601f198584030160e08601526125078382612196565b92505060e0850151610100612526818701836001600160a01b03169052565b8601516001600160a01b038116838701529050612461565b604051601f8201601f1916810167ffffffffffffffff811182821017156125675761256761262b565b604052919050565b600067ffffffffffffffff8211156125895761258961262b565b5060209081020190565b6000808335601e198436030181126125a9578283fd5b830160208101925035905067ffffffffffffffff8111156125c957600080fd5b602081023603831315611c8357600080fd5b600082198211156125fa57634e487b7160e01b81526011600452602481fd5b500190565b60005b8381101561261a578181015183820152602001612602565b838111156112485750506000910152565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461265657600080fd5b5056fea2646970667358221220ad447be722b6b8ddce3dff7f6a3a10111c1552e82a2afa7bab93f7b0669ba2b064736f6c63430008020033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Validator ID :
0 FTM

Amount Staked
0

Amount Delegated
0

Staking Total
0

Staking Start Epoch
0

Staking Start Time
0

Proof of Importance
0

Origination Score
0

Validation Score
0

Active
0

Online
0

Downtime
0 s
Address Amount claimed Rewards Created On Epoch Created On
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.