Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 10 from a total of 10 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Transfer Ownersh... | 115995919 | 298 days ago | IN | 0 ETH | 0.000223218503 | ||||
Set ACL Admin | 115995915 | 298 days ago | IN | 0 ETH | 0.000237948942 | ||||
Set Price Oracle... | 115995859 | 298 days ago | IN | 0 ETH | 0.000332418414 | ||||
Set Price Oracle | 115995851 | 298 days ago | IN | 0 ETH | 0.00037983192 | ||||
Set Guild Config... | 115995842 | 298 days ago | IN | 0 ETH | 0.001189143785 | ||||
Set Guild Impl | 115995822 | 298 days ago | IN | 0 ETH | 0.001169525674 | ||||
Set ACL Manager | 115995815 | 298 days ago | IN | 0 ETH | 0.000450606561 | ||||
Set Guild Data P... | 115995795 | 298 days ago | IN | 0 ETH | 0.000428418798 | ||||
Set ACL Admin | 115995788 | 298 days ago | IN | 0 ETH | 0.000399852257 | ||||
Set Guild Role M... | 115995784 | 298 days ago | IN | 0 ETH | 0.001110590709 |
Latest 3 internal transactions
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
115995842 | 298 days ago | Contract Creation | 0 ETH | |||
115995822 | 298 days ago | Contract Creation | 0 ETH | |||
115995784 | 298 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
GuildAddressesProvider
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.17; import {Ownable2Step} from "../../dependencies/@openzeppelin/contracts/access/Ownable2Step.sol"; import {IGuildAddressesProvider} from "../../interfaces/IGuildAddressesProvider.sol"; import {ICovenantPriceOracle} from "../../interfaces/ICovenantPriceOracle.sol"; import {InitializableImmutableAdminUpgradeabilityProxy} from "../libraries/upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol"; /** * @title GuildAddressesProvider * @author Covenant Labs (cloned from AAVE core v3 commit d5fafce) * @notice Main registry of addresses part of or connected to the protocol, including permissioned roles * @dev Acts as factory of proxies and admin of those, so with right to change its implementations **/ contract GuildAddressesProvider is Ownable2Step, IGuildAddressesProvider { // Identifier of the Guild string private _guildId; // Map of registered addresses (identifier => registeredAddress) mapping(bytes32 => address) private _addresses; // Main identifiers bytes32 private constant GUILD = "GUILD"; bytes32 private constant GUILD_CONFIGURATOR = "GUILD_CONFIGURATOR"; bytes32 private constant GUILD_ROLE_MANAGER = "GUILD_ROLE_MANAGER"; bytes32 private constant PRICE_ORACLE = "PRICE_ORACLE"; bytes32 private constant PRICE_ORACLE_SENTINEL = "PRICE_ORACLE_SENTINEL"; bytes32 private constant ACL_MANAGER = "ACL_MANAGER"; bytes32 private constant ACL_ADMIN = "ACL_ADMIN"; bytes32 private constant DATA_PROVIDER = "DATA_PROVIDER"; /** * @dev Constructor. * @param guildId The identifier of the guild. * @param owner The owner address of this contract. */ constructor(string memory guildId, address owner) { _setGuildId(guildId); transferOwnership(owner); } /// @inheritdoc IGuildAddressesProvider function getGuildId() external view override returns (string memory) { return _guildId; } /// @inheritdoc IGuildAddressesProvider function setGuildId(string memory newGuildId) external override onlyOwner { _setGuildId(newGuildId); } /// @inheritdoc IGuildAddressesProvider function getAddress(bytes32 id) public view override returns (address) { return _addresses[id]; } /// @inheritdoc IGuildAddressesProvider function setAddress(bytes32 id, address newAddress) external override onlyOwner { address oldAddress = _addresses[id]; _addresses[id] = newAddress; emit AddressSet(id, oldAddress, newAddress); } /// @inheritdoc IGuildAddressesProvider function setAddressAsProxy(bytes32 id, address newImplementationAddress) external override onlyOwner { address proxyAddress = _addresses[id]; address oldImplementationAddress = _getProxyImplementation(id); emit AddressSetAsProxy(id, proxyAddress, oldImplementationAddress, newImplementationAddress); _updateImpl(id, newImplementationAddress); } /// @inheritdoc IGuildAddressesProvider function getGuild() external view override returns (address) { return getAddress(GUILD); } /// @inheritdoc IGuildAddressesProvider function setGuildImpl(address newGuildImpl) external override onlyOwner { address oldGuildImpl = _getProxyImplementation(GUILD); emit GuildUpdated(oldGuildImpl, newGuildImpl); _updateImpl(GUILD, newGuildImpl); } /// @inheritdoc IGuildAddressesProvider function getGuildConfigurator() external view override returns (address) { return getAddress(GUILD_CONFIGURATOR); } /// @inheritdoc IGuildAddressesProvider function setGuildConfiguratorImpl(address newGuildConfiguratorImpl) external override onlyOwner { address oldGuildConfiguratorImpl = _getProxyImplementation(GUILD_CONFIGURATOR); emit GuildConfiguratorUpdated(oldGuildConfiguratorImpl, newGuildConfiguratorImpl); _updateImpl(GUILD_CONFIGURATOR, newGuildConfiguratorImpl); } /// @inheritdoc IGuildAddressesProvider function getGuildRoleManager() external view override returns (address) { return getAddress(GUILD_ROLE_MANAGER); } /// @inheritdoc IGuildAddressesProvider function setGuildRoleManagerImpl(address newGuildRoleManagerImpl) external override onlyOwner { address oldGuildRoleManagerImpl = _getProxyImplementation(GUILD_ROLE_MANAGER); emit GuildRoleManagerUpdated(oldGuildRoleManagerImpl, newGuildRoleManagerImpl); _updateImpl(GUILD_ROLE_MANAGER, newGuildRoleManagerImpl); } /// @inheritdoc IGuildAddressesProvider function getPriceOracle() external view override returns (address) { return getAddress(PRICE_ORACLE); } /// @inheritdoc IGuildAddressesProvider function setPriceOracle(address newPriceOracle) external override onlyOwner { // Validate new Oracle with Guild if (newPriceOracle != address(0)) ICovenantPriceOracle(newPriceOracle).validateAddressProviderAndGuildPriceResolution(address(this)); address oldPriceOracle = _addresses[PRICE_ORACLE]; _addresses[PRICE_ORACLE] = newPriceOracle; emit PriceOracleUpdated(oldPriceOracle, newPriceOracle); } /// @inheritdoc IGuildAddressesProvider function getPriceOracleSentinel() external view override returns (address) { return getAddress(PRICE_ORACLE_SENTINEL); } /// @inheritdoc IGuildAddressesProvider function setPriceOracleSentinel(address newPriceOracleSentinel) external override onlyOwner { address oldPriceOracleSentinel = _addresses[PRICE_ORACLE_SENTINEL]; _addresses[PRICE_ORACLE_SENTINEL] = newPriceOracleSentinel; emit PriceOracleSentinelUpdated(oldPriceOracleSentinel, newPriceOracleSentinel); } /// @inheritdoc IGuildAddressesProvider function getACLManager() external view override returns (address) { return getAddress(ACL_MANAGER); } /// @inheritdoc IGuildAddressesProvider function setACLManager(address newAclManager) external override onlyOwner { address oldAclManager = _addresses[ACL_MANAGER]; _addresses[ACL_MANAGER] = newAclManager; emit ACLManagerUpdated(oldAclManager, newAclManager); } /// @inheritdoc IGuildAddressesProvider function getACLAdmin() external view override returns (address) { return getAddress(ACL_ADMIN); } /// @inheritdoc IGuildAddressesProvider function setACLAdmin(address newAclAdmin) external override onlyOwner { address oldAclAdmin = _addresses[ACL_ADMIN]; _addresses[ACL_ADMIN] = newAclAdmin; emit ACLAdminUpdated(oldAclAdmin, newAclAdmin); } /// @inheritdoc IGuildAddressesProvider function getGuildDataProvider() external view override returns (address) { return getAddress(DATA_PROVIDER); } /// @inheritdoc IGuildAddressesProvider function setGuildDataProvider(address newDataProvider) external override onlyOwner { address oldDataProvider = _addresses[DATA_PROVIDER]; _addresses[DATA_PROVIDER] = newDataProvider; emit GuildDataProviderUpdated(oldDataProvider, newDataProvider); } /** * @notice Internal function to update the implementation of a specific proxied component of the protocol. * @dev If there is no proxy registered with the given identifier, it creates the proxy setting `newAddress` * as implementation and calls the initialize() function on the proxy * @dev If there is already a proxy registered, it just updates the implementation to `newAddress` and * calls the initialize() function via upgradeToAndCall() in the proxy * @param id The id of the proxy to be updated * @param newAddress The address of the new implementation **/ function _updateImpl(bytes32 id, address newAddress) internal { address proxyAddress = _addresses[id]; InitializableImmutableAdminUpgradeabilityProxy proxy; bytes memory params = abi.encodeWithSignature("initialize(address)", address(this)); if (proxyAddress == address(0)) { proxy = new InitializableImmutableAdminUpgradeabilityProxy(address(this)); _addresses[id] = proxyAddress = address(proxy); emit ProxyCreated(id, proxyAddress, newAddress); proxy.initialize(newAddress, params); } else { proxy = InitializableImmutableAdminUpgradeabilityProxy(payable(proxyAddress)); proxy.upgradeToAndCall(newAddress, params); } } /** * @notice Updates the identifier of the guild. * @param newGuildId The new id of the guild **/ function _setGuildId(string memory newGuildId) internal { string memory oldGuildId = _guildId; _guildId = newGuildId; emit GuildIdSet(oldGuildId, newGuildId); } /** * @notice Returns the the implementation contract of the proxy contract by its identifier. * @dev It returns ZERO if there is no registered address with the given id * @dev It reverts if the registered address with the given id is not `InitializableImmutableAdminUpgradeabilityProxy` * @param id The id * @return The address of the implementation contract */ function _getProxyImplementation(bytes32 id) internal returns (address) { address proxyAddress = _addresses[id]; if (proxyAddress == address(0)) { return address(0); } else { address payable payableProxyAddress = payable(proxyAddress); return InitializableImmutableAdminUpgradeabilityProxy(payableProxyAddress).implementation(); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable2Step.sol) pragma solidity ^0.8.0; import "./Ownable.sol"; /** * @dev Contract module which provides access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership} and {acceptOwnership}. * * This module is used through inheritance. It will make available all functions * from parent (Ownable). */ abstract contract Ownable2Step is Ownable { address private _pendingOwner; event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner); /** * @dev Returns the address of the pending owner. */ function pendingOwner() public view virtual returns (address) { return _pendingOwner; } /** * @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual override onlyOwner { _pendingOwner = newOwner; emit OwnershipTransferStarted(owner(), newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner. * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual override { delete _pendingOwner; super._transferOwnership(newOwner); } /** * @dev The new owner accepts the ownership transfer. */ function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.17; /** * @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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @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'); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(''); require(success, 'Address: unable to send value, recipient may have reverted'); } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.17; /** * @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); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.17; import './Proxy.sol'; import '../contracts/Address.sol'; /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal view override returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; //solium-disable-next-line assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require( Address.isContract(newImplementation), 'Cannot set a proxy implementation to a non-contract address' ); bytes32 slot = IMPLEMENTATION_SLOT; //solium-disable-next-line assembly { sstore(slot, newImplementation) } } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.17; import './BaseUpgradeabilityProxy.sol'; /** * @title InitializableUpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing * implementation and init data. */ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract initializer. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize(address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); assert( IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) ); _setImplementation(_logic); if (_data.length > 0) { (bool success, ) = _logic.delegatecall(_data); require(success); } } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.8.17; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Will run if no other function in the contract matches the call data. * Implemented entirely in `_fallback`. */ fallback() external payable { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { //solium-disable-next-line assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual {} /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IERC20} from "../dependencies/openzeppelin/contracts/IERC20.sol"; import {IGuild} from "./IGuild.sol"; import {INotionalERC20} from "./INotionalERC20.sol"; import {IInitializableAssetToken} from "./IInitializableAssetToken.sol"; interface IAssetToken is IERC20, INotionalERC20, IInitializableAssetToken { function mint(address account, uint256 amount) external; function burn(address account, uint256 amount) external; function updateNotionalFactor(uint256 multFactor) external returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IGuildAddressesProvider} from "./IGuildAddressesProvider.sol"; import {DataTypes} from "../protocol/libraries/types/DataTypes.sol"; /** * @title ICovenantPriceOracle * @author Covenant Labs * @notice Defines the basic interface for a Covenant price oracle. **/ interface ICovenantPriceOracle { /** * @notice Returns the GuildAddressesProvider * @return The address of the GuildAddressesProvider contract */ function ADDRESSES_PROVIDER() external view returns (IGuildAddressesProvider); /** * @notice Returns the base currency address for the price oracle * @return The base currency address. **/ function BASE_CURRENCY() external view returns (address); /** * @notice Sets the price source for each asset * @param assets The addresses of the assets * @param sources The addresses of the price sources for each asset **/ function setAssetPriceSources(address[] memory assets, address[] memory sources) external; /** * @notice Validate oracle's guild price resolution, money and addressProvider config * @dev Validates address_provider + money match with guild setup, and ensure zToken + collaterals resolve their price **/ function validateAddressProviderAndGuildPriceResolution(address guildAddressProvider) external view; /** * @notice Validate asset price resolution * @param asset The address of the asset to resolve price (across all price contexts) **/ function validateAssetPriceResolution(address asset) external view; /** * @notice Gets the asset price in the base currency * @param asset The address of the asset * @param context The context for the price * @return The price of the asset in the oracle base currency **/ function getAssetPrice(address asset, DataTypes.PriceContext context) external view returns (uint256); /** * @notice Sets the lookback times for a given price context * @param context The context for the price * @param startLookbackTime The start lookback time * @param endLookbackTime The end lookback time **/ function setContextLookbackTime( DataTypes.PriceContext context, uint32 startLookbackTime, uint32 endLookbackTime ) external; /** * @notice Gets the lookback times for a given price context * @param context The context for the price **/ function getContextLookbackTime(DataTypes.PriceContext context) external view returns (uint32, uint32); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; /** * @title ICreditDelegation * @author Amorphous, inspired by AAVE v3 * @notice Defines the basic interface for a token supporting credit delegation. **/ interface ICreditDelegation { /** * @dev Emitted on `approveDelegation` and `borrowAllowance * @param fromUser The address of the delegator * @param toUser The address of the delegatee * @param amount The amount being delegated */ event BorrowAllowanceDelegated(address indexed fromUser, address indexed toUser, uint256 amount); /** * @notice Increases the allowance of delegatee to mint _msgSender() tokens * @param delegatee The delegatee allowed to mint on behalf of _msgSender() * @param addedValue The amount being added to the allowance **/ function increaseDelegation(address delegatee, uint256 addedValue) external; /** * @notice Decreases the borrow allowance of a user on the specific debt token. * @param delegatee The address receiving the delegated borrowing power * @param amount The amount to subtract from the current allowance */ function decreaseDelegation(address delegatee, uint256 amount) external; /** * @notice Delegates borrowing power to a user on the specific debt token. * Delegation will still respect the liquidation constraints (even if delegated, a * delegatee cannot force a delegator HF to go below 1) * @param delegatee The address receiving the delegated borrowing power * @param amount The maximum amount being delegated. **/ function approveDelegation(address delegatee, uint256 amount) external; /** * @notice Returns the borrow allowance of the user * @param fromUser The user to giving allowance * @param toUser The user to give allowance to * @return The current allowance of `toUser` **/ function borrowAllowance(address fromUser, address toUser) external view returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IGuildAddressesProvider} from "./IGuildAddressesProvider.sol"; import {IAssetToken} from "./IAssetToken.sol"; import {ILiabilityToken} from "./ILiabilityToken.sol"; import {IGuildAddressesProvider} from "./IGuildAddressesProvider.sol"; import {DataTypes} from "../protocol/libraries/types/DataTypes.sol"; import {IERC20} from "../dependencies/openzeppelin/contracts/IERC20.sol"; /** * @title IGuild * @author Amorphous * @notice Defines the basic interface for a Guild. **/ interface IGuild { /** * @dev Emitted on deposit() * @param collateral The address of the collateral asset * @param user The address initiating the deposit * @param onBehalfOf The beneficiary of the deposit * @param amount The amount supplied **/ event Deposit(address indexed collateral, address user, address indexed onBehalfOf, uint256 amount); /** * @dev Emitted on withdraw() * @param collateral The address of the collateral asset * @param user The address initiating the withdrawal * @param to The address that will receive the underlying * @param amount The amount to be withdrawn **/ event Withdraw(address indexed collateral, address indexed user, address indexed to, uint256 amount); /** * @notice Returns the GuildAddressesProvider connected to this contract * @return The address of the GuildAddressesProvider **/ function ADDRESSES_PROVIDER() external view returns (IGuildAddressesProvider); /** * @notice Refinances perpetual debt. * @dev Makes uniswap DEX call, and calculates TWAP price vs last time refinance was called. * Uses TWAP price to calculate interest rate in that period. **/ function refinance() external; /** * @notice Supplies an `amount` of collateral into the Guild. * @param asset The address of the ERC20 asset to supply * @param amount The amount to be supplied * @param onBehalfOf The address that receives the collateral 'credit', same as msg.sender if the user * wants it to account to their own wallet, or a different address if the beneficiary is someone else **/ function deposit( address asset, uint256 amount, address onBehalfOf ) external; /** * @notice Withdraw an `amount` of underlying asset from the Guild. * @param asset The addres of the ERC20 asset to withdraw * @param amount The amount to be withdraw (in WADs if that's the collateral's precision) * @param to The address that will receive the underlying, same as msg.sender if the user * wants to receive it on his own wallet, or a different address if the beneficiary is a * different wallet * @return The final amount withdrawn **/ function withdraw( address asset, uint256 amount, address to ) external returns (uint256); /** * @notice Initializes a perpetual debt. * @param assetTokenProxyAddress The proxy address of the underlying asset token contract (zToken) * @param liabilityTokenProxyAddress The proxy address of the underlying liability token contract (dToken) * @param moneyAddress The address of the money token on which the debt is denominated in * @param duration The duration, in seconds, of the perpetual debt * @param notionalPriceLimitMax Maximum price used for refinance purposes * @param notionalPriceLimitMin Minimum price used for refinance purposes * @param dexFactory Uniswap v3 Factory address * @param dexFee Uniswap v3 pool fee (to identify pool used for refinance oracle purposes) **/ function initPerpetualDebt( address assetTokenProxyAddress, address liabilityTokenProxyAddress, address moneyAddress, uint256 duration, uint256 notionalPriceLimitMax, uint256 notionalPriceLimitMin, address dexFactory, uint24 dexFee ) external; /** * @notice Initializes a collateral, activating it, and configuring it's parameters * @dev Only callable by the GuildConfigurator contract * @param asset The address of the ERC20 collateral **/ function initCollateral(address asset) external; /** * @notice Drop a collateral * @dev Only callable by the GuildConfigurator contract * @param asset The address of the ERC20 to drop as an acceptable collateral **/ function dropCollateral(address asset) external; /** * @notice Sets the configuration bitmap of the collateral as a whole * @dev Only callable by the PoolConfigurator contract * @param asset The address of the ERC20 collateral * @param configuration The new configuration bitmap **/ function setConfiguration(address asset, DataTypes.CollateralConfigurationMap calldata configuration) external; /** * @notice Returns the configuration of the collateral * @param asset The address of the ERC20 collateral * @return The configuration of the collateral **/ function getCollateralConfiguration(address asset) external view returns (DataTypes.CollateralConfigurationMap memory); /** * @notice Returns the collateral balance of a user in the Guild * @param user The address of the user * @param asset The address of the collateral asset * @return The collateral amount deposited in the Guild **/ function getCollateralBalanceOf(address user, address asset) external view returns (uint256); /** * @notice Returns the total collateral balance in the Guild * @param asset The address of the collateral asset * @return The total collateral amount deposited in the Guild **/ function getCollateralTotalBalance(address asset) external view returns (uint256); /** * @notice Returns the list of all initialized collaterals * @dev It does not include dropped collaterals * @return The addresses of the initialized collaterals **/ function getCollateralsList() external view returns (address[] memory); /** * @notice Returns the address of the underlying collateral by collateral id as stored in the DataTypes.CollateralData struct * @param id The id of the collateral as stored in the DataTypes.CollateralData struct * @return The address of the collateral associated with id **/ function getCollateralAddressById(uint16 id) external view returns (address); /** * @notice Returns the maximum number of collaterals supported by this Guild * @return The maximum number of collaterals supported */ function maxNumberCollaterals() external view returns (uint16); /** * @notice Sets the configuration bitmap of the perpetual debt * @dev Only callable by the GuildConfigurator contract * @param configuration The new configuration bitmap **/ function setPerpDebtConfiguration(DataTypes.PerpDebtConfigurationMap calldata configuration) external; /** * @notice Returns the configuration of the perpetual debt * @return The configuration of the perpetual debt **/ function getPerpDebtConfiguration() external view returns (DataTypes.PerpDebtConfigurationMap memory); /** * @dev Emitted on borrow() when debt needs to be opened * @param user The address of the user initiating the borrow(), receiving the funds on borrow() * @param onBehalfOf The address that will be getting the debt * @param amount The zToken amount borrowed out * @param amountNotional The notional amount borrowed out (in Notional) **/ event Borrow(address indexed user, address indexed onBehalfOf, uint256 amount, uint256 amountNotional); /** * @dev Emitted on repay() * @param user The address of the account whose zTokens are used to pay back the debt * @param onBehalfOf The address that will be getting the debt paid back * @param amount The zToken amount repaid * @param amountNotional The notional amount repaid (in Notional) **/ event Repay(address indexed user, address indexed onBehalfOf, uint256 amount, uint256 amountNotional); /** * @dev Emitted on swapMoneyForZToken() * @param user The address of the account who is swapping money for ZToken (at 1:1 faceprice) * @param moneyIn The money amount swapped * @param zTokenOut The zToken amount received (including swap fees paid) **/ event MoneyForZTokenSwap(address indexed user, uint256 moneyIn, uint256 zTokenOut); /** * @dev Emitted on swapZTokenForMoney() * @param user The address of the user who is swapping zToken for money (at 1:1 faceprice) * @param zTokenIn The zToken amount swapped * @param moneyOut The money amount received (including disribution fees) **/ event ZTokenForMoneySwap(address indexed user, uint256 zTokenIn, uint256 moneyOut); /** * @notice Get money token **/ function getMoney() external view returns (IERC20); /** * @notice Get asset token **/ function getAsset() external view returns (IAssetToken); /** * @notice get liability token **/ function getLiability() external view returns (ILiabilityToken); /** * @notice get perpetual debt data **/ function getPerpetualDebt() external view returns (DataTypes.PerpetualDebtData memory); /** * @notice get DEX address from which the Guild derives refinance prices **/ function getDex() external view returns (address); /** * @notice Updates notional price limits used during refinancing. * @dev Perpetual debt interest rates are proportional to 1/notionalPrice. * @param priceMin Minimum notional price to use for refinancing. * @param priceMax Maximum notional price to use for refinancing. **/ function setPerpDebtNotionalPriceLimits(uint256 priceMax, uint256 priceMin) external; /** * @notice Updates the protocol service fee address where service fees are deposited * @param newAddress new protocol service fee address **/ function setProtocolServiceFeeAddress(address newAddress) external; /** * @notice Updates the protocol mint fee address where mint fees are deposited * @param newAddress new protocol mint fee address **/ function setProtocolMintFeeAddress(address newAddress) external; /** * @notice Updates the protocol distribution fee address where distribution fees are deposited * @param newAddress new protocol distribution fee address **/ function setProtocolDistributionFeeAddress(address newAddress) external; /** * @notice Updates the protocol swap fee address where distribution fees are deposited * @param newAddress new protocol swap fee address **/ function setProtocolSwapFeeAddress(address newAddress) external; /** * @notice Allows users to borrow a specific `amount` of the zTokens, provided that the borrower * already supplied enough collateral. * @param amount The zToken amount to be borrowed * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator * if he has been given credit delegation allowance to msg.sender **/ function borrow(uint256 amount, address onBehalfOf) external; /** * @notice Payback specific borrowed `amount`, which in turn burns the equivalent amount of dTokens * @param onBehalfOf The address of the user who will get his debt reduced/removed. Should be the address of the * user calling the function if he wants to reduce/remove his own debt, or the address of any other * other borrower whose debt should be removed * @param amount The zToken amount to be paid back * @return The final notional amount repaid **/ function repay(uint256 amount, address onBehalfOf) external returns (uint256); /** * @notice Return structure for getUserAccountData function * @return totalCollateralInBaseCurrency The total collateral of the user in the base currency used by the price feed with a BORROW context * @return totalDebtNotionalInBaseCurrency The total debt of the user in the base currency used by the price feed with a BORROW context * @return availableBorrowsInBaseCurrency The borrowing power left of the user in the base currency used by the price feed * @return totalCollateralInBaseCurrencyForLiquidationTrigger The total collateral of the user in the base currency used by the price feed with a LIQUIDATION_TRIGGER context * @return currentLiquidationThreshold The liquidation threshold of the user with a price feed in the Liquidation Trigger Context * @return ltv The loan to value of The user * @return healthFactor The current health factor of the user * @return totalDebt The total base debt of the user in the native dToken decimal unit * @return availableBorrowsInZTokens The total zTokens that can be minted given borrowing capacity * @return availableNotionalBorrows The total notional that can be minted given borrowing capacity * @return zTokensToRepayDebt The total zTokens required to repay the accounts totalDebtNotional (in native zToken decimal unit) **/ struct UserAccountDataStruct { uint256 totalCollateralInBaseCurrency; uint256 totalDebtNotionalInBaseCurrency; uint256 availableBorrowsInBaseCurrency; uint256 totalCollateralInBaseCurrencyForLiquidationTrigger; uint256 currentLiquidationThreshold; uint256 ltv; uint256 healthFactor; uint256 totalDebt; uint256 availableBorrowsInZTokens; uint256 availableNotionalBorrows; uint256 zTokensToRepayDebt; } /** * @notice Returns the user account data across all the collaterals * @param user The address of the user * @return userData User variables as per UserAccountDataStruct structure **/ function getUserAccountData(address user) external view returns (UserAccountDataStruct memory userData); /** * @notice Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1 * - The caller (liquidator) covers `debtNotionalToCover` amount of debt of the user getting liquidated, and receives * a proportionally amount of the `collateralAsset`in their wallet plus a bonus to cover market risk * @param collateralAsset The address of the collateral asset, to receive as result of the liquidation * @param user The address of the borrower getting liquidated * @param debtToCover The debt base amount the liquidator wants to cover (in dToken units) **/ function liquidationCall( address collateralAsset, address user, uint256 debtToCover ) external; /** * @notice Executes validation of deposit() function, and reverts with same validation logic * @dev does not update on-chain state * @param asset The address of the ERC20 asset to supply * @param amount The amount to be supplied * @param onBehalfOf The address that receives the collateral 'credit', same as msg.sender if the user * wants it to account to their own wallet, or a different address if the beneficiary is someone else **/ function validateDeposit( address asset, uint256 amount, address onBehalfOf ) external view; /** * @notice Executes validation of withdraw() function, and reverts with same validation logic * @dev does not update on-chain state * @param asset The address of the ERC20 asset to supply * @param amount The amount to be supplied * @param onBehalfOf The address that receives the collateral 'withdrawal', same as msg.sender if the user * wants it to account to their own wallet, or a different address if the beneficiary is someone else **/ function validateWithdraw( address asset, uint256 amount, address onBehalfOf ) external view; /** * @notice Executes validation of borrow() function, and reverts with same validation logic * @param amount The zToken amount to be borrowed * @param onBehalfOf The address of the user who will receive the debt. Should be the address of the borrower itself * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator * if he has been given credit delegation allowance to msg.sender **/ function validateBorrow(uint256 amount, address onBehalfOf) external view; /** * @notice Executes validation of repay() function, and reverts with same validation logic * @param amount The zToken amount to be paid back **/ function validateRepay(uint256 amount) external view; /** * @notice Executes money for zToken swap at price = Notional Factor * @param moneyIn The money amount to swap in **/ function swapMoneyForZToken(uint256 moneyIn) external returns (uint256); /** * @notice Executes zToken for money swap at price = Notional Factor * @param zTokenIn The money amount to swap in **/ function swapZTokenForMoney(uint256 zTokenIn) external returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; /** * @title IGuildAddressesProvider * @author Amorphous (cloned from AAVE core v3 commit d5fafce) * @notice Defines the basic interface for a Guild Addresses Provider. **/ interface IGuildAddressesProvider { /** * @dev Emitted when the market identifier is updated. * @param oldGuildId The old id of the market * @param newGuildId The new id of the market */ event GuildIdSet(string indexed oldGuildId, string indexed newGuildId); /** * @dev Emitted when the Guild is updated. * @param oldAddress The old address of the Guild * @param newAddress The new address of the Guild */ event GuildUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the Guild configurator is updated. * @param oldAddress The old address of the GuildConfigurator * @param newAddress The new address of the GuildConfigurator */ event GuildConfiguratorUpdated(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 price oracle 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 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 Guild data provider is updated. * @param oldAddress The old address of the GuildDataProvider * @param newAddress The new address of the GuildDataProvider */ event GuildDataProviderUpdated(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when the GuildRoleManager is updated. * @param oldAddress The old address of the GuildRoleManager * @param newAddress The new address of the GuildRoleManager */ event GuildRoleManagerUpdated(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 getGuildId() external view returns (string memory); /** * @notice Associates an id with a specific GuildAddressesProvider. * @dev This can be used to create an onchain registry of GuildAddressesProviders to * identify and validate multiple Guilds. * @param newGuildId The market id */ function setGuildId(string calldata newGuildId) 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 Guild proxy. * @return The Guild proxy address **/ function getGuild() external view returns (address); /** * @notice Updates the implementation of the Guild, or creates a proxy * setting the new `Guild` implementation when the function is called for the first time. * @param newGuildImpl The new Guild implementation **/ function setGuildImpl(address newGuildImpl) external; /** * @notice Returns the address of the GuildConfigurator proxy. * @return The GuildConfigurator proxy address **/ function getGuildConfigurator() external view returns (address); /** * @notice Updates the implementation of the GuildConfigurator, or creates a proxy * setting the new `GuildConfigurator` implementation when the function is called for the first time. * @param newGuildConfiguratorImpl The new GuildConfigurator implementation **/ function setGuildConfiguratorImpl(address newGuildConfiguratorImpl) external; /** * @notice Returns the address of the GuildRoleManager proxy. * @return The GuildRoleManager proxy address **/ function getGuildRoleManager() external view returns (address); /** * @notice Updates the implementation of the GuildRoleManager, or creates a proxy * setting the new `GuildRoleManager` implementation when the function is called for the first time. * @param newGuildRoleManagerImpl The new GuildRoleManager implementation **/ function setGuildRoleManagerImpl(address newGuildRoleManagerImpl) 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 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 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 data provider. * @return The address of the DataProvider */ function getGuildDataProvider() external view returns (address); /** * @notice Updates the address of the data provider. * @param newDataProvider The address of the new DataProvider **/ function setGuildDataProvider(address newDataProvider) external; }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IGuild} from "./IGuild.sol"; /** * @title IInitializableAssetToken * @author Amorphous * @notice Interface for the initialize function on zToken **/ interface IInitializableAssetToken { /** * @dev Emitted when an aToken is initialized * @param guild The address of the associated guild * @param zTokenDecimals The decimals of the underlying * @param zTokenName The name of the zToken * @param zTokenSymbol The symbol of the zToken * @param params A set of encoded parameters for additional initialization **/ event Initialized( address indexed guild, uint8 zTokenDecimals, string zTokenName, string zTokenSymbol, bytes params ); /** * @notice Initializes the zToken * @param guild The guild contract that is initializing this contract * @param zTokenDecimals The decimals of the zToken, same as the underlying asset's * @param zTokenName The name of the zToken * @param zTokenSymbol The symbol of the zToken * @param params A set of encoded parameters for additional initialization */ function initialize( IGuild guild, uint8 zTokenDecimals, string calldata zTokenName, string calldata zTokenSymbol, bytes calldata params ) external; }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IGuild} from "./IGuild.sol"; /** * @title IInitializableLiabilityToken * @author Amorphous * @notice Interface for the initialize function on dToken **/ interface IInitializableLiabilityToken { /** * @dev Emitted when an aToken is initialized * @param guild The address of the associated guild * @param dTokenDecimals The decimals of the underlying * @param dTokenName The name of the dToken * @param dTokenSymbol The symbol of the dToken * @param params A set of encoded parameters for additional initialization **/ event Initialized( address indexed guild, uint8 dTokenDecimals, string dTokenName, string dTokenSymbol, bytes params ); /** * @notice Initializes the dToken * @param guild The guild contract that is initializing this contract * @param dTokenDecimals The decimals of the zToken, same as the underlying asset's * @param dTokenName The name of the zToken * @param dTokenSymbol The symbol of the zToken * @param params A set of encoded parameters for additional initialization */ function initialize( IGuild guild, uint8 dTokenDecimals, string calldata dTokenName, string calldata dTokenSymbol, bytes calldata params ) external; }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IERC20} from "../dependencies/openzeppelin/contracts/IERC20.sol"; import {INotionalERC20} from "./INotionalERC20.sol"; import {IInitializableLiabilityToken} from "./IInitializableLiabilityToken.sol"; import {ICreditDelegation} from "./ICreditDelegation.sol"; interface ILiabilityToken is IERC20, INotionalERC20, IInitializableLiabilityToken, ICreditDelegation { /** * @dev Emitted when new stable debt is minted * @param user The address of the user who triggered the minting * @param onBehalfOf The recipient of stable debt tokens * @param amount The amount minted **/ event Mint(address indexed user, address indexed onBehalfOf, uint256 amount); /** * @notice Mints liability token to the `onBehalfOf` address * @param user The address receiving the borrowed underlying, being the delegatee in case * of credit delegate, or same as `onBehalfOf` otherwise * @param onBehalfOf The address receiving the debt tokens * @param amount The amount of debt being minted **/ function mint( address user, address onBehalfOf, uint256 amount ) external; function burn(address account, uint256 amount) external; function updateNotionalFactor(uint256 multFactor) external returns (uint256); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.7; import {IERC20} from "../dependencies/openzeppelin/contracts/IERC20.sol"; /** * @dev Implementation of notional rebase functionality. * * Forms the basis of a notional ERC20 token, where the ERC20 interface is non-rebasing, * (ie, the quantities tracked by the ERC20 token are normalized), and here we create * functions that access the full 'rebased' quantities as a 'Notional' amount * **/ interface INotionalERC20 is IERC20 { event UpdateNotionalFactor(uint256 _value); function getNotionalFactor() external view returns (uint256); // @dev gets the Notional factor [ray] function totalNotionalSupply() external view returns (uint256); function balanceNotionalOf(address account) external view returns (uint256); function notionalToBase(uint256 amount) external view returns (uint256); function baseToNotional(uint256 amount) external view returns (uint256); }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.17; import {IERC20} from "../../../dependencies/openzeppelin/contracts/IERC20.sol"; import {ILiabilityToken} from "../../../interfaces/ILiabilityToken.sol"; import {IAssetToken} from "../../../interfaces/IAssetToken.sol"; library DataTypes { //@dev Uniswap requires the address of token0 < token1. //@dev All oracle prices by uniswap are given as a ratio of token0/token1. struct DexPoolData { address token0; address token1; uint24 fee; bool moneyIsToken0; //indicates whether token0 is the money token address poolAddress; } struct DexOracleData { address dexFactory; // Uniswap v3 factory DexPoolData dex; // Dex pool details uint256 currentPrice; uint256 twapPrice; uint256 lastTWAPObservationTime; // Timestamp of last oracle consult for TWAP price uint256 lastCurrentObservationTime; // Timestamp of last oracle consult for current price int56 lastTWAPTickCumulative; //For Uniswap v3.0 TWAP calculation uint256 lastTWAPTimeDelta; //recording of last time delta } struct PerpetualDebtData { //stores the perpetual debt configuration PerpDebtConfigurationMap configuration; //Token addresses IAssetToken zToken; ILiabilityToken dToken; IERC20 money; uint256 beta; //beta multiplier, indicating duration of debt instrument DexOracleData dexOracle; //Dex Oracle uint256 lastRefinance; //last refinance block number //Price limit variables when refinancing uint256 notionalPriceMax; //[ray] uint256 notionalPriceMin; //[ray] //protocol fees address protocolServiceFeeAddress; //protocol service fee address (address in which to mint debt service fee) address protocolMintFeeAddress; //protocol mint fee address (address in which to mint debt mint fee) address protocolDistributionFeeAddress; //protocol distribution fee address (address in which to mint debt service fee) address protocolSwapFeeAddress; //protocol swap fee address (address in which to mint debt service fee) } struct CollateralData { //stores the collateral configuration CollateralConfigurationMap configuration; //the id of the collateral. Represents the position in the list of the active ERC20 collaterals uint16 id; //map of user balances (for a given collateral) mapping(address => uint256) balances; //total collateral balance held by the Guild uint256 totalBalance; //map of user collateral prices at the time debt was last minted //@dev - only used if collateral configured as non-MTM mapping(address => uint256) lastMintPrice; } struct GuildTreasuryData { //stores the amount of money owned by the Guild Treasury uint256 moneyAmount; } struct CollateralConfigurationMap { //bit 0-15: LTV //bit 16-31: Liq. threshold //bit 32-47: Liq. bonus //bit 48-55: Decimals //bit 56: collateral is active //bit 57: collateral is frozen //bit 58: is non-MTM liquidation (collateral liquidation uses last mint price) //bit 59: unused //bit 60: collateral is paused //bit 61-115: unused //bit 81-151: user supply cap in 1/100 tokens, usersupplyCap == 0 => no cap //bit 116-151: supply cap in whole tokens, supplyCap == 0 => no cap //bit 152-255: unused uint256 data; } struct PerpDebtConfigurationMap { //bit 0: perpetual debt is paused (no mint, no burn/distribute, no liquidate, no refinance) //bit 1: perpetual debt is frozen (no mint, yes burn/distribute, yes liquidate, no refinance) //bit 2-37: mint cap in whole tokens, borrowCap ==0 => no cap //bit 38-47: unused //bit 48-63: protocol service fee (bps) //bit 64-79: protocol mint fee (bps) //bit 80-95: protocol distribution fee (bps) //bit 96-111: protocol swap fee (bps) //bit 112-255: unused uint256 data; } struct ExecuteDepositParams { address asset; uint256 amount; address onBehalfOf; } struct ExecuteWithdrawParams { address asset; uint256 amount; address to; uint256 collateralsCount; address oracle; address oracleSentinel; } struct ExecuteSupplyParams { address collateral; uint256 amount; address user; } struct ExecuteBorrowParams { address user; address onBehalfOf; uint256 amount; uint256 collateralsCount; address oracle; address oracleSentinel; } struct ExecuteRepayParams { address onBehalfOf; uint256 amount; } struct GetUserAccountDataParams { uint256 collateralsCount; address user; address oracle; } struct ExecuteInitPerpetualDebtParams { address assetTokenAddress; address liabilityTokenAddress; address moneyAddress; uint256 duration; uint256 notionalPriceLimitMax; uint256 notionalPriceLimitMin; address dexFactory; uint24 dexFee; address oracle; } struct CalculateUserAccountDataParams { uint256 collateralsCount; address user; address oracle; PriceContext priceContext; } struct ValidateBorrowParams { address user; uint256 amount; uint256 collateralsCount; address oracle; address oracleSentinel; } struct ValidateBorrowLocalVars { uint256 currentLtv; uint256 collateralNeededInBaseCurrency; uint256 userCollateralInBaseCurrency; uint256 userDebtInBaseCurrency; uint256 availableLiquidity; uint256 healthFactor; uint256 totalDebt; uint256 totalSupplyVariableDebt; uint256 reserveDecimals; uint256 borrowCap; uint256 amountInBaseCurrency; address eModePriceSource; address siloedBorrowingAddress; } struct ExecuteLiquidationCallParams { uint256 collateralsCount; uint256 debtToCover; address collateralAsset; address user; address priceOracle; address oracleSentinel; } struct ValidateLiquidationCallParams { uint256 totalDebt; uint256 healthFactor; address oracleSentinel; } struct ProxyStep { address assetToken; address baseToken; address proxySource; } struct PriceSourceData { address tokenA; address tokenB; address priceSource; } enum Roles { DEPOSITOR, WITHDRAWER, BORROWER, REPAYER } struct UserRolesData { // An array of mappings of user -> roles mapping(address => uint256) roles; } //@dev - not more than 255 price contexts to be used (8 bit encoding) enum PriceContext { BORROW, LIQUIDATION_TRIGGER, LIQUIDATION, FRONTEND } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.17; import {BaseUpgradeabilityProxy} from "../../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol"; /** * @title BaseImmutableAdminUpgradeabilityProxy * @author Aave, inspired by the OpenZeppelin upgradeability proxy pattern * @notice This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * @dev The admin role is stored in an immutable, which helps saving transactions costs * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract BaseImmutableAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { address internal immutable _ADMIN; /** * @dev Constructor. * @param adminAddress The address of the admin */ constructor(address adminAddress) { _ADMIN = adminAddress; } modifier ifAdmin() { if (msg.sender == _ADMIN) { _; } else { _fallback(); } } /** * @notice Return the admin address * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _ADMIN; } /** * @notice Return the implementation address * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @notice Upgrade the backing implementation of the proxy. * @dev Only the admin can call this function. * @param newImplementation The address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @notice Upgrade the backing implementation of the proxy and call a function * on the new implementation. * @dev This is useful to initialize the proxied contract. * @param newImplementation The address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin { _upgradeTo(newImplementation); (bool success, ) = newImplementation.delegatecall(data); require(success); } /** * @notice Only fall back when the sender is not the admin. */ function _willFallback() internal virtual override { require(msg.sender != _ADMIN, "Cant call fallback fxn from proxy admin"); super._willFallback(); } }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.17; import {InitializableUpgradeabilityProxy} from "../../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol"; import {Proxy} from "../../../dependencies/openzeppelin/upgradeability/Proxy.sol"; import {BaseImmutableAdminUpgradeabilityProxy} from "./BaseImmutableAdminUpgradeabilityProxy.sol"; /** * @title InitializableAdminUpgradeabilityProxy * @author Aave * @dev Extends BaseAdminUpgradeabilityProxy with an initializer function */ contract InitializableImmutableAdminUpgradeabilityProxy is BaseImmutableAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy { /** * @dev Constructor. * @param admin The address of the admin */ constructor(address admin) BaseImmutableAdminUpgradeabilityProxy(admin) { // Intentionally left blank } /// @inheritdoc BaseImmutableAdminUpgradeabilityProxy function _willFallback() internal override(BaseImmutableAdminUpgradeabilityProxy, Proxy) { BaseImmutableAdminUpgradeabilityProxy._willFallback(); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"guildId","type":"string"},{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ACLAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ACLManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"AddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"indexed":false,"internalType":"address","name":"oldImplementationAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newImplementationAddress","type":"address"}],"name":"AddressSetAsProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"GuildConfiguratorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"GuildDataProviderUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"oldGuildId","type":"string"},{"indexed":true,"internalType":"string","name":"newGuildId","type":"string"}],"name":"GuildIdSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"GuildRoleManagerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"GuildUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"PriceOracleSentinelUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"PriceOracleUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"proxyAddress","type":"address"},{"indexed":true,"internalType":"address","name":"implementationAddress","type":"address"}],"name":"ProxyCreated","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getACLAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getACLManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGuild","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGuildConfigurator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGuildDataProvider","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGuildId","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGuildRoleManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceOracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPriceOracleSentinel","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"newAclAdmin","type":"address"}],"name":"setACLAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAclManager","type":"address"}],"name":"setACLManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"newAddress","type":"address"}],"name":"setAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"},{"internalType":"address","name":"newImplementationAddress","type":"address"}],"name":"setAddressAsProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGuildConfiguratorImpl","type":"address"}],"name":"setGuildConfiguratorImpl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newDataProvider","type":"address"}],"name":"setGuildDataProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newGuildId","type":"string"}],"name":"setGuildId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGuildImpl","type":"address"}],"name":"setGuildImpl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGuildRoleManagerImpl","type":"address"}],"name":"setGuildRoleManagerImpl","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPriceOracle","type":"address"}],"name":"setPriceOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newPriceOracleSentinel","type":"address"}],"name":"setPriceOracleSentinel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200210238038062002102833981016040819052620000349162000309565b6200003f336200005d565b6200004a8262000087565b62000055816200018c565b50506200054f565b600180546001600160a01b03191690556200008481620001ff602090811b62000b7d17901c565b50565b6000600280546200009890620003d6565b80601f0160208091040260200160405190810160405280929190818152602001828054620000c690620003d6565b8015620001175780601f10620000eb5761010080835404028352916020019162000117565b820191906000526020600020905b815481529060010190602001808311620000f957829003601f168201915b5050505050905081600290816200012f919062000465565b508160405162000140919062000531565b60405180910390208160405162000158919062000531565b604051908190038120907fc647161511e63bffc7542ae60a2d1b772e5ad95dd2730ef08f6891f0c1abd36690600090a35050565b620001966200024f565b600180546001600160a01b0319166001600160a01b038316908117909155620001c76000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620002ae5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620002e3578181015183820152602001620002c9565b50506000910152565b80516001600160a01b03811681146200030457600080fd5b919050565b600080604083850312156200031d57600080fd5b82516001600160401b03808211156200033557600080fd5b818501915085601f8301126200034a57600080fd5b8151818111156200035f576200035f620002b0565b604051601f8201601f19908116603f011681019083821181831017156200038a576200038a620002b0565b81604052828152886020848701011115620003a457600080fd5b620003b7836020830160208801620002c6565b8096505050505050620003cd60208401620002ec565b90509250929050565b600181811c90821680620003eb57607f821691505b6020821081036200040c57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200046057600081815260208120601f850160051c810160208610156200043b5750805b601f850160051c820191505b818110156200045c5782815560010162000447565b5050505b505050565b81516001600160401b03811115620004815762000481620002b0565b6200049981620004928454620003d6565b8462000412565b602080601f831160018114620004d15760008415620004b85750858301515b600019600386901b1c1916600185901b1785556200045c565b600085815260208120601f198616915b828110156200050257888601518255948401946001909101908401620004e1565b5085821015620005215787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000825162000545818460208701620002c6565b9190910192915050565b611ba3806200055f6000396000f3fe608060405234801561001057600080fd5b506004361061018e5760003560e01c806379ba5097116100de578063e30c397811610097578063f2fde38b11610071578063f2fde38b146102fa578063f48376801461030d578063f5a993e814610315578063fca513a81461032857600080fd5b8063e30c3978146102c3578063e6fc0d62146102d4578063ed301ca9146102e757600080fd5b806379ba5097146102745780638da5cb5b1461027c5780639d8499c01461028d578063b8202b95146102a0578063ca446dd9146102a8578063cdaa29de146102bb57600080fd5b80635eb88d3d1161014b578063715018a611610125578063715018a61461023e5780637492884b1461024657806374944cec1461024e57806376d84ffc1461026157600080fd5b80635eb88d3d1461021b5780636860485214610223578063707cd7161461023657600080fd5b80630e67178c1461019357806321f8a721146101b8578063324ffb41146101cb57806337f1c770146101e0578063530e784f146101f55780635dcc528c14610208575b600080fd5b61019b610330565b6040516001600160a01b0390911681526020015b60405180910390f35b61019b6101c6366004610fae565b61034c565b6101d3610367565b6040516101af9190611017565b6101f36101ee366004611046565b6103f9565b005b6101f3610203366004611046565b61048a565b6101f3610216366004611063565b610581565b61019b610604565b6101f36102313660046110a9565b610627565b61019b61063b565b6101f3610654565b61019b610668565b6101f361025c366004611046565b610683565b6101f361026f366004611046565b61071c565b6101f36107a9565b6000546001600160a01b031661019b565b6101f361029b366004611046565b610825565b61019b6108b2565b6101f36102b6366004611063565b6108c5565b61019b61092b565b6001546001600160a01b031661019b565b6101f36102e2366004611046565b61094b565b6101f36102f5366004611046565b6109d4565b6101f3610308366004611046565b610a63565b61019b610ad4565b6101f3610323366004611046565b610af4565b61019b610b63565b60006103476820a1a62fa0a226a4a760b91b61034c565b905090565b6000908152600360205260409020546001600160a01b031690565b6060600280546103769061115a565b80601f01602080910402602001604051908101604052809291908181526020018280546103a29061115a565b80156103ef5780601f106103c4576101008083540402835291602001916103ef565b820191906000526020600020905b8154815290600101906020018083116103d257829003601f168201915b5050505050905090565b610401610bcd565b6c2220aa20afa82927ab24a222a960991b600090815260036020527fed2a65becfbdb9e7869b8fd5fc6e9cc70c90b29710e4c5a245539f64473b9f0380546001600160a01b038481166001600160a01b03198316811790935560405191169283917fa7ebf856dd86b972f8ad2b03841565d63c094d2840d9dce40ee8ba99c99ae5479190a35050565b610492610bcd565b6001600160a01b038116156104f95760405163a3829b4f60e01b81523060048201526001600160a01b0382169063a3829b4f9060240160006040518083038186803b1580156104e057600080fd5b505afa1580156104f4573d6000803e3d6000fd5b505050505b6b50524943455f4f5241434c4560a01b600090815260036020527f49aa812bb7f5f78b1c8363a86d94a5863bc7d044598c3c8cf46abd0adf304ee480546001600160a01b038481166001600160a01b03198316811790935560405191169283917f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd9190a35050565b610589610bcd565b6000828152600360205260408120546001600160a01b0316906105ab84610c27565b6040516001600160a01b0380831682529192508185169184169086907f3bbd45b5429b385e3fb37ad5cd1cd1435a3c8ec32196c7937597365a3fd3e99c9060200160405180910390a46105fe8484610cc4565b50505050565b60006103477414149250d157d3d49050d31157d4d1539512539153605a1b61034c565b61062f610bcd565b61063881610e91565b50565b60006103476a20a1a62fa6a0a720a3a2a960a91b61034c565b61065c610bcd565b6106666000610f88565b565b60006103476c2220aa20afa82927ab24a222a960991b61034c565b61068b610bcd565b7414149250d157d3d49050d31157d4d1539512539153605a1b600090815260036020527fcb5e3d52bdbc45a8d0341dd017907e55d787ca295e1a3f456c3f25b5b434f84780546001600160a01b038481166001600160a01b03198316811790935560405191169283917f5326514eeca90494a14bedabcff812a0e683029ee85d1e23824d44fd14cd6ae79190a35050565b610724610bcd565b6820a1a62fa0a226a4a760b91b600090815260036020527f55732892dfa57bfac92f7e84f8b5d8cfb85740ee0f09338d020f7d3d5257795c80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fe9cf53972264dc95304fd424458745019ddfca0e37ae8f703d74772c41ad115b9190a35050565b60015433906001600160a01b0316811461081c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61063881610f88565b61082d610bcd565b600061084d7123aaa4a6222fa927a622afa6a0a720a3a2a960711b610c27565b9050816001600160a01b0316816001600160a01b03167f21fb3d4bed81a2be744e49aa665aa498ae91023ab4888ad36216cc7d2d6e4f9260405160405180910390a36108ae7123aaa4a6222fa927a622afa6a0a720a3a2a960711b83610cc4565b5050565b60006103476411d552531160da1b61034c565b6108cd610bcd565b60008281526003602052604080822080546001600160a01b031981166001600160a01b038681169182179093559251911692839186917f9ef0e8c8e52743bb38b83b17d9429141d494b8041ca6d616a6c77cebae9cd8b791a4505050565b60006103477123aaa4a6222fa1a7a72324a3aaa920aa27a960711b61034c565b610953610bcd565b60006109737123aaa4a6222fa1a7a72324a3aaa920aa27a960711b610c27565b9050816001600160a01b0316816001600160a01b03167f2d5349bc9521be85f9ebeda1b746eb6f6c7f3852abacb1248152350f22fb071c60405160405180910390a36108ae7123aaa4a6222fa1a7a72324a3aaa920aa27a960711b83610cc4565b6109dc610bcd565b6a20a1a62fa6a0a720a3a2a960a91b600090815260036020527fa1a81b35d6bdc099882808625e72491cb83b4795d887013151e2bafedee6fbea80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fb30efa04327bb8a537d61cc1e5c48095345ad18ef7cc04e6bacf7dfb6caaf5079190a35050565b610a6b610bcd565b600180546001600160a01b0383166001600160a01b03199091168117909155610a9c6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60006103477123aaa4a6222fa927a622afa6a0a720a3a2a960711b61034c565b610afc610bcd565b6000610b0f6411d552531160da1b610c27565b9050816001600160a01b0316816001600160a01b03167f57ce93fbdeab41b9ac6e4758a2b38bab5bff62a3726b5986cc1b073a0b029ddd60405160405180910390a36108ae6411d552531160da1b83610cc4565b60006103476b50524943455f4f5241434c4560a01b61034c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146106665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610813565b6000818152600360205260408120546001600160a01b031680610c4d5750600092915050565b6000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb6919061118e565b949350505050565b50919050565b6000828152600360205260408082205490513060248201526001600160a01b039091169190819060440160408051601f198184030181529190526020810180516001600160e01b031663189acdbd60e31b17905290506001600160a01b038316610e265730604051610d3590610fa1565b6001600160a01b039091168152602001604051809103906000f080158015610d61573d6000803e3d6000fd5b5060008681526003602052604080822080546001600160a01b0319166001600160a01b038581169182179092559151939650869550871692909188917f4a465a9bd819d9662563c1e11ae958f8109e437e7f4bf1c6ef0b9a7b3f35d4789190a460405163347d5e2560e21b81526001600160a01b0383169063d1f5789490610def90879085906004016111ab565b600060405180830381600087803b158015610e0957600080fd5b505af1158015610e1d573d6000803e3d6000fd5b50505050610e8a565b60405163278f794360e11b81528392506001600160a01b03831690634f1ef28690610e5790879085906004016111ab565b600060405180830381600087803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b505050505b5050505050565b600060028054610ea09061115a565b80601f0160208091040260200160405190810160405280929190818152602001828054610ecc9061115a565b8015610f195780601f10610eee57610100808354040283529160200191610f19565b820191906000526020600020905b815481529060010190602001808311610efc57829003601f168201915b505050505090508160029081610f2f919061121e565b5081604051610f3e91906112de565b604051809103902081604051610f5491906112de565b604051908190038120907fc647161511e63bffc7542ae60a2d1b772e5ad95dd2730ef08f6891f0c1abd36690600090a35050565b600180546001600160a01b031916905561063881610b7d565b610873806112fb83390190565b600060208284031215610fc057600080fd5b5035919050565b60005b83811015610fe2578181015183820152602001610fca565b50506000910152565b60008151808452611003816020860160208601610fc7565b601f01601f19169290920160200192915050565b60208152600061102a6020830184610feb565b9392505050565b6001600160a01b038116811461063857600080fd5b60006020828403121561105857600080fd5b813561102a81611031565b6000806040838503121561107657600080fd5b82359150602083013561108881611031565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156110bb57600080fd5b813567ffffffffffffffff808211156110d357600080fd5b818401915084601f8301126110e757600080fd5b8135818111156110f9576110f9611093565b604051601f8201601f19908116603f0116810190838211818310171561112157611121611093565b8160405282815287602084870101111561113a57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c9082168061116e57607f821691505b602082108103610cbe57634e487b7160e01b600052602260045260246000fd5b6000602082840312156111a057600080fd5b815161102a81611031565b6001600160a01b0383168152604060208201819052600090610cb690830184610feb565b601f82111561121957600081815260208120601f850160051c810160208610156111f65750805b601f850160051c820191505b8181101561121557828155600101611202565b5050505b505050565b815167ffffffffffffffff81111561123857611238611093565b61124c81611246845461115a565b846111cf565b602080601f83116001811461128157600084156112695750858301515b600019600386901b1c1916600185901b178555611215565b600085815260208120601f198616915b828110156112b057888601518255948401946001909101908401611291565b50858210156112ce5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516112f0818460208701610fc7565b919091019291505056fe60a060405234801561001057600080fd5b5060405161087338038061087383398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516107c56100ae60003960008181610112015281816101560152818161020e0152818161034d0152818161037601526104a001526107c56000f3fe60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100745780635c60da1b14610087578063d1f57894146100b8578063f851a440146100cb575b6100526100e0565b005b34801561006057600080fd5b5061005261006f366004610576565b610108565b610052610082366004610598565b61014c565b34801561009357600080fd5b5061009c610202565b6040516001600160a01b03909116815260200160405180910390f35b6100526100c6366004610631565b610253565b3480156100d757600080fd5b5061009c610341565b6100e8610398565b6101066101016000805160206107708339815191525490565b6103a0565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361014457610141816103c4565b50565b6101416100e0565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101f557610185836103c4565b6000836001600160a01b031683836040516101a19291906106f3565b600060405180830381855af49150503d80600081146101dc576040519150601f19603f3d011682016040523d82523d6000602084013e6101e1565b606091505b50509050806101ef57600080fd5b50505050565b6101fd6100e0565b505050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361024857506000805160206107708339815191525490565b6102506100e0565b90565b600061026b6000805160206107708339815191525490565b6001600160a01b03161461027e57600080fd5b6102a960017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610703565b600080516020610770833981519152146102c5576102c561072a565b6102ce82610404565b80511561033d576000826001600160a01b0316826040516102ef9190610740565b600060405180830381855af49150503d806000811461032a576040519150601f19603f3d011682016040523d82523d6000602084013e61032f565b606091505b50509050806101fd57600080fd5b5050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361024857507f000000000000000000000000000000000000000000000000000000000000000090565b610106610496565b3660008037600080366000845af43d6000803e8080156103bf573d6000f35b3d6000fd5b6103cd81610404565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61040d8161051e565b6104845760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084015b60405180910390fd5b60008051602061077083398151915255565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101065760405162461bcd60e51b815260206004820152602760248201527f43616e742063616c6c2066616c6c6261636b2066786e2066726f6d2070726f786044820152663c9030b236b4b760c91b606482015260840161047b565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061055257508115155b949350505050565b80356001600160a01b038116811461057157600080fd5b919050565b60006020828403121561058857600080fd5b6105918261055a565b9392505050565b6000806000604084860312156105ad57600080fd5b6105b68461055a565b9250602084013567ffffffffffffffff808211156105d357600080fd5b818601915086601f8301126105e757600080fd5b8135818111156105f657600080fd5b87602082850101111561060857600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561064457600080fd5b61064d8361055a565b9150602083013567ffffffffffffffff8082111561066a57600080fd5b818501915085601f83011261067e57600080fd5b8135818111156106905761069061061b565b604051601f8201601f19908116603f011681019083821181831017156106b8576106b861061b565b816040528281528860208487010111156106d157600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b8183823760009101908152919050565b8181038181111561072457634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b6000825160005b818110156107615760208186018101518583015201610747565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209e24cc0388f528f21f1f27dcf7d11c6940ea1a37357f6f77af56407ef44e5bf464736f6c63430008110033a2646970667358221220f43c9a14ed2f3f95853db126ea9493c6e4510d7ceed070d1d210a177fca5bdce64736f6c63430008110033000000000000000000000000000000000000000000000000000000000000004000000000000000000000000035f04de77214f45d42b7502b5262895443dc78ba000000000000000000000000000000000000000000000000000000000000001054617a7a20446562742028546573742900000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806379ba5097116100de578063e30c397811610097578063f2fde38b11610071578063f2fde38b146102fa578063f48376801461030d578063f5a993e814610315578063fca513a81461032857600080fd5b8063e30c3978146102c3578063e6fc0d62146102d4578063ed301ca9146102e757600080fd5b806379ba5097146102745780638da5cb5b1461027c5780639d8499c01461028d578063b8202b95146102a0578063ca446dd9146102a8578063cdaa29de146102bb57600080fd5b80635eb88d3d1161014b578063715018a611610125578063715018a61461023e5780637492884b1461024657806374944cec1461024e57806376d84ffc1461026157600080fd5b80635eb88d3d1461021b5780636860485214610223578063707cd7161461023657600080fd5b80630e67178c1461019357806321f8a721146101b8578063324ffb41146101cb57806337f1c770146101e0578063530e784f146101f55780635dcc528c14610208575b600080fd5b61019b610330565b6040516001600160a01b0390911681526020015b60405180910390f35b61019b6101c6366004610fae565b61034c565b6101d3610367565b6040516101af9190611017565b6101f36101ee366004611046565b6103f9565b005b6101f3610203366004611046565b61048a565b6101f3610216366004611063565b610581565b61019b610604565b6101f36102313660046110a9565b610627565b61019b61063b565b6101f3610654565b61019b610668565b6101f361025c366004611046565b610683565b6101f361026f366004611046565b61071c565b6101f36107a9565b6000546001600160a01b031661019b565b6101f361029b366004611046565b610825565b61019b6108b2565b6101f36102b6366004611063565b6108c5565b61019b61092b565b6001546001600160a01b031661019b565b6101f36102e2366004611046565b61094b565b6101f36102f5366004611046565b6109d4565b6101f3610308366004611046565b610a63565b61019b610ad4565b6101f3610323366004611046565b610af4565b61019b610b63565b60006103476820a1a62fa0a226a4a760b91b61034c565b905090565b6000908152600360205260409020546001600160a01b031690565b6060600280546103769061115a565b80601f01602080910402602001604051908101604052809291908181526020018280546103a29061115a565b80156103ef5780601f106103c4576101008083540402835291602001916103ef565b820191906000526020600020905b8154815290600101906020018083116103d257829003601f168201915b5050505050905090565b610401610bcd565b6c2220aa20afa82927ab24a222a960991b600090815260036020527fed2a65becfbdb9e7869b8fd5fc6e9cc70c90b29710e4c5a245539f64473b9f0380546001600160a01b038481166001600160a01b03198316811790935560405191169283917fa7ebf856dd86b972f8ad2b03841565d63c094d2840d9dce40ee8ba99c99ae5479190a35050565b610492610bcd565b6001600160a01b038116156104f95760405163a3829b4f60e01b81523060048201526001600160a01b0382169063a3829b4f9060240160006040518083038186803b1580156104e057600080fd5b505afa1580156104f4573d6000803e3d6000fd5b505050505b6b50524943455f4f5241434c4560a01b600090815260036020527f49aa812bb7f5f78b1c8363a86d94a5863bc7d044598c3c8cf46abd0adf304ee480546001600160a01b038481166001600160a01b03198316811790935560405191169283917f56b5f80d8cac1479698aa7d01605fd6111e90b15fc4d2b377417f46034876cbd9190a35050565b610589610bcd565b6000828152600360205260408120546001600160a01b0316906105ab84610c27565b6040516001600160a01b0380831682529192508185169184169086907f3bbd45b5429b385e3fb37ad5cd1cd1435a3c8ec32196c7937597365a3fd3e99c9060200160405180910390a46105fe8484610cc4565b50505050565b60006103477414149250d157d3d49050d31157d4d1539512539153605a1b61034c565b61062f610bcd565b61063881610e91565b50565b60006103476a20a1a62fa6a0a720a3a2a960a91b61034c565b61065c610bcd565b6106666000610f88565b565b60006103476c2220aa20afa82927ab24a222a960991b61034c565b61068b610bcd565b7414149250d157d3d49050d31157d4d1539512539153605a1b600090815260036020527fcb5e3d52bdbc45a8d0341dd017907e55d787ca295e1a3f456c3f25b5b434f84780546001600160a01b038481166001600160a01b03198316811790935560405191169283917f5326514eeca90494a14bedabcff812a0e683029ee85d1e23824d44fd14cd6ae79190a35050565b610724610bcd565b6820a1a62fa0a226a4a760b91b600090815260036020527f55732892dfa57bfac92f7e84f8b5d8cfb85740ee0f09338d020f7d3d5257795c80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fe9cf53972264dc95304fd424458745019ddfca0e37ae8f703d74772c41ad115b9190a35050565b60015433906001600160a01b0316811461081c5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b61063881610f88565b61082d610bcd565b600061084d7123aaa4a6222fa927a622afa6a0a720a3a2a960711b610c27565b9050816001600160a01b0316816001600160a01b03167f21fb3d4bed81a2be744e49aa665aa498ae91023ab4888ad36216cc7d2d6e4f9260405160405180910390a36108ae7123aaa4a6222fa927a622afa6a0a720a3a2a960711b83610cc4565b5050565b60006103476411d552531160da1b61034c565b6108cd610bcd565b60008281526003602052604080822080546001600160a01b031981166001600160a01b038681169182179093559251911692839186917f9ef0e8c8e52743bb38b83b17d9429141d494b8041ca6d616a6c77cebae9cd8b791a4505050565b60006103477123aaa4a6222fa1a7a72324a3aaa920aa27a960711b61034c565b610953610bcd565b60006109737123aaa4a6222fa1a7a72324a3aaa920aa27a960711b610c27565b9050816001600160a01b0316816001600160a01b03167f2d5349bc9521be85f9ebeda1b746eb6f6c7f3852abacb1248152350f22fb071c60405160405180910390a36108ae7123aaa4a6222fa1a7a72324a3aaa920aa27a960711b83610cc4565b6109dc610bcd565b6a20a1a62fa6a0a720a3a2a960a91b600090815260036020527fa1a81b35d6bdc099882808625e72491cb83b4795d887013151e2bafedee6fbea80546001600160a01b038481166001600160a01b03198316811790935560405191169283917fb30efa04327bb8a537d61cc1e5c48095345ad18ef7cc04e6bacf7dfb6caaf5079190a35050565b610a6b610bcd565b600180546001600160a01b0383166001600160a01b03199091168117909155610a9c6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b60006103477123aaa4a6222fa927a622afa6a0a720a3a2a960711b61034c565b610afc610bcd565b6000610b0f6411d552531160da1b610c27565b9050816001600160a01b0316816001600160a01b03167f57ce93fbdeab41b9ac6e4758a2b38bab5bff62a3726b5986cc1b073a0b029ddd60405160405180910390a36108ae6411d552531160da1b83610cc4565b60006103476b50524943455f4f5241434c4560a01b61034c565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146106665760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610813565b6000818152600360205260408120546001600160a01b031680610c4d5750600092915050565b6000819050806001600160a01b0316635c60da1b6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610c92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb6919061118e565b949350505050565b50919050565b6000828152600360205260408082205490513060248201526001600160a01b039091169190819060440160408051601f198184030181529190526020810180516001600160e01b031663189acdbd60e31b17905290506001600160a01b038316610e265730604051610d3590610fa1565b6001600160a01b039091168152602001604051809103906000f080158015610d61573d6000803e3d6000fd5b5060008681526003602052604080822080546001600160a01b0319166001600160a01b038581169182179092559151939650869550871692909188917f4a465a9bd819d9662563c1e11ae958f8109e437e7f4bf1c6ef0b9a7b3f35d4789190a460405163347d5e2560e21b81526001600160a01b0383169063d1f5789490610def90879085906004016111ab565b600060405180830381600087803b158015610e0957600080fd5b505af1158015610e1d573d6000803e3d6000fd5b50505050610e8a565b60405163278f794360e11b81528392506001600160a01b03831690634f1ef28690610e5790879085906004016111ab565b600060405180830381600087803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b505050505b5050505050565b600060028054610ea09061115a565b80601f0160208091040260200160405190810160405280929190818152602001828054610ecc9061115a565b8015610f195780601f10610eee57610100808354040283529160200191610f19565b820191906000526020600020905b815481529060010190602001808311610efc57829003601f168201915b505050505090508160029081610f2f919061121e565b5081604051610f3e91906112de565b604051809103902081604051610f5491906112de565b604051908190038120907fc647161511e63bffc7542ae60a2d1b772e5ad95dd2730ef08f6891f0c1abd36690600090a35050565b600180546001600160a01b031916905561063881610b7d565b610873806112fb83390190565b600060208284031215610fc057600080fd5b5035919050565b60005b83811015610fe2578181015183820152602001610fca565b50506000910152565b60008151808452611003816020860160208601610fc7565b601f01601f19169290920160200192915050565b60208152600061102a6020830184610feb565b9392505050565b6001600160a01b038116811461063857600080fd5b60006020828403121561105857600080fd5b813561102a81611031565b6000806040838503121561107657600080fd5b82359150602083013561108881611031565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6000602082840312156110bb57600080fd5b813567ffffffffffffffff808211156110d357600080fd5b818401915084601f8301126110e757600080fd5b8135818111156110f9576110f9611093565b604051601f8201601f19908116603f0116810190838211818310171561112157611121611093565b8160405282815287602084870101111561113a57600080fd5b826020860160208301376000928101602001929092525095945050505050565b600181811c9082168061116e57607f821691505b602082108103610cbe57634e487b7160e01b600052602260045260246000fd5b6000602082840312156111a057600080fd5b815161102a81611031565b6001600160a01b0383168152604060208201819052600090610cb690830184610feb565b601f82111561121957600081815260208120601f850160051c810160208610156111f65750805b601f850160051c820191505b8181101561121557828155600101611202565b5050505b505050565b815167ffffffffffffffff81111561123857611238611093565b61124c81611246845461115a565b846111cf565b602080601f83116001811461128157600084156112695750858301515b600019600386901b1c1916600185901b178555611215565b600085815260208120601f198616915b828110156112b057888601518255948401946001909101908401611291565b50858210156112ce5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082516112f0818460208701610fc7565b919091019291505056fe60a060405234801561001057600080fd5b5060405161087338038061087383398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516107c56100ae60003960008181610112015281816101560152818161020e0152818161034d0152818161037601526104a001526107c56000f3fe60806040526004361061004a5760003560e01c80633659cfe6146100545780634f1ef286146100745780635c60da1b14610087578063d1f57894146100b8578063f851a440146100cb575b6100526100e0565b005b34801561006057600080fd5b5061005261006f366004610576565b610108565b610052610082366004610598565b61014c565b34801561009357600080fd5b5061009c610202565b6040516001600160a01b03909116815260200160405180910390f35b6100526100c6366004610631565b610253565b3480156100d757600080fd5b5061009c610341565b6100e8610398565b6101066101016000805160206107708339815191525490565b6103a0565b565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361014457610141816103c4565b50565b6101416100e0565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101f557610185836103c4565b6000836001600160a01b031683836040516101a19291906106f3565b600060405180830381855af49150503d80600081146101dc576040519150601f19603f3d011682016040523d82523d6000602084013e6101e1565b606091505b50509050806101ef57600080fd5b50505050565b6101fd6100e0565b505050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361024857506000805160206107708339815191525490565b6102506100e0565b90565b600061026b6000805160206107708339815191525490565b6001600160a01b03161461027e57600080fd5b6102a960017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610703565b600080516020610770833981519152146102c5576102c561072a565b6102ce82610404565b80511561033d576000826001600160a01b0316826040516102ef9190610740565b600060405180830381855af49150503d806000811461032a576040519150601f19603f3d011682016040523d82523d6000602084013e61032f565b606091505b50509050806101fd57600080fd5b5050565b60006001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016330361024857507f000000000000000000000000000000000000000000000000000000000000000090565b610106610496565b3660008037600080366000845af43d6000803e8080156103bf573d6000f35b3d6000fd5b6103cd81610404565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b61040d8161051e565b6104845760405162461bcd60e51b815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000060648201526084015b60405180910390fd5b60008051602061077083398151915255565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633036101065760405162461bcd60e51b815260206004820152602760248201527f43616e742063616c6c2066616c6c6261636b2066786e2066726f6d2070726f786044820152663c9030b236b4b760c91b606482015260840161047b565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061055257508115155b949350505050565b80356001600160a01b038116811461057157600080fd5b919050565b60006020828403121561058857600080fd5b6105918261055a565b9392505050565b6000806000604084860312156105ad57600080fd5b6105b68461055a565b9250602084013567ffffffffffffffff808211156105d357600080fd5b818601915086601f8301126105e757600080fd5b8135818111156105f657600080fd5b87602082850101111561060857600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561064457600080fd5b61064d8361055a565b9150602083013567ffffffffffffffff8082111561066a57600080fd5b818501915085601f83011261067e57600080fd5b8135818111156106905761069061061b565b604051601f8201601f19908116603f011681019083821181831017156106b8576106b861061b565b816040528281528860208487010111156106d157600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b8183823760009101908152919050565b8181038181111561072457634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052600160045260246000fd5b6000825160005b818110156107615760208186018101518583015201610747565b50600092019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212209e24cc0388f528f21f1f27dcf7d11c6940ea1a37357f6f77af56407ef44e5bf464736f6c63430008110033a2646970667358221220f43c9a14ed2f3f95853db126ea9493c6e4510d7ceed070d1d210a177fca5bdce64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000004000000000000000000000000035f04de77214f45d42b7502b5262895443dc78ba000000000000000000000000000000000000000000000000000000000000001054617a7a20446562742028546573742900000000000000000000000000000000
-----Decoded View---------------
Arg [0] : guildId (string): Tazz Debt (Test)
Arg [1] : owner (address): 0x35F04DE77214F45d42B7502b5262895443Dc78Ba
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 00000000000000000000000035f04de77214f45d42b7502b5262895443dc78ba
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000010
Arg [3] : 54617a7a20446562742028546573742900000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.