Source Code
Overview
ETH Balance
0 ETH
Token Holdings
More Info
ContractCreator
Multi Chain
Multichain Addresses
0 address found via
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0x60e06040 | 8376508 | 316 days 3 hrs ago | IN | Create: GhoFlashMinter | 0 ETH | 0.00186679 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472527 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8472508 | 299 days 18 hrs ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464995 | 301 days 1 hr ago | 0 ETH | ||||
8464992 | 301 days 1 hr ago | 0 ETH |
Loading...
Loading
Contract Name:
GhoFlashMinter
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IACLManager} from '@aave/core-v3/contracts/interfaces/IACLManager.sol'; import {IPoolAddressesProvider} from '@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol'; import {PercentageMath} from '@aave/core-v3/contracts/protocol/libraries/math/PercentageMath.sol'; import {IERC3156FlashBorrower} from '@openzeppelin/contracts/interfaces/IERC3156FlashBorrower.sol'; import {IERC3156FlashLender} from '@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol'; import {IGhoToken} from '../../gho/interfaces/IGhoToken.sol'; import {IGhoFacilitator} from '../../gho/interfaces/IGhoFacilitator.sol'; import {IGhoFlashMinter} from './interfaces/IGhoFlashMinter.sol'; /** * @title GhoFlashMinter * @author Aave * @notice Contract that enables FlashMinting of GHO. * @dev Based heavily on the EIP3156 reference implementation */ contract GhoFlashMinter is IGhoFlashMinter { using PercentageMath for uint256; /** * @dev Hash of `ERC3156FlashBorrower.onFlashLoan` that must be returned by `onFlashLoan` callback */ bytes32 public constant CALLBACK_SUCCESS = keccak256('ERC3156FlashBorrower.onFlashLoan'); // @inheritdoc IGhoFlashMinter IPoolAddressesProvider public immutable override ADDRESSES_PROVIDER; // @inheritdoc IGhoFlashMinter uint256 public constant MAX_FEE = 10000; IACLManager private immutable _aclManager; IGhoToken private immutable GHO_TOKEN; /** * @dev Percentage fee of the flash-minted amount used to calculate the flash fee to charge * Expressed in bps. A value of 100 results in 1.00% */ uint256 private _fee; address private _ghoTreasury; /** * @dev Only pool admin can call functions marked by this modifier. */ modifier onlyPoolAdmin() { require(_aclManager.isPoolAdmin(msg.sender), 'CALLER_NOT_POOL_ADMIN'); _; } /** * @dev Constructor * @param ghoToken The address of the GHO token contract * @param ghoTreasury The address of the GHO treasury * @param fee The percentage of the flash-mint amount that needs to be repaid, on top of the principal (in bps) * @param addressesProvider The address of the Aave PoolAddressesProvider */ constructor( address ghoToken, address ghoTreasury, uint256 fee, address addressesProvider ) { require(fee <= MAX_FEE, 'FlashMinter: Fee out of range'); GHO_TOKEN = IGhoToken(ghoToken); _ghoTreasury = ghoTreasury; _fee = fee; ADDRESSES_PROVIDER = IPoolAddressesProvider(addressesProvider); _aclManager = IACLManager(IPoolAddressesProvider(addressesProvider).getACLManager()); } /// @inheritdoc IERC3156FlashLender function maxFlashLoan(address token) external view override returns (uint256) { if (token != address(GHO_TOKEN)) { return 0; } else { IGhoToken.Facilitator memory flashMinterFacilitator = GHO_TOKEN.getFacilitator(address(this)); return flashMinterFacilitator.bucketCapacity - flashMinterFacilitator.bucketLevel; } } /// @inheritdoc IERC3156FlashLender function flashLoan( IERC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data ) external override returns (bool) { require(token == address(GHO_TOKEN), 'FlashMinter: Unsupported currency'); uint256 fee = _aclManager.isFlashBorrower(msg.sender) ? 0 : _flashFee(amount); GHO_TOKEN.mint(address(receiver), amount); require( receiver.onFlashLoan(msg.sender, address(GHO_TOKEN), amount, fee, data) == CALLBACK_SUCCESS, 'FlashMinter: Callback failed' ); GHO_TOKEN.transferFrom(address(receiver), address(this), amount + fee); GHO_TOKEN.burn(amount); emit FlashMint(address(receiver), msg.sender, address(GHO_TOKEN), amount, fee); return true; } /// @inheritdoc IERC3156FlashLender function flashFee(address token, uint256 amount) external view override returns (uint256) { require(token == address(GHO_TOKEN), 'FlashMinter: Unsupported currency'); return _aclManager.isFlashBorrower(msg.sender) ? 0 : _flashFee(amount); } /// @inheritdoc IGhoFacilitator function distributeFeesToTreasury() external virtual override { uint256 balance = GHO_TOKEN.balanceOf(address(this)); GHO_TOKEN.transfer(_ghoTreasury, balance); emit FeesDistributedToTreasury(_ghoTreasury, address(GHO_TOKEN), balance); } // @inheritdoc IGhoFlashMinter function updateFee(uint256 newFee) external onlyPoolAdmin { require(newFee <= MAX_FEE, 'FlashMinter: Fee out of range'); uint256 oldFee = _fee; _fee = newFee; emit FeeUpdated(oldFee, newFee); } /// @inheritdoc IGhoFlashMinter function getFee() external view returns (uint256) { return _fee; } /// @inheritdoc IGhoFacilitator function updateGhoTreasury(address newGhoTreasury) external override onlyPoolAdmin { address oldGhoTreasury = _ghoTreasury; _ghoTreasury = newGhoTreasury; emit GhoTreasuryUpdated(oldGhoTreasury, newGhoTreasury); } /// @inheritdoc IGhoFacilitator function getGhoTreasury() external view returns (address) { return _ghoTreasury; } /** * @notice Returns the fee to charge for a given flashloan. * @dev Internal function with no checks. * @param amount The amount of tokens to be borrowed. * @return The amount of `token` to be charged for the flashloan, on top of the returned principal. */ function _flashFee(uint256 amount) internal view returns (uint256) { return amount.percentMul(_fee); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.0; import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol'; /** * @title IACLManager * @author Aave * @notice Defines the basic interface for the ACL Manager */ interface IACLManager { /** * @notice Returns the contract address of the PoolAddressesProvider * @return The address of the PoolAddressesProvider */ function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); /** * @notice Returns the identifier of the PoolAdmin role * @return The id of the PoolAdmin role */ function POOL_ADMIN_ROLE() external view returns (bytes32); /** * @notice Returns the identifier of the EmergencyAdmin role * @return The id of the EmergencyAdmin role */ function EMERGENCY_ADMIN_ROLE() external view returns (bytes32); /** * @notice Returns the identifier of the RiskAdmin role * @return The id of the RiskAdmin role */ function RISK_ADMIN_ROLE() external view returns (bytes32); /** * @notice Returns the identifier of the FlashBorrower role * @return The id of the FlashBorrower role */ function FLASH_BORROWER_ROLE() external view returns (bytes32); /** * @notice Returns the identifier of the Bridge role * @return The id of the Bridge role */ function BRIDGE_ROLE() external view returns (bytes32); /** * @notice Returns the identifier of the AssetListingAdmin role * @return The id of the AssetListingAdmin role */ function ASSET_LISTING_ADMIN_ROLE() external view returns (bytes32); /** * @notice Set the role as admin of a specific role. * @dev By default the admin role for all roles is `DEFAULT_ADMIN_ROLE`. * @param role The role to be managed by the admin role * @param adminRole The admin role */ function setRoleAdmin(bytes32 role, bytes32 adminRole) external; /** * @notice Adds a new admin as PoolAdmin * @param admin The address of the new admin */ function addPoolAdmin(address admin) external; /** * @notice Removes an admin as PoolAdmin * @param admin The address of the admin to remove */ function removePoolAdmin(address admin) external; /** * @notice Returns true if the address is PoolAdmin, false otherwise * @param admin The address to check * @return True if the given address is PoolAdmin, false otherwise */ function isPoolAdmin(address admin) external view returns (bool); /** * @notice Adds a new admin as EmergencyAdmin * @param admin The address of the new admin */ function addEmergencyAdmin(address admin) external; /** * @notice Removes an admin as EmergencyAdmin * @param admin The address of the admin to remove */ function removeEmergencyAdmin(address admin) external; /** * @notice Returns true if the address is EmergencyAdmin, false otherwise * @param admin The address to check * @return True if the given address is EmergencyAdmin, false otherwise */ function isEmergencyAdmin(address admin) external view returns (bool); /** * @notice Adds a new admin as RiskAdmin * @param admin The address of the new admin */ function addRiskAdmin(address admin) external; /** * @notice Removes an admin as RiskAdmin * @param admin The address of the admin to remove */ function removeRiskAdmin(address admin) external; /** * @notice Returns true if the address is RiskAdmin, false otherwise * @param admin The address to check * @return True if the given address is RiskAdmin, false otherwise */ function isRiskAdmin(address admin) external view returns (bool); /** * @notice Adds a new address as FlashBorrower * @param borrower The address of the new FlashBorrower */ function addFlashBorrower(address borrower) external; /** * @notice Removes an address as FlashBorrower * @param borrower The address of the FlashBorrower to remove */ function removeFlashBorrower(address borrower) external; /** * @notice Returns true if the address is FlashBorrower, false otherwise * @param borrower The address to check * @return True if the given address is FlashBorrower, false otherwise */ function isFlashBorrower(address borrower) external view returns (bool); /** * @notice Adds a new address as Bridge * @param bridge The address of the new Bridge */ function addBridge(address bridge) external; /** * @notice Removes an address as Bridge * @param bridge The address of the bridge to remove */ function removeBridge(address bridge) external; /** * @notice Returns true if the address is Bridge, false otherwise * @param bridge The address to check * @return True if the given address is Bridge, false otherwise */ function isBridge(address bridge) external view returns (bool); /** * @notice Adds a new admin as AssetListingAdmin * @param admin The address of the new admin */ function addAssetListingAdmin(address admin) external; /** * @notice Removes an admin as AssetListingAdmin * @param admin The address of the admin to remove */ function removeAssetListingAdmin(address admin) external; /** * @notice Returns true if the address is AssetListingAdmin, false otherwise * @param admin The address to check * @return True if the given address is AssetListingAdmin, false otherwise */ function isAssetListingAdmin(address admin) external view returns (bool); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.0; /** * @title IPoolAddressesProvider * @author Aave * @notice Defines the basic interface for a Pool Addresses Provider. */ interface IPoolAddressesProvider { /** * @dev Emitted when the market identifier is updated. * @param oldMarketId The old id of the market * @param newMarketId The new id of the market */ event MarketIdSet(string indexed oldMarketId, string indexed newMarketId); /** * @dev Emitted when the pool is updated. * @param oldAddress The old address of the Pool * @param newAddress The new address of the Pool */ event PoolUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the pool configurator is updated. * @param oldAddress The old address of the PoolConfigurator * @param newAddress The new address of the PoolConfigurator */ event PoolConfiguratorUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the price oracle is updated. * @param oldAddress The old address of the PriceOracle * @param newAddress The new address of the PriceOracle */ event PriceOracleUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the ACL manager is updated. * @param oldAddress The old address of the ACLManager * @param newAddress The new address of the ACLManager */ event ACLManagerUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the ACL admin is updated. * @param oldAddress The old address of the ACLAdmin * @param newAddress The new address of the ACLAdmin */ event ACLAdminUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the price oracle sentinel is updated. * @param oldAddress The old address of the PriceOracleSentinel * @param newAddress The new address of the PriceOracleSentinel */ event PriceOracleSentinelUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the pool data provider is updated. * @param oldAddress The old address of the PoolDataProvider * @param newAddress The new address of the PoolDataProvider */ event PoolDataProviderUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when a new proxy is created. * @param id The identifier of the proxy * @param proxyAddress The address of the created proxy contract * @param implementationAddress The address of the implementation contract */ event ProxyCreated( bytes32 indexed id, address indexed proxyAddress, address indexed implementationAddress ); /** * @dev Emitted when a new non-proxied contract address is registered. * @param id The identifier of the contract * @param oldAddress The address of the old contract * @param newAddress The address of the new contract */ event AddressSet(bytes32 indexed id, address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the implementation of the proxy registered with id is updated * @param id The identifier of the contract * @param proxyAddress The address of the proxy contract * @param oldImplementationAddress The address of the old implementation contract * @param newImplementationAddress The address of the new implementation contract */ event AddressSetAsProxy( bytes32 indexed id, address indexed proxyAddress, address oldImplementationAddress, address indexed newImplementationAddress ); /** * @notice Returns the id of the Aave market to which this contract points to. * @return The market id */ function getMarketId() external view returns (string memory); /** * @notice Associates an id with a specific PoolAddressesProvider. * @dev This can be used to create an onchain registry of PoolAddressesProviders to * identify and validate multiple Aave markets. * @param newMarketId The market id */ function setMarketId(string calldata newMarketId) external; /** * @notice Returns an address by its identifier. * @dev The returned address might be an EOA or a contract, potentially proxied * @dev It returns ZERO if there is no registered address with the given id * @param id The id * @return The address of the registered for the specified id */ function getAddress(bytes32 id) external view returns (address); /** * @notice General function to update the implementation of a proxy registered with * certain `id`. If there is no proxy registered, it will instantiate one and * set as implementation the `newImplementationAddress`. * @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit * setter function, in order to avoid unexpected consequences * @param id The id * @param newImplementationAddress The address of the new implementation */ function setAddressAsProxy(bytes32 id, address newImplementationAddress) external; /** * @notice Sets an address for an id replacing the address saved in the addresses map. * @dev IMPORTANT Use this function carefully, as it will do a hard replacement * @param id The id * @param newAddress The address to set */ function setAddress(bytes32 id, address newAddress) external; /** * @notice Returns the address of the Pool proxy. * @return The Pool proxy address */ function getPool() external view returns (address); /** * @notice Updates the implementation of the Pool, or creates a proxy * setting the new `pool` implementation when the function is called for the first time. * @param newPoolImpl The new Pool implementation */ function setPoolImpl(address newPoolImpl) external; /** * @notice Returns the address of the PoolConfigurator proxy. * @return The PoolConfigurator proxy address */ function getPoolConfigurator() external view returns (address); /** * @notice Updates the implementation of the PoolConfigurator, or creates a proxy * setting the new `PoolConfigurator` implementation when the function is called for the first time. * @param newPoolConfiguratorImpl The new PoolConfigurator implementation */ function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external; /** * @notice Returns the address of the price oracle. * @return The address of the PriceOracle */ function getPriceOracle() external view returns (address); /** * @notice Updates the address of the price oracle. * @param newPriceOracle The address of the new PriceOracle */ function setPriceOracle(address newPriceOracle) external; /** * @notice Returns the address of the ACL manager. * @return The address of the ACLManager */ function getACLManager() external view returns (address); /** * @notice Updates the address of the ACL manager. * @param newAclManager The address of the new ACLManager */ function setACLManager(address newAclManager) external; /** * @notice Returns the address of the ACL admin. * @return The address of the ACL admin */ function getACLAdmin() external view returns (address); /** * @notice Updates the address of the ACL admin. * @param newAclAdmin The address of the new ACL admin */ function setACLAdmin(address newAclAdmin) external; /** * @notice Returns the address of the price oracle sentinel. * @return The address of the PriceOracleSentinel */ function getPriceOracleSentinel() external view returns (address); /** * @notice Updates the address of the price oracle sentinel. * @param newPriceOracleSentinel The address of the new PriceOracleSentinel */ function setPriceOracleSentinel(address newPriceOracleSentinel) external; /** * @notice Returns the address of the data provider. * @return The address of the DataProvider */ function getPoolDataProvider() external view returns (address); /** * @notice Updates the address of the data provider. * @param newDataProvider The address of the new DataProvider */ function setPoolDataProvider(address newDataProvider) external; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; /** * @title PercentageMath library * @author Aave * @notice Provides functions to perform percentage calculations * @dev Percentages are defined by default with 2 decimals of precision (100.00). The precision is indicated by PERCENTAGE_FACTOR * @dev Operations are rounded. If a value is >=.5, will be rounded up, otherwise rounded down. */ library PercentageMath { // Maximum percentage factor (100.00%) uint256 internal constant PERCENTAGE_FACTOR = 1e4; // Half percentage factor (50.00%) uint256 internal constant HALF_PERCENTAGE_FACTOR = 0.5e4; /** * @notice Executes a percentage multiplication * @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328 * @param value The value of which the percentage needs to be calculated * @param percentage The percentage of the value to be calculated * @return result value percentmul percentage */ function percentMul(uint256 value, uint256 percentage) internal pure returns (uint256 result) { // to avoid overflow, value <= (type(uint256).max - HALF_PERCENTAGE_FACTOR) / percentage assembly { if iszero( or( iszero(percentage), iszero(gt(value, div(sub(not(0), HALF_PERCENTAGE_FACTOR), percentage))) ) ) { revert(0, 0) } result := div(add(mul(value, percentage), HALF_PERCENTAGE_FACTOR), PERCENTAGE_FACTOR) } } /** * @notice Executes a percentage division * @dev assembly optimized for improved gas savings, see https://twitter.com/transmissions11/status/1451131036377571328 * @param value The value of which the percentage needs to be calculated * @param percentage The percentage of the value to be calculated * @return result value percentdiv percentage */ function percentDiv(uint256 value, uint256 percentage) internal pure returns (uint256 result) { // to avoid overflow, value <= (type(uint256).max - halfPercentage) / PERCENTAGE_FACTOR assembly { if or( iszero(percentage), iszero(iszero(gt(value, div(sub(not(0), div(percentage, 2)), PERCENTAGE_FACTOR)))) ) { revert(0, 0) } result := div(add(mul(value, PERCENTAGE_FACTOR), div(percentage, 2)), percentage) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (interfaces/IERC3156FlashBorrower.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC3156 FlashBorrower, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. * * _Available since v4.1._ */ interface IERC3156FlashBorrower { /** * @dev Receive a flash loan. * @param initiator The initiator of the loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @param fee The additional amount of tokens to repay. * @param data Arbitrary data structure, intended to contain user-defined parameters. * @return The keccak256 hash of "IERC3156FlashBorrower.onFlashLoan" */ function onFlashLoan( address initiator, address token, uint256 amount, uint256 fee, bytes calldata data ) external returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC3156FlashLender.sol) pragma solidity ^0.8.0; import "./IERC3156FlashBorrower.sol"; /** * @dev Interface of the ERC3156 FlashLender, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. * * _Available since v4.1._ */ interface IERC3156FlashLender { /** * @dev The amount of currency available to be lended. * @param token The loan currency. * @return The amount of `token` that can be borrowed. */ function maxFlashLoan(address token) external view returns (uint256); /** * @dev The fee to be charged for a given loan. * @param token The loan currency. * @param amount The amount of tokens lent. * @return The amount of `token` to be charged for the loan, on top of the returned principal. */ function flashFee(address token, uint256 amount) external view returns (uint256); /** * @dev Initiate a flash loan. * @param receiver The receiver of the tokens in the loan, and the receiver of the callback. * @param token The loan currency. * @param amount The amount of tokens lent. * @param data Arbitrary data structure, intended to contain user-defined parameters. */ function flashLoan( IERC3156FlashBorrower receiver, address token, uint256 amount, bytes calldata data ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.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); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC3156FlashLender} from '@openzeppelin/contracts/interfaces/IERC3156FlashLender.sol'; import {IPoolAddressesProvider} from '@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol'; import {IGhoFacilitator} from '../../../gho/interfaces/IGhoFacilitator.sol'; /** * @title IGhoFlashMinter * @author Aave * @notice Defines the behavior of the GHO Flash Minter */ interface IGhoFlashMinter is IERC3156FlashLender, IGhoFacilitator { /** * @dev Emitted when the percentage fee is updated * @param oldFee The old fee (in bps) * @param newFee The new fee (in bps) */ event FeeUpdated(uint256 oldFee, uint256 newFee); /** * @dev Emitted when a FlashMint occurs * @param receiver The receiver of the FlashMinted tokens (it is also the receiver of the callback) * @param initiator The address initiating the FlashMint * @param asset The asset being FlashMinted. Always GHO. * @param amount The principal being FlashMinted * @param fee The fee returned on top of the principal */ event FlashMint( address indexed receiver, address indexed initiator, address asset, uint256 indexed amount, uint256 fee ); /** * @notice Returns the address of the Aave Pool Addresses Provider contract * @return The address of the PoolAddressesProvider */ function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); /** * @notice Returns the maximum value the fee can be set to * @return The maximum percentage fee of the flash-minted amount that the flashFee can be set to (in bps). */ function MAX_FEE() external view returns (uint256); /** * @notice Updates the percentage fee. It is the percentage of the flash-minted amount that needs to be repaid. * @dev The fee is expressed in bps. A value of 100, results in 1.00% * @param newFee The new percentage fee (in bps) */ function updateFee(uint256 newFee) external; /** * @notice Returns the percentage of each flash mint taken as a fee * @return The percentage fee of the flash-minted amount that needs to be repaid, on top of the principal (in bps). */ function getFee() external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of a burnable erc-20 token */ interface IERC20Burnable { /** * @dev Destroys `amount` tokens from caller * @param amount The amount of tokens to destroy */ function burn(uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of a mintable erc-20 token */ interface IERC20Mintable { /** * @dev Creates `amount` new tokens for `account` * @param account The address to create tokens for * @param amount The amount of tokens to create */ function mint(address account, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IGhoFacilitator * @author Aave * @notice Defines the behavior of a Gho Facilitator */ interface IGhoFacilitator { /** * @dev Emitted when fees are distributed to the GhoTreasury * @param ghoTreasury The address of the ghoTreasury * @param asset The address of the asset transferred to the ghoTreasury * @param amount The amount of the asset transferred to the ghoTreasury */ event FeesDistributedToTreasury( address indexed ghoTreasury, address indexed asset, uint256 amount ); /** * @dev Emitted when Gho Treasury address is updated * @param oldGhoTreasury The address of the old GhoTreasury contract * @param newGhoTreasury The address of the new GhoTreasury contract */ event GhoTreasuryUpdated(address indexed oldGhoTreasury, address indexed newGhoTreasury); /** * @notice Distribute fees to the GhoTreasury */ function distributeFeesToTreasury() external; /** * @notice Updates the address of the Gho Treasury * @dev WARNING: The GhoTreasury is where revenue fees are sent to. Update carefully * @param newGhoTreasury The address of the GhoTreasury */ function updateGhoTreasury(address newGhoTreasury) external; /** * @notice Returns the address of the Gho Treasury * @return The address of the GhoTreasury contract */ function getGhoTreasury() external view returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {IERC20Burnable} from './IERC20Burnable.sol'; import {IERC20Mintable} from './IERC20Mintable.sol'; /** * @title IGhoToken * @author Aave */ interface IGhoToken is IERC20Burnable, IERC20Mintable, IERC20 { struct Facilitator { uint128 bucketCapacity; uint128 bucketLevel; string label; } /** * @dev Emitted when a new facilitator is added * @param facilitatorAddress The address of the new facilitator * @param label A hashed human readable identifier for the facilitator * @param bucketCapacity The initial capacity of the facilitator's bucket */ event FacilitatorAdded( address indexed facilitatorAddress, bytes32 indexed label, uint256 bucketCapacity ); /** * @dev Emitted when a facilitator is removed * @param facilitatorAddress The address of the removed facilitator */ event FacilitatorRemoved(address indexed facilitatorAddress); /** * @dev Emitted when the bucket capacity of a facilitator is updated * @param facilitatorAddress The address of the facilitator whose bucket capacity is being changed * @param oldCapacity The old capacity of the bucket * @param newCapacity The new capacity of the bucket */ event FacilitatorBucketCapacityUpdated( address indexed facilitatorAddress, uint256 oldCapacity, uint256 newCapacity ); /** * @dev Emitted when the bucket level changed * @param facilitatorAddress The address of the facilitator whose bucket level is being changed * @param oldLevel The old level of the bucket * @param newLevel The new level of the bucket */ event FacilitatorBucketLevelUpdated( address indexed facilitatorAddress, uint256 oldLevel, uint256 newLevel ); /** * @notice Add the facilitator passed with the parameters to the facilitators list. * @param facilitatorAddress The address of the facilitator to add * @param facilitatorConfig The configuration of the facilitator */ function addFacilitator(address facilitatorAddress, Facilitator memory facilitatorConfig) external; /** * @notice Remove the facilitator from the facilitators list. * @param facilitatorAddress The address of the facilitator to remove */ function removeFacilitator(address facilitatorAddress) external; /** * @notice Set the bucket capacity of the facilitator. * @param facilitator The address of the facilitator * @param newCapacity The new capacity of the bucket */ function setFacilitatorBucketCapacity(address facilitator, uint128 newCapacity) external; /** * @notice Returns the facilitator data * @param facilitator The address of the facilitator * @return The facilitator configuration */ function getFacilitator(address facilitator) external view returns (Facilitator memory); /** * @notice Returns the bucket configuration of the facilitator * @param facilitator The address of the facilitator * @return The capacity of the facilitator's bucket * @return The level of the facilitator's bucket */ function getFacilitatorBucket(address facilitator) external view returns (uint256, uint256); /** * @notice Returns the list of the addresses of the active facilitator * @return The list of the facilitators addresses */ function getFacilitatorsList() external view returns (address[] memory); }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 100000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
[{"inputs":[{"internalType":"address","name":"ghoToken","type":"address"},{"internalType":"address","name":"ghoTreasury","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"address","name":"addressesProvider","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"FeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"ghoTreasury","type":"address"},{"indexed":true,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesDistributedToTreasury","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"initiator","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"FlashMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldGhoTreasury","type":"address"},{"indexed":true,"internalType":"address","name":"newGhoTreasury","type":"address"}],"name":"GhoTreasuryUpdated","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract IPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CALLBACK_SUCCESS","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeFeesToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC3156FlashBorrower","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGhoTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"maxFlashLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"updateFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGhoTreasury","type":"address"}],"name":"updateGhoTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60e06040523480156200001157600080fd5b506040516200170f3803806200170f83398101604081905262000034916200014f565b6127108211156200008b5760405162461bcd60e51b815260206004820152601d60248201527f466c6173684d696e7465723a20466565206f7574206f662072616e6765000000604482015260640160405180910390fd5b6001600160a01b0384811660c052600180546001600160a01b0319168583161790556000839055811660808190526040805163383e6b8b60e11b8152905163707cd716916004808201926020929091908290030181865afa158015620000f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200011b9190620001a3565b6001600160a01b031660a05250620001c892505050565b80516001600160a01b03811681146200014a57600080fd5b919050565b600080600080608085870312156200016657600080fd5b620001718562000132565b9350620001816020860162000132565b925060408501519150620001986060860162000132565b905092959194509250565b600060208284031215620001b657600080fd5b620001c18262000132565b9392505050565b60805160a05160c0516114b662000259600039600081816103900152818161057e0152818161064a0152818161073b01528181610839015281816108c301528181610932015281816109bc01528181610c5801528181610e2c01528181610efe0152610f8c01526000818161022a0152818161049a01528181610abd0152610d5f0152600060d301526114b66000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80639012c4a811610081578063d9d98ce41161005b578063d9d98ce4146101c3578063dc49a07b146101d6578063e28178cc146101de57600080fd5b80639012c4a81461019f578063bc063e1a146101b2578063ced72f87146101bb57600080fd5b80635cffe9de116100b25780635cffe9de14610134578063613255ab146101575780638237e5381461017857600080fd5b80630542975c146100ce5780631fde40bb1461011f575b600080fd5b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013261012d36600461105d565b6101fc565b005b61014761014236600461107a565b61038c565b6040519015158152602001610116565b61016a61016536600461105d565b61092e565b604051908152602001610116565b61016a7f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd981565b6101326101ad366004611119565b610a8f565b61016a61271081565b60005461016a565b61016a6101d1366004611132565b610c54565b610132610dfb565b60015473ffffffffffffffffffffffffffffffffffffffff166100f5565b6040517f7be53ca10000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690637be53ca190602401602060405180830381865afa158015610286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102aa919061115e565b610315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43414c4c45525f4e4f545f504f4f4c5f41444d494e000000000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f13f4413d8d93a259bd6c10f35095371f30ed50f81a73407e52e9f02000d5d16b90600090a35050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f466c6173684d696e7465723a20556e737570706f727465642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015260840161030c565b6040517ffa50f2970000000000000000000000000000000000000000000000000000000081523360048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063fa50f29790602401602060405180830381865afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a919061115e565b61052c5761052785610fe0565b61052f565b60005b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018890529192507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f1990604401600060405180830381600087803b1580156105c457600080fd5b505af11580156105d8573d6000803e3d6000fd5b50506040517f23e30c8b0000000000000000000000000000000000000000000000000000000081527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9925073ffffffffffffffffffffffffffffffffffffffff8a1691506323e30c8b9061067a9033907f0000000000000000000000000000000000000000000000000000000000000000908b9088908c908c90600401611180565b6020604051808303816000875af1158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd9190611206565b14610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f466c6173684d696e7465723a2043616c6c6261636b206661696c656400000000604482015260640161030c565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166323b872dd883061076c858a61124e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af11580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610809919061115e565b506040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081168252602082018690528994503393508b16917f9c1558194024d73db1b6fc2739c3070cacc4598122100dd6f7d3a3dd8cee5f36910160405180910390a45060019695505050505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461098b57506000919050565b6040517fd46ec0ed0000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063d46ec0ed90602401600060405180830381865afa158015610a18573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a5e919081019061132d565b60208101518151919250610a719161144f565b6fffffffffffffffffffffffffffffffff169392505050565b919050565b6040517f7be53ca10000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690637be53ca190602401602060405180830381865afa158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d919061115e565b610ba3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43414c4c45525f4e4f545f504f4f4c5f41444d494e0000000000000000000000604482015260640161030c565b612710811115610c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f466c6173684d696e7465723a20466565206f7574206f662072616e6765000000604482015260640161030c565b600080549082905560408051828152602081018490527f528d9479e9f9889a87a3c30c7f7ba537e5e59c4c85a37733b16e57c62df61302910160405180910390a15050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f466c6173684d696e7465723a20556e737570706f727465642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015260840161030c565b6040517ffa50f2970000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063fa50f29790602401602060405180830381865afa158015610dbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddf919061115e565b610df157610dec82610fe0565b610df4565b60005b9392505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610e88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eac9190611206565b6001546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018390529192507f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb906044016020604051808303816000875af1158015610f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6b919061115e565b5060015460405182815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000081169216907fb29fcda740927812f5a71075b62e132bead3769a455319c29b9a1cc461a654759060200160405180910390a350565b60008054610fef908390610ff5565b92915050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec778390048411151761102a57600080fd5b506127109102611388010490565b73ffffffffffffffffffffffffffffffffffffffff8116811461105a57600080fd5b50565b60006020828403121561106f57600080fd5b8135610df481611038565b60008060008060006080868803121561109257600080fd5b853561109d81611038565b945060208601356110ad81611038565b935060408601359250606086013567ffffffffffffffff808211156110d157600080fd5b818801915088601f8301126110e557600080fd5b8135818111156110f457600080fd5b89602082850101111561110657600080fd5b9699959850939650602001949392505050565b60006020828403121561112b57600080fd5b5035919050565b6000806040838503121561114557600080fd5b823561115081611038565b946020939093013593505050565b60006020828403121561117057600080fd5b81518015158114610df457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015284606083015260a060808301528260a0830152828460c0840137600060c0848401015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501168301019050979650505050505050565b60006020828403121561121857600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156112615761126161121f565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156112b8576112b8611266565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561130557611305611266565b604052919050565b80516fffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b6000602080838503121561134057600080fd5b825167ffffffffffffffff8082111561135857600080fd5b908401906060828703121561136c57600080fd5b611374611295565b61137d8361130d565b815261138a84840161130d565b848201526040830151828111156113a057600080fd5b80840193505086601f8401126113b557600080fd5b8251828111156113c7576113c7611266565b6113f7857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016112be565b9250808352878582860101111561140d57600080fd5b60005b8181101561142b578481018601518482018701528501611410565b8181111561143c5760008683860101525b5050604081019190915295945050505050565b60006fffffffffffffffffffffffffffffffff838116908316818110156114785761147861121f565b03939250505056fea26469706673582212205050289a7c0d9b31603c15ec53049e71ede5a1cf287a59cfa8f3d6b57533bf0164736f6c634300080a0033000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd992110000000000000000000000001a47958e231848c664863d213bc27b018934477d00000000000000000000000000000000000000000000000000000000000000640000000000000000000000004dd5ab8fb385f2e12ade435ba7afa812f1d364d0
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80639012c4a811610081578063d9d98ce41161005b578063d9d98ce4146101c3578063dc49a07b146101d6578063e28178cc146101de57600080fd5b80639012c4a81461019f578063bc063e1a146101b2578063ced72f87146101bb57600080fd5b80635cffe9de116100b25780635cffe9de14610134578063613255ab146101575780638237e5381461017857600080fd5b80630542975c146100ce5780631fde40bb1461011f575b600080fd5b6100f57f0000000000000000000000004dd5ab8fb385f2e12ade435ba7afa812f1d364d081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61013261012d36600461105d565b6101fc565b005b61014761014236600461107a565b61038c565b6040519015158152602001610116565b61016a61016536600461105d565b61092e565b604051908152602001610116565b61016a7f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd981565b6101326101ad366004611119565b610a8f565b61016a61271081565b60005461016a565b61016a6101d1366004611132565b610c54565b610132610dfb565b60015473ffffffffffffffffffffffffffffffffffffffff166100f5565b6040517f7be53ca10000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000009c94757e231adf6c90f89259dfa0841a1bf8172f73ffffffffffffffffffffffffffffffffffffffff1690637be53ca190602401602060405180830381865afa158015610286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102aa919061115e565b610315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43414c4c45525f4e4f545f504f4f4c5f41444d494e000000000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f13f4413d8d93a259bd6c10f35095371f30ed50f81a73407e52e9f02000d5d16b90600090a35050565b60007f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614610469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f466c6173684d696e7465723a20556e737570706f727465642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015260840161030c565b6040517ffa50f2970000000000000000000000000000000000000000000000000000000081523360048201526000907f0000000000000000000000009c94757e231adf6c90f89259dfa0841a1bf8172f73ffffffffffffffffffffffffffffffffffffffff169063fa50f29790602401602060405180830381865afa1580156104f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051a919061115e565b61052c5761052785610fe0565b61052f565b60005b6040517f40c10f1900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8981166004830152602482018890529192507f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd99211909116906340c10f1990604401600060405180830381600087803b1580156105c457600080fd5b505af11580156105d8573d6000803e3d6000fd5b50506040517f23e30c8b0000000000000000000000000000000000000000000000000000000081527f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd9925073ffffffffffffffffffffffffffffffffffffffff8a1691506323e30c8b9061067a9033907f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd99211908b9088908c908c90600401611180565b6020604051808303816000875af1158015610699573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106bd9190611206565b14610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f466c6173684d696e7465723a2043616c6c6261636b206661696c656400000000604482015260640161030c565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd99211166323b872dd883061076c858a61124e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff938416600482015292909116602483015260448201526064016020604051808303816000875af11580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610809919061115e565b506040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018690527f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b50506040805173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921181168252602082018690528994503393508b16917f9c1558194024d73db1b6fc2739c3070cacc4598122100dd6f7d3a3dd8cee5f36910160405180910390a45060019695505050505050565b60007f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461098b57506000919050565b6040517fd46ec0ed0000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff169063d46ec0ed90602401600060405180830381865afa158015610a18573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610a5e919081019061132d565b60208101518151919250610a719161144f565b6fffffffffffffffffffffffffffffffff169392505050565b919050565b6040517f7be53ca10000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000009c94757e231adf6c90f89259dfa0841a1bf8172f73ffffffffffffffffffffffffffffffffffffffff1690637be53ca190602401602060405180830381865afa158015610b19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3d919061115e565b610ba3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f43414c4c45525f4e4f545f504f4f4c5f41444d494e0000000000000000000000604482015260640161030c565b612710811115610c0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f466c6173684d696e7465723a20466565206f7574206f662072616e6765000000604482015260640161030c565b600080549082905560408051828152602081018490527f528d9479e9f9889a87a3c30c7f7ba537e5e59c4c85a37733b16e57c62df61302910160405180910390a15050565b60007f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f466c6173684d696e7465723a20556e737570706f727465642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015260840161030c565b6040517ffa50f2970000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000009c94757e231adf6c90f89259dfa0841a1bf8172f73ffffffffffffffffffffffffffffffffffffffff169063fa50f29790602401602060405180830381865afa158015610dbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddf919061115e565b610df157610dec82610fe0565b610df4565b60005b9392505050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921173ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa158015610e88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eac9190611206565b6001546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018390529192507f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd99211169063a9059cbb906044016020604051808303816000875af1158015610f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6b919061115e565b5060015460405182815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd9921181169216907fb29fcda740927812f5a71075b62e132bead3769a455319c29b9a1cc461a654759060200160405180910390a350565b60008054610fef908390610ff5565b92915050565b600081157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec778390048411151761102a57600080fd5b506127109102611388010490565b73ffffffffffffffffffffffffffffffffffffffff8116811461105a57600080fd5b50565b60006020828403121561106f57600080fd5b8135610df481611038565b60008060008060006080868803121561109257600080fd5b853561109d81611038565b945060208601356110ad81611038565b935060408601359250606086013567ffffffffffffffff808211156110d157600080fd5b818801915088601f8301126110e557600080fd5b8135818111156110f457600080fd5b89602082850101111561110657600080fd5b9699959850939650602001949392505050565b60006020828403121561112b57600080fd5b5035919050565b6000806040838503121561114557600080fd5b823561115081611038565b946020939093013593505050565b60006020828403121561117057600080fd5b81518015158114610df457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff808916835280881660208401525085604083015284606083015260a060808301528260a0830152828460c0840137600060c0848401015260c07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501168301019050979650505050505050565b60006020828403121561121857600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600082198211156112615761126161121f565b500190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156112b8576112b8611266565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561130557611305611266565b604052919050565b80516fffffffffffffffffffffffffffffffff81168114610a8a57600080fd5b6000602080838503121561134057600080fd5b825167ffffffffffffffff8082111561135857600080fd5b908401906060828703121561136c57600080fd5b611374611295565b61137d8361130d565b815261138a84840161130d565b848201526040830151828111156113a057600080fd5b80840193505086601f8401126113b557600080fd5b8251828111156113c7576113c7611266565b6113f7857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016112be565b9250808352878582860101111561140d57600080fd5b60005b8181101561142b578481018601518482018701528501611410565b8181111561143c5760008683860101525b5050604081019190915295945050505050565b60006fffffffffffffffffffffffffffffffff838116908316818110156114785761147861121f565b03939250505056fea26469706673582212205050289a7c0d9b31603c15ec53049e71ede5a1cf287a59cfa8f3d6b57533bf0164736f6c634300080a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd992110000000000000000000000001a47958e231848c664863d213bc27b018934477d00000000000000000000000000000000000000000000000000000000000000640000000000000000000000004dd5ab8fb385f2e12ade435ba7afa812f1d364d0
-----Decoded View---------------
Arg [0] : ghoToken (address): 0xcbE9771eD31e761b744D3cB9eF78A1f32DD99211
Arg [1] : ghoTreasury (address): 0x1A47958e231848C664863D213bC27b018934477D
Arg [2] : fee (uint256): 100
Arg [3] : addressesProvider (address): 0x4dd5ab8Fb385F2e12aDe435ba7AFA812F1d364D0
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000cbe9771ed31e761b744d3cb9ef78a1f32dd99211
Arg [1] : 0000000000000000000000001a47958e231848c664863d213bc27b018934477d
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [3] : 0000000000000000000000004dd5ab8fb385f2e12ade435ba7afa812f1d364d0
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.