Source Code
Overview
GLMR Balance
GLMR Value
$0.00Latest 15 from a total of 15 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Revoke Role | 4014016 | 925 days ago | IN | 0 GLMR | 0.00397585 | ||||
| Grant Role | 4014013 | 925 days ago | IN | 0 GLMR | 0.00749934 | ||||
| Remove Pool Admi... | 4014011 | 925 days ago | IN | 0 GLMR | 0.00427215 | ||||
| Add Pool Admin | 4014007 | 925 days ago | IN | 0 GLMR | 0.0075025 | ||||
| Remove Pool Admi... | 4013954 | 925 days ago | IN | 0 GLMR | 0.00436062 | ||||
| Add Pool Admin | 4013949 | 925 days ago | IN | 0 GLMR | 0.00765958 | ||||
| Add Risk Admin | 4013864 | 925 days ago | IN | 0 GLMR | 0.00776634 | ||||
| Add Emergency Ad... | 4013862 | 925 days ago | IN | 0 GLMR | 0.00776694 | ||||
| Add Emergency Ad... | 4013860 | 925 days ago | IN | 0 GLMR | 0.0077778 | ||||
| Add Emergency Ad... | 4013857 | 925 days ago | IN | 0 GLMR | 0.00779344 | ||||
| Add Emergency Ad... | 4013855 | 925 days ago | IN | 0 GLMR | 0.00780694 | ||||
| Add Emergency Ad... | 4013853 | 925 days ago | IN | 0 GLMR | 0.00781791 | ||||
| Add Emergency Ad... | 4013851 | 925 days ago | IN | 0 GLMR | 0.00783113 | ||||
| Add Asset Listin... | 4013849 | 925 days ago | IN | 0 GLMR | 0.0078411 | ||||
| Add Pool Admin | 4013847 | 925 days ago | IN | 0 GLMR | 0.00785644 |
View more zero value Internal Transactions in Advanced View mode
Cross-Chain Transactions
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xdB1b3b79...6ef4bE4c8 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
ACLManager
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.0;
import {AccessControl} from "../../dependencies/openzeppelin/contracts/AccessControl.sol";
import {IPoolAddressesProvider} from "../../interfaces/IPoolAddressesProvider.sol";
import {IACLManager} from "../../interfaces/IACLManager.sol";
import {Errors} from "../libraries/helpers/Errors.sol";
/**
* @title ACLManager
*
* @notice Access Control List Manager. Main registry of system roles and permissions.
*/
contract ACLManager is AccessControl, IACLManager {
bytes32 public constant override POOL_ADMIN_ROLE = keccak256("POOL_ADMIN");
bytes32 public constant override EMERGENCY_ADMIN_ROLE =
keccak256("EMERGENCY_ADMIN");
bytes32 public constant override RISK_ADMIN_ROLE = keccak256("RISK_ADMIN");
bytes32 public constant override FLASH_BORROWER_ROLE =
keccak256("FLASH_BORROWER");
bytes32 public constant override BRIDGE_ROLE = keccak256("BRIDGE");
bytes32 public constant override ASSET_LISTING_ADMIN_ROLE =
keccak256("ASSET_LISTING_ADMIN");
IPoolAddressesProvider public immutable ADDRESSES_PROVIDER;
/**
* @dev Constructor
* @dev The ACL admin should be initialized at the addressesProvider beforehand
* @param provider The address of the PoolAddressesProvider
*/
constructor(IPoolAddressesProvider provider) {
ADDRESSES_PROVIDER = provider;
address aclAdmin = provider.getACLAdmin();
require(aclAdmin != address(0), Errors.ACL_ADMIN_CANNOT_BE_ZERO);
_setupRole(DEFAULT_ADMIN_ROLE, aclAdmin);
}
/// @inheritdoc IACLManager
function setRoleAdmin(bytes32 role, bytes32 adminRole)
external
override
onlyRole(DEFAULT_ADMIN_ROLE)
{
_setRoleAdmin(role, adminRole);
}
/// @inheritdoc IACLManager
function addPoolAdmin(address admin) external override {
grantRole(POOL_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function removePoolAdmin(address admin) external override {
revokeRole(POOL_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function isPoolAdmin(address admin) external view override returns (bool) {
return hasRole(POOL_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function addEmergencyAdmin(address admin) external override {
grantRole(EMERGENCY_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function removeEmergencyAdmin(address admin) external override {
revokeRole(EMERGENCY_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function isEmergencyAdmin(address admin)
external
view
override
returns (bool)
{
return hasRole(EMERGENCY_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function addRiskAdmin(address admin) external override {
grantRole(RISK_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function removeRiskAdmin(address admin) external override {
revokeRole(RISK_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function isRiskAdmin(address admin) external view override returns (bool) {
return hasRole(RISK_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function addFlashBorrower(address borrower) external override {
grantRole(FLASH_BORROWER_ROLE, borrower);
}
/// @inheritdoc IACLManager
function removeFlashBorrower(address borrower) external override {
revokeRole(FLASH_BORROWER_ROLE, borrower);
}
/// @inheritdoc IACLManager
function isFlashBorrower(address borrower)
external
view
override
returns (bool)
{
return hasRole(FLASH_BORROWER_ROLE, borrower);
}
/// @inheritdoc IACLManager
function addBridge(address bridge) external override {
grantRole(BRIDGE_ROLE, bridge);
}
/// @inheritdoc IACLManager
function removeBridge(address bridge) external override {
revokeRole(BRIDGE_ROLE, bridge);
}
/// @inheritdoc IACLManager
function isBridge(address bridge) external view override returns (bool) {
return hasRole(BRIDGE_ROLE, bridge);
}
/// @inheritdoc IACLManager
function addAssetListingAdmin(address admin) external override {
grantRole(ASSET_LISTING_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function removeAssetListingAdmin(address admin) external override {
revokeRole(ASSET_LISTING_ADMIN_ROLE, admin);
}
/// @inheritdoc IACLManager
function isAssetListingAdmin(address admin)
external
view
override
returns (bool)
{
return hasRole(ASSET_LISTING_ADMIN_ROLE, admin);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "./Context.sol";
import "./Strings.sol";
import "./ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IAccessControl).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account)
public
view
override
returns (bool)
{
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account)
public
virtual
override
{
require(
account == _msgSender(),
"AccessControl: can only renounce roles for self"
);
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) private {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {DataTypes} from "../protocol/libraries/types/DataTypes.sol";
import {IParaProxy} from "../interfaces/IParaProxy.sol";
/**
* @title IPoolAddressesProvider
*
* @notice Defines the basic interface for a Pool Addresses Provider.
**/
interface IPoolAddressesProvider {
/**
* @dev Emitted when the market identifier is updated.
* @param oldMarketId The old id of the market
* @param newMarketId The new id of the market
*/
event MarketIdSet(string indexed oldMarketId, string indexed newMarketId);
/**
* @dev Emitted when the pool is updated.
* @param implementationParams The old address of the Pool
* @param _init The new address to call upon upgrade
* @param _calldata The calldata input for the call
*/
event PoolUpdated(
IParaProxy.ProxyImplementation[] indexed implementationParams,
address _init,
bytes _calldata
);
/**
* @dev Emitted when the pool configurator is updated.
* @param oldAddress The old address of the PoolConfigurator
* @param newAddress The new address of the PoolConfigurator
*/
event PoolConfiguratorUpdated(
address indexed oldAddress,
address indexed newAddress
);
/**
* @dev Emitted when the WETH is updated.
* @param oldAddress The old address of the WETH
* @param newAddress The new address of the WETH
*/
event WETHUpdated(address indexed oldAddress, address indexed newAddress);
/**
* @dev Emitted when the price oracle is updated.
* @param oldAddress The old address of the PriceOracle
* @param newAddress The new address of the PriceOracle
*/
event PriceOracleUpdated(
address indexed oldAddress,
address indexed newAddress
);
/**
* @dev Emitted when the ACL manager is updated.
* @param oldAddress The old address of the ACLManager
* @param newAddress The new address of the ACLManager
*/
event ACLManagerUpdated(
address indexed oldAddress,
address indexed newAddress
);
/**
* @dev Emitted when the ACL admin is updated.
* @param oldAddress The old address of the ACLAdmin
* @param newAddress The new address of the ACLAdmin
*/
event ACLAdminUpdated(
address indexed oldAddress,
address indexed newAddress
);
/**
* @dev Emitted when the price oracle sentinel is updated.
* @param oldAddress The old address of the PriceOracleSentinel
* @param newAddress The new address of the PriceOracleSentinel
*/
event PriceOracleSentinelUpdated(
address indexed oldAddress,
address indexed newAddress
);
/**
* @dev Emitted when the pool data provider is updated.
* @param oldAddress The old address of the PoolDataProvider
* @param newAddress The new address of the PoolDataProvider
*/
event ProtocolDataProviderUpdated(
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 proxy is created.
* @param id The identifier of the proxy
* @param proxyAddress The address of the created proxy contract
* @param implementationParams The params of the implementation update
*/
event ParaProxyCreated(
bytes32 indexed id,
address indexed proxyAddress,
IParaProxy.ProxyImplementation[] indexed implementationParams
);
/**
* @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 implementationParams The params of the implementation update
*/
event ParaProxyUpdated(
bytes32 indexed id,
address indexed proxyAddress,
IParaProxy.ProxyImplementation[] indexed implementationParams
);
/**
* @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
);
/**
* @dev Emitted when the marketplace registered is updated
* @param id The identifier of the marketplace
* @param marketplace The address of the marketplace contract
* @param adapter The address of the marketplace adapter contract
* @param operator The address of the marketplace transfer helper
* @param paused Is the marketplace adapter paused
*/
event MarketplaceUpdated(
bytes32 indexed id,
address indexed marketplace,
address indexed adapter,
address operator,
bool paused
);
/**
* @notice Returns the id of the ParaSpace market to which this contract points to.
* @return The market id
**/
function getMarketId() external view returns (string memory);
/**
* @notice Associates an id with a specific PoolAddressesProvider.
* @dev This can be used to create an onchain registry of PoolAddressesProviders to
* identify and validate multiple ParaSpace markets.
* @param newMarketId The market id
*/
function setMarketId(string calldata newMarketId) external;
/**
* @notice Returns an address by its identifier.
* @dev The returned address might be an EOA or a contract, potentially proxied
* @dev It returns ZERO if there is no registered address with the given id
* @param id The id
* @return The address of the registered for the specified id
*/
function getAddress(bytes32 id) external view returns (address);
/**
* @notice General function to update the implementation of a proxy registered with
* certain `id`. If there is no proxy registered, it will instantiate one and
* set as implementation the `newImplementationAddress`.
* @dev IMPORTANT Use this function carefully, only for ids that don't have an explicit
* setter function, in order to avoid unexpected consequences
* @param id The id
* @param newImplementationAddress The address of the new implementation
*/
function setAddressAsProxy(bytes32 id, address newImplementationAddress)
external;
/**
* @notice Sets an address for an id replacing the address saved in the addresses map.
* @dev IMPORTANT Use this function carefully, as it will do a hard replacement
* @param id The id
* @param newAddress The address to set
*/
function setAddress(bytes32 id, address newAddress) external;
/**
* @notice Returns the address of the Pool proxy.
* @return The Pool proxy address
**/
function getPool() external view returns (address);
/**
* @notice Updates the implementation of the Pool, or creates a proxy
* setting the new `pool` implementation when the function is called for the first time.
* @param implementationParams Contains the implementation addresses and function selectors
* @param _init The address of the contract or implementation to execute _calldata
* @param _calldata A function call, including function selector and arguments
* _calldata is executed with delegatecall on _init
**/
function updatePoolImpl(
IParaProxy.ProxyImplementation[] calldata implementationParams,
address _init,
bytes calldata _calldata
) external;
/**
* @notice Returns the address of the PoolConfigurator proxy.
* @return The PoolConfigurator proxy address
**/
function getPoolConfigurator() external view returns (address);
/**
* @notice Updates the implementation of the PoolConfigurator, or creates a proxy
* setting the new `PoolConfigurator` implementation when the function is called for the first time.
* @param newPoolConfiguratorImpl The new PoolConfigurator implementation
**/
function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external;
/**
* @notice Returns the address of the price oracle.
* @return The address of the PriceOracle
*/
function getPriceOracle() external view returns (address);
/**
* @notice Updates the address of the price oracle.
* @param newPriceOracle The address of the new PriceOracle
*/
function setPriceOracle(address newPriceOracle) external;
/**
* @notice Returns the address of the ACL manager.
* @return The address of the ACLManager
*/
function getACLManager() external view returns (address);
/**
* @notice Updates the address of the ACL manager.
* @param newAclManager The address of the new ACLManager
**/
function setACLManager(address newAclManager) external;
/**
* @notice Returns the address of the ACL admin.
* @return The address of the ACL admin
*/
function getACLAdmin() external view returns (address);
/**
* @notice Updates the address of the ACL admin.
* @param newAclAdmin The address of the new ACL admin
*/
function setACLAdmin(address newAclAdmin) external;
/**
* @notice Returns the address of the price oracle sentinel.
* @return The address of the PriceOracleSentinel
*/
function getPriceOracleSentinel() external view returns (address);
/**
* @notice Updates the address of the price oracle sentinel.
* @param newPriceOracleSentinel The address of the new PriceOracleSentinel
**/
function setPriceOracleSentinel(address newPriceOracleSentinel) external;
/**
* @notice Returns the address of the data provider.
* @return The address of the DataProvider
*/
function getPoolDataProvider() external view returns (address);
/**
* @notice Returns the address of the Wrapped ETH.
* @return The address of the Wrapped ETH
*/
function getWETH() external view returns (address);
/**
* @notice Returns the info of the marketplace.
* @return The info of the marketplace
*/
function getMarketplace(bytes32 id)
external
view
returns (DataTypes.Marketplace memory);
/**
* @notice Updates the address of the data provider.
* @param newDataProvider The address of the new DataProvider
**/
function setProtocolDataProvider(address newDataProvider) external;
/**
* @notice Updates the address of the WETH.
* @param newWETH The address of the new WETH
**/
function setWETH(address newWETH) external;
/**
* @notice Updates the info of the marketplace.
* @param marketplace The address of the marketplace
* @param adapter The contract which handles marketplace logic
* @param operator The contract which operates users' tokens
**/
function setMarketplace(
bytes32 id,
address marketplace,
address adapter,
address operator,
bool paused
) external;
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
import {IPoolAddressesProvider} from "./IPoolAddressesProvider.sol";
/**
* @title IACLManager
*
* @notice Defines the basic interface for the ACL Manager
**/
interface IACLManager {
/**
* @notice Returns the contract address of the PoolAddressesProvider
* @return The address of the PoolAddressesProvider
*/
function ADDRESSES_PROVIDER()
external
view
returns (IPoolAddressesProvider);
/**
* @notice Returns the identifier of the PoolAdmin role
* @return The id of the PoolAdmin role
*/
function POOL_ADMIN_ROLE() external view returns (bytes32);
/**
* @notice Returns the identifier of the EmergencyAdmin role
* @return The id of the EmergencyAdmin role
*/
function EMERGENCY_ADMIN_ROLE() external view returns (bytes32);
/**
* @notice Returns the identifier of the RiskAdmin role
* @return The id of the RiskAdmin role
*/
function RISK_ADMIN_ROLE() external view returns (bytes32);
/**
* @notice Returns the identifier of the FlashBorrower role
* @return The id of the FlashBorrower role
*/
function FLASH_BORROWER_ROLE() external view returns (bytes32);
/**
* @notice Returns the identifier of the Bridge role
* @return The id of the Bridge role
*/
function BRIDGE_ROLE() external view returns (bytes32);
/**
* @notice Returns the identifier of the AssetListingAdmin role
* @return The id of the AssetListingAdmin role
*/
function ASSET_LISTING_ADMIN_ROLE() external view returns (bytes32);
/**
* @notice Set the role as admin of a specific role.
* @dev By default the admin role for all roles is `DEFAULT_ADMIN_ROLE`.
* @param role The role to be managed by the admin role
* @param adminRole The admin role
*/
function setRoleAdmin(bytes32 role, bytes32 adminRole) external;
/**
* @notice Adds a new admin as PoolAdmin
* @param admin The address of the new admin
*/
function addPoolAdmin(address admin) external;
/**
* @notice Removes an admin as PoolAdmin
* @param admin The address of the admin to remove
*/
function removePoolAdmin(address admin) external;
/**
* @notice Returns true if the address is PoolAdmin, false otherwise
* @param admin The address to check
* @return True if the given address is PoolAdmin, false otherwise
*/
function isPoolAdmin(address admin) external view returns (bool);
/**
* @notice Adds a new admin as EmergencyAdmin
* @param admin The address of the new admin
*/
function addEmergencyAdmin(address admin) external;
/**
* @notice Removes an admin as EmergencyAdmin
* @param admin The address of the admin to remove
*/
function removeEmergencyAdmin(address admin) external;
/**
* @notice Returns true if the address is EmergencyAdmin, false otherwise
* @param admin The address to check
* @return True if the given address is EmergencyAdmin, false otherwise
*/
function isEmergencyAdmin(address admin) external view returns (bool);
/**
* @notice Adds a new admin as RiskAdmin
* @param admin The address of the new admin
*/
function addRiskAdmin(address admin) external;
/**
* @notice Removes an admin as RiskAdmin
* @param admin The address of the admin to remove
*/
function removeRiskAdmin(address admin) external;
/**
* @notice Returns true if the address is RiskAdmin, false otherwise
* @param admin The address to check
* @return True if the given address is RiskAdmin, false otherwise
*/
function isRiskAdmin(address admin) external view returns (bool);
/**
* @notice Adds a new address as FlashBorrower
* @param borrower The address of the new FlashBorrower
*/
function addFlashBorrower(address borrower) external;
/**
* @notice Removes an admin as FlashBorrower
* @param borrower The address of the FlashBorrower to remove
*/
function removeFlashBorrower(address borrower) external;
/**
* @notice Returns true if the address is FlashBorrower, false otherwise
* @param borrower The address to check
* @return True if the given address is FlashBorrower, false otherwise
*/
function isFlashBorrower(address borrower) external view returns (bool);
/**
* @notice Adds a new address as Bridge
* @param bridge The address of the new Bridge
*/
function addBridge(address bridge) external;
/**
* @notice Removes an address as Bridge
* @param bridge The address of the bridge to remove
*/
function removeBridge(address bridge) external;
/**
* @notice Returns true if the address is Bridge, false otherwise
* @param bridge The address to check
* @return True if the given address is Bridge, false otherwise
*/
function isBridge(address bridge) external view returns (bool);
/**
* @notice Adds a new admin as AssetListingAdmin
* @param admin The address of the new admin
*/
function addAssetListingAdmin(address admin) external;
/**
* @notice Removes an admin as AssetListingAdmin
* @param admin The address of the admin to remove
*/
function removeAssetListingAdmin(address admin) external;
/**
* @notice Returns true if the address is AssetListingAdmin, false otherwise
* @param admin The address to check
* @return True if the given address is AssetListingAdmin, false otherwise
*/
function isAssetListingAdmin(address admin) external view returns (bool);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
/**
* @title Errors library
*
* @notice Defines the error messages emitted by the different contracts of the ParaSpace protocol
*/
library Errors {
string public constant CALLER_NOT_POOL_ADMIN = "1"; // 'The caller of the function is not a pool admin'
string public constant CALLER_NOT_EMERGENCY_ADMIN = "2"; // 'The caller of the function is not an emergency admin'
string public constant CALLER_NOT_POOL_OR_EMERGENCY_ADMIN = "3"; // 'The caller of the function is not a pool or emergency admin'
string public constant CALLER_NOT_RISK_OR_POOL_ADMIN = "4"; // 'The caller of the function is not a risk or pool admin'
string public constant CALLER_NOT_ASSET_LISTING_OR_POOL_ADMIN = "5"; // 'The caller of the function is not an asset listing or pool admin'
string public constant CALLER_NOT_BRIDGE = "6"; // 'The caller of the function is not a bridge'
string public constant ADDRESSES_PROVIDER_NOT_REGISTERED = "7"; // 'Pool addresses provider is not registered'
string public constant INVALID_ADDRESSES_PROVIDER_ID = "8"; // 'Invalid id for the pool addresses provider'
string public constant NOT_CONTRACT = "9"; // 'Address is not a contract'
string public constant CALLER_NOT_POOL_CONFIGURATOR = "10"; // 'The caller of the function is not the pool configurator'
string public constant CALLER_NOT_XTOKEN = "11"; // 'The caller of the function is not an PToken or NToken'
string public constant INVALID_ADDRESSES_PROVIDER = "12"; // 'The address of the pool addresses provider is invalid'
string public constant RESERVE_ALREADY_ADDED = "14"; // 'Reserve has already been added to reserve list'
string public constant NO_MORE_RESERVES_ALLOWED = "15"; // 'Maximum amount of reserves in the pool reached'
string public constant RESERVE_LIQUIDITY_NOT_ZERO = "18"; // 'The liquidity of the reserve needs to be 0'
string public constant INVALID_RESERVE_PARAMS = "20"; // 'Invalid risk parameters for the reserve'
string public constant CALLER_MUST_BE_POOL = "23"; // 'The caller of this function must be a pool'
string public constant INVALID_MINT_AMOUNT = "24"; // 'Invalid amount to mint'
string public constant INVALID_BURN_AMOUNT = "25"; // 'Invalid amount to burn'
string public constant INVALID_AMOUNT = "26"; // 'Amount must be greater than 0'
string public constant RESERVE_INACTIVE = "27"; // 'Action requires an active reserve'
string public constant RESERVE_FROZEN = "28"; // 'Action cannot be performed because the reserve is frozen'
string public constant RESERVE_PAUSED = "29"; // 'Action cannot be performed because the reserve is paused'
string public constant BORROWING_NOT_ENABLED = "30"; // 'Borrowing is not enabled'
string public constant STABLE_BORROWING_NOT_ENABLED = "31"; // 'Stable borrowing is not enabled'
string public constant NOT_ENOUGH_AVAILABLE_USER_BALANCE = "32"; // 'User cannot withdraw more than the available balance'
string public constant INVALID_INTEREST_RATE_MODE_SELECTED = "33"; // 'Invalid interest rate mode selected'
string public constant COLLATERAL_BALANCE_IS_ZERO = "34"; // 'The collateral balance is 0'
string public constant HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD =
"35"; // 'Health factor is lesser than the liquidation threshold'
string public constant COLLATERAL_CANNOT_COVER_NEW_BORROW = "36"; // 'There is not enough collateral to cover a new borrow'
string public constant COLLATERAL_SAME_AS_BORROWING_CURRENCY = "37"; // 'Collateral is (mostly) the same currency that is being borrowed'
string public constant AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = "38"; // 'The requested amount is greater than the max loan size in stable rate mode'
string public constant NO_DEBT_OF_SELECTED_TYPE = "39"; // 'For repayment of a specific type of debt, the user needs to have debt that type'
string public constant NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = "40"; // 'To repay on behalf of a user an explicit amount to repay is needed'
string public constant NO_OUTSTANDING_STABLE_DEBT = "41"; // 'User does not have outstanding stable rate debt on this reserve'
string public constant NO_OUTSTANDING_VARIABLE_DEBT = "42"; // 'User does not have outstanding variable rate debt on this reserve'
string public constant UNDERLYING_BALANCE_ZERO = "43"; // 'The underlying balance needs to be greater than 0'
string public constant INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = "44"; // 'Interest rate rebalance conditions were not met'
string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = "45"; // 'Health factor is not below the threshold'
string public constant COLLATERAL_CANNOT_BE_AUCTIONED_OR_LIQUIDATED = "46"; // 'The collateral chosen cannot be auctioned OR liquidated'
string public constant SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = "47"; // 'User did not borrow the specified currency'
string public constant SAME_BLOCK_BORROW_REPAY = "48"; // 'Borrow and repay in same block is not allowed'
string public constant BORROW_CAP_EXCEEDED = "50"; // 'Borrow cap is exceeded'
string public constant SUPPLY_CAP_EXCEEDED = "51"; // 'Supply cap is exceeded'
string public constant XTOKEN_SUPPLY_NOT_ZERO = "54"; // 'PToken supply is not zero'
string public constant STABLE_DEBT_NOT_ZERO = "55"; // 'Stable debt supply is not zero'
string public constant VARIABLE_DEBT_SUPPLY_NOT_ZERO = "56"; // 'Variable debt supply is not zero'
string public constant LTV_VALIDATION_FAILED = "57"; // 'Ltv validation failed'
string public constant PRICE_ORACLE_SENTINEL_CHECK_FAILED = "59"; // 'Price oracle sentinel validation failed'
string public constant RESERVE_ALREADY_INITIALIZED = "61"; // 'Reserve has already been initialized'
string public constant INVALID_LTV = "63"; // 'Invalid ltv parameter for the reserve'
string public constant INVALID_LIQ_THRESHOLD = "64"; // 'Invalid liquidity threshold parameter for the reserve'
string public constant INVALID_LIQ_BONUS = "65"; // 'Invalid liquidity bonus parameter for the reserve'
string public constant INVALID_DECIMALS = "66"; // 'Invalid decimals parameter of the underlying asset of the reserve'
string public constant INVALID_RESERVE_FACTOR = "67"; // 'Invalid reserve factor parameter for the reserve'
string public constant INVALID_BORROW_CAP = "68"; // 'Invalid borrow cap for the reserve'
string public constant INVALID_SUPPLY_CAP = "69"; // 'Invalid supply cap for the reserve'
string public constant INVALID_LIQUIDATION_PROTOCOL_FEE = "70"; // 'Invalid liquidation protocol fee for the reserve'
string public constant INVALID_DEBT_CEILING = "73"; // 'Invalid debt ceiling for the reserve
string public constant INVALID_RESERVE_INDEX = "74"; // 'Invalid reserve index'
string public constant ACL_ADMIN_CANNOT_BE_ZERO = "75"; // 'ACL admin cannot be set to the zero address'
string public constant INCONSISTENT_PARAMS_LENGTH = "76"; // 'Array parameters that should be equal length are not'
string public constant ZERO_ADDRESS_NOT_VALID = "77"; // 'Zero address not valid'
string public constant INVALID_EXPIRATION = "78"; // 'Invalid expiration'
string public constant INVALID_SIGNATURE = "79"; // 'Invalid signature'
string public constant OPERATION_NOT_SUPPORTED = "80"; // 'Operation not supported'
string public constant ASSET_NOT_LISTED = "82"; // 'Asset is not listed'
string public constant INVALID_OPTIMAL_USAGE_RATIO = "83"; // 'Invalid optimal usage ratio'
string public constant INVALID_OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = "84"; // 'Invalid optimal stable to total debt ratio'
string public constant UNDERLYING_CANNOT_BE_RESCUED = "85"; // 'The underlying asset cannot be rescued'
string public constant ADDRESSES_PROVIDER_ALREADY_ADDED = "86"; // 'Reserve has already been added to reserve list'
string public constant POOL_ADDRESSES_DO_NOT_MATCH = "87"; // 'The token implementation pool address and the pool address provided by the initializing pool do not match'
string public constant STABLE_BORROWING_ENABLED = "88"; // 'Stable borrowing is enabled'
string public constant SILOED_BORROWING_VIOLATION = "89"; // 'User is trying to borrow multiple assets including a siloed one'
string public constant RESERVE_DEBT_NOT_ZERO = "90"; // the total debt of the reserve needs to be 0
string public constant NOT_THE_OWNER = "91"; // user is not the owner of a given asset
string public constant LIQUIDATION_AMOUNT_NOT_ENOUGH = "92";
string public constant INVALID_ASSET_TYPE = "93"; // invalid asset type for action.
string public constant INVALID_FLASH_CLAIM_RECEIVER = "94"; // invalid flash claim receiver.
string public constant ERC721_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = "95"; // ERC721 Health factor is not below the threshold. Can only liquidate ERC20.
string public constant UNDERLYING_ASSET_CAN_NOT_BE_TRANSFERRED = "96"; //underlying asset can not be transferred.
string public constant TOKEN_TRANSFERRED_CAN_NOT_BE_SELF_ADDRESS = "97"; //token transferred can not be self address.
string public constant INVALID_AIRDROP_CONTRACT_ADDRESS = "98"; //invalid airdrop contract address.
string public constant INVALID_AIRDROP_PARAMETERS = "99"; //invalid airdrop parameters.
string public constant CALL_AIRDROP_METHOD_FAILED = "100"; //call airdrop method failed.
string public constant SUPPLIER_NOT_NTOKEN = "101"; //supplier is not the NToken contract
string public constant CALL_MARKETPLACE_FAILED = "102"; //call marketplace failed.
string public constant INVALID_MARKETPLACE_ID = "103"; //invalid marketplace id.
string public constant INVALID_MARKETPLACE_ORDER = "104"; //invalid marketplace id.
string public constant CREDIT_DOES_NOT_MATCH_ORDER = "105"; //credit doesn't match order.
string public constant PAYNOW_NOT_ENOUGH = "106"; //paynow not enough.
string public constant INVALID_CREDIT_SIGNATURE = "107"; //invalid credit signature.
string public constant INVALID_ORDER_TAKER = "108"; //invalid order taker.
string public constant MARKETPLACE_PAUSED = "109"; //marketplace paused.
string public constant INVALID_AUCTION_RECOVERY_HEALTH_FACTOR = "110"; //invalid auction recovery health factor.
string public constant AUCTION_ALREADY_STARTED = "111"; //auction already started.
string public constant AUCTION_NOT_STARTED = "112"; //auction not started yet.
string public constant AUCTION_NOT_ENABLED = "113"; //auction not enabled on the reserve.
string public constant ERC721_HEALTH_FACTOR_NOT_ABOVE_THRESHOLD = "114"; //ERC721 Health factor is not above the threshold.
string public constant TOKEN_IN_AUCTION = "115"; //tokenId is in auction.
string public constant AUCTIONED_BALANCE_NOT_ZERO = "116"; //auctioned balance not zero.
string public constant LIQUIDATOR_CAN_NOT_BE_SELF = "117"; //user can not liquidate himself.
string public constant INVALID_RECIPIENT = "118"; //invalid recipient specified in order.
string public constant FLASHCLAIM_NOT_ALLOWED = "119"; //flash claim is not allowed for UniswapV3 & Stakefish
string public constant NTOKEN_BALANCE_EXCEEDED = "120"; //ntoken balance exceed limit.
string public constant ORACLE_PRICE_NOT_READY = "121"; //oracle price not ready.
string public constant SET_ORACLE_SOURCE_NOT_ALLOWED = "122"; //source of oracle not allowed to set.
string public constant INVALID_LIQUIDATION_ASSET = "123"; //invalid liquidation asset.
string public constant XTOKEN_TYPE_NOT_ALLOWED = "124"; //the corresponding xTokenType not allowed in this action
string public constant GLOBAL_DEBT_IS_ZERO = "125"; //liquidation is not allowed when global debt is zero.
string public constant ORACLE_PRICE_EXPIRED = "126"; //oracle price expired.
string public constant APE_STAKING_POSITION_EXISTED = "127"; //ape staking position is existed.
string public constant SAPE_NOT_ALLOWED = "128"; //operation is not allow for sApe.
string public constant TOTAL_STAKING_AMOUNT_WRONG = "129"; //cash plus borrow amount not equal to total staking amount.
string public constant NOT_THE_BAKC_OWNER = "130"; //user is not the bakc owner.
string public constant CALLER_NOT_EOA = "131"; //The caller of the function is not an EOA account
string public constant MAKER_SAME_AS_TAKER = "132"; //maker and taker shouldn't be the same address
string public constant TOKEN_ALREADY_DELEGATED = "133"; //token is already delegted
string public constant INVALID_STATE = "134"; //invalid token status
string public constant INVALID_TOKEN_ID = "135"; //invalid token id
string public constant SENDER_SAME_AS_RECEIVER = "136"; //sender and receiver shouldn't be the same address
string public constant INVALID_YIELD_UNDERLYING_TOKEN = "137"; //invalid yield underlying token
string public constant CALLER_NOT_OPERATOR = "138"; // The caller of the function is not operator
string public constant INVALID_FEE_VALUE = "139"; // invalid fee rate value
string public constant TOKEN_NOT_ALLOW_RESCUE = "140"; // token is not allow rescue
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(
bytes32 indexed role,
address indexed account,
address indexed sender
);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(
bytes32 indexed role,
address indexed account,
address indexed sender
);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account)
external
view
returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN 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 payable) {
return payable(msg.sender);
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length)
internal
pure
returns (string memory)
{
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;
import {OfferItem, ConsiderationItem} from "../../../dependencies/seaport/contracts/lib/ConsiderationStructs.sol";
import {IStakefishValidator} from "../../../interfaces/IStakefishValidator.sol";
library DataTypes {
enum AssetType {
ERC20,
ERC721
}
address public constant SApeAddress = address(0x1);
uint256 public constant HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1e18;
struct ReserveData {
//stores the reserve configuration
ReserveConfigurationMap configuration;
//the liquidity index. Expressed in ray
uint128 liquidityIndex;
//the current supply rate. Expressed in ray
uint128 currentLiquidityRate;
//variable borrow index. Expressed in ray
uint128 variableBorrowIndex;
//the current variable borrow rate. Expressed in ray
uint128 currentVariableBorrowRate;
//timestamp of last update
uint40 lastUpdateTimestamp;
//the id of the reserve. Represents the position in the list of the active reserves
uint16 id;
//xToken address
address xTokenAddress;
//variableDebtToken address
address variableDebtTokenAddress;
//address of the interest rate strategy
address interestRateStrategyAddress;
//address of the auction strategy
address auctionStrategyAddress;
//the current treasury balance, scaled
uint128 accruedToTreasury;
// timelock strategy
address timeLockStrategyAddress;
}
struct ReserveConfigurationMap {
//bit 0-15: LTV
//bit 16-31: Liq. threshold
//bit 32-47: Liq. bonus
//bit 48-55: Decimals
//bit 56: reserve is active
//bit 57: reserve is frozen
//bit 58: borrowing is enabled
//bit 59: stable rate borrowing enabled
//bit 60: asset is paused
//bit 61: borrowing in isolation mode is enabled
//bit 62-63: reserved
//bit 64-79: reserve factor
//bit 80-115 borrow cap in whole tokens, borrowCap == 0 => no cap
//bit 116-151 supply cap in whole tokens, supplyCap == 0 => no cap
//bit 152-167 liquidation protocol fee
//bit 168-175 eMode category
//bit 176-211 unbacked mint cap in whole tokens, unbackedMintCap == 0 => minting disabled
//bit 212-251 debt ceiling for isolation mode with (ReserveConfiguration::DEBT_CEILING_DECIMALS) decimals
//bit 252-255 unused
uint256 data;
}
struct UserConfigurationMap {
/**
* @dev Bitmap of the users collaterals and borrows. It is divided in pairs of bits, one pair per asset.
* The first bit indicates if an asset is used as collateral by the user, the second whether an
* asset is borrowed by the user.
*/
uint256 data;
// auction validity time for closing invalid auctions in one tx.
uint256 auctionValidityTime;
}
struct ERC721SupplyParams {
uint256 tokenId;
bool useAsCollateral;
}
struct StakefishNTokenData {
uint256 validatorIndex;
bytes pubkey;
uint256 withdrawnBalance;
address feePoolAddress;
string nftArtUrl;
uint256 protocolFee;
IStakefishValidator.StateChange[] stateHistory;
uint256[2] pendingFeePoolReward;
}
struct NTokenData {
uint256 tokenId;
uint256 multiplier;
bool useAsCollateral;
bool isAuctioned;
StakefishNTokenData stakefishNTokenData;
}
struct ReserveCache {
uint256 currScaledVariableDebt;
uint256 nextScaledVariableDebt;
uint256 currLiquidityIndex;
uint256 nextLiquidityIndex;
uint256 currVariableBorrowIndex;
uint256 nextVariableBorrowIndex;
uint256 currLiquidityRate;
uint256 currVariableBorrowRate;
uint256 reserveFactor;
ReserveConfigurationMap reserveConfiguration;
address xTokenAddress;
address variableDebtTokenAddress;
uint40 reserveLastUpdateTimestamp;
}
struct ExecuteLiquidateParams {
uint256 reservesCount;
uint256 liquidationAmount;
uint256 collateralTokenId;
uint256 auctionRecoveryHealthFactor;
address weth;
address collateralAsset;
address liquidationAsset;
address borrower;
address liquidator;
bool receiveXToken;
address priceOracle;
address priceOracleSentinel;
}
struct ExecuteAuctionParams {
uint256 reservesCount;
uint256 auctionRecoveryHealthFactor;
uint256 collateralTokenId;
address collateralAsset;
address user;
address priceOracle;
}
struct ExecuteSupplyParams {
address asset;
uint256 amount;
address onBehalfOf;
address payer;
uint16 referralCode;
}
struct ExecuteSupplyERC721Params {
address asset;
DataTypes.ERC721SupplyParams[] tokenData;
address onBehalfOf;
address payer;
uint16 referralCode;
}
struct ExecuteBorrowParams {
address asset;
address user;
address onBehalfOf;
uint256 amount;
uint16 referralCode;
bool releaseUnderlying;
uint256 reservesCount;
address oracle;
address priceOracleSentinel;
}
struct ExecuteRepayParams {
address asset;
uint256 amount;
address onBehalfOf;
address payer;
bool usePTokens;
}
struct ExecuteWithdrawParams {
address asset;
uint256 amount;
address to;
uint256 reservesCount;
address oracle;
}
struct ExecuteWithdrawERC721Params {
address asset;
uint256[] tokenIds;
address to;
uint256 reservesCount;
address oracle;
}
struct ExecuteDecreaseUniswapV3LiquidityParams {
address user;
address asset;
uint256 tokenId;
uint256 reservesCount;
uint128 liquidityDecrease;
uint256 amount0Min;
uint256 amount1Min;
bool receiveEthAsWeth;
address oracle;
}
struct FinalizeTransferParams {
address asset;
address from;
address to;
bool usedAsCollateral;
uint256 amount;
uint256 balanceFromBefore;
uint256 balanceToBefore;
uint256 reservesCount;
address oracle;
}
struct FinalizeTransferERC721Params {
address asset;
address from;
address to;
bool usedAsCollateral;
uint256 tokenId;
uint256 balanceFromBefore;
uint256 reservesCount;
address oracle;
}
struct CalculateUserAccountDataParams {
UserConfigurationMap userConfig;
uint256 reservesCount;
address user;
address oracle;
}
struct ValidateBorrowParams {
ReserveCache reserveCache;
UserConfigurationMap userConfig;
address asset;
address userAddress;
uint256 amount;
uint256 reservesCount;
address oracle;
address priceOracleSentinel;
}
struct ValidateLiquidateERC20Params {
ReserveCache liquidationAssetReserveCache;
address liquidationAsset;
address weth;
uint256 totalDebt;
uint256 healthFactor;
uint256 liquidationAmount;
uint256 actualLiquidationAmount;
address priceOracleSentinel;
}
struct ValidateLiquidateERC721Params {
ReserveCache liquidationAssetReserveCache;
address liquidationAsset;
address liquidator;
address borrower;
uint256 globalDebt;
uint256 healthFactor;
address collateralAsset;
uint256 tokenId;
address weth;
uint256 actualLiquidationAmount;
uint256 maxLiquidationAmount;
uint256 auctionRecoveryHealthFactor;
address priceOracleSentinel;
address xTokenAddress;
bool auctionEnabled;
}
struct ValidateAuctionParams {
address user;
uint256 auctionRecoveryHealthFactor;
uint256 erc721HealthFactor;
address collateralAsset;
uint256 tokenId;
address xTokenAddress;
}
struct CalculateInterestRatesParams {
uint256 liquidityAdded;
uint256 liquidityTaken;
uint256 totalVariableDebt;
uint256 reserveFactor;
address reserve;
address xToken;
}
struct InitReserveParams {
address asset;
address xTokenAddress;
address variableDebtAddress;
address interestRateStrategyAddress;
address auctionStrategyAddress;
address timeLockStrategyAddress;
uint16 reservesCount;
uint16 maxNumberReserves;
}
struct ExecuteFlashClaimParams {
address receiverAddress;
address[] nftAssets;
uint256[][] nftTokenIds;
bytes params;
address oracle;
}
struct Credit {
address token;
uint256 amount;
bytes orderId;
uint8 v;
bytes32 r;
bytes32 s;
}
struct ExecuteMarketplaceParams {
bytes32 marketplaceId;
bytes payload;
Credit credit;
uint256 ethLeft;
DataTypes.Marketplace marketplace;
OrderInfo orderInfo;
address weth;
uint16 referralCode;
uint256 reservesCount;
address oracle;
address priceOracleSentinel;
}
struct OrderInfo {
address maker;
address taker;
bytes id;
OfferItem[] offer;
ConsiderationItem[] consideration;
}
struct Marketplace {
address marketplace;
address adapter;
address operator;
bool paused;
}
struct Auction {
uint256 startTime;
}
struct AuctionData {
address asset;
uint256 tokenId;
uint256 startTime;
uint256 currentPriceMultiplier;
uint256 maxPriceMultiplier;
uint256 minExpPriceMultiplier;
uint256 minPriceMultiplier;
uint256 stepLinear;
uint256 stepExp;
uint256 tickLength;
}
struct TokenData {
string symbol;
address tokenAddress;
}
enum ApeCompoundType {
SwapAndSupply
}
enum ApeCompoundTokenOut {
USDC,
WETH
}
struct ApeCompoundStrategy {
ApeCompoundType ty;
ApeCompoundTokenOut swapTokenOut;
uint256 swapPercent;
}
struct PoolStorage {
// Map of reserves and their data (underlyingAssetOfReserve => reserveData)
mapping(address => ReserveData) _reserves;
// Map of users address and their configuration data (userAddress => userConfiguration)
mapping(address => UserConfigurationMap) _usersConfig;
// List of reserves as a map (reserveId => reserve).
// It is structured as a mapping for gas savings reasons, using the reserve id as index
mapping(uint256 => address) _reservesList;
// Maximum number of active reserves there have been in the protocol. It is the upper bound of the reserves list
uint16 _reservesCount;
// Auction recovery health factor
uint64 _auctionRecoveryHealthFactor;
// Incentive fee for claim ape reward to compound
uint16 _apeCompoundFee;
// Map of user's ape compound strategies
mapping(address => ApeCompoundStrategy) _apeCompoundStrategies;
}
struct ReserveConfigData {
uint256 decimals;
uint256 ltv;
uint256 liquidationThreshold;
uint256 liquidationBonus;
uint256 reserveFactor;
bool usageAsCollateralEnabled;
bool borrowingEnabled;
bool isActive;
bool isFrozen;
bool isPaused;
}
struct TimeLockParams {
uint48 releaseTime;
TimeLockActionType actionType;
}
struct TimeLockFactorParams {
AssetType assetType;
address asset;
uint256 amount;
}
enum TimeLockActionType {
BORROW,
WITHDRAW
}
}// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
/******************************************************************************\
* EIP-2535: https://eips.ethereum.org/EIPS/eip-2535
/******************************************************************************/
interface IParaProxy {
enum ProxyImplementationAction {
Add,
Replace,
Remove
}
// Add=0, Replace=1, Remove=2
struct ProxyImplementation {
address implAddress;
ProxyImplementationAction action;
bytes4[] functionSelectors;
}
/// @notice Add/replace/remove any number of functions and optionally execute
/// a function with delegatecall
/// @param _implementationParams Contains the implementation addresses and function selectors
/// @param _init The address of the contract or implementation to execute _calldata
/// @param _calldata A function call, including function selector and arguments
/// _calldata is executed with delegatecall on _init
function updateImplementation(
ProxyImplementation[] calldata _implementationParams,
address _init,
bytes calldata _calldata
) external;
event ImplementationUpdated(
ProxyImplementation[] _implementationParams,
address _init,
bytes _calldata
);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {
OrderType,
BasicOrderType,
ItemType,
Side
} from "./ConsiderationEnums.sol";
/**
* @dev An order contains eleven components: an offerer, a zone (or account that
* can cancel the order or restrict who can fulfill the order depending on
* the type), the order type (specifying partial fill support as well as
* restricted order status), the start and end time, a hash that will be
* provided to the zone when validating restricted orders, a salt, a key
* corresponding to a given conduit, a counter, and an arbitrary number of
* offer items that can be spent along with consideration items that must
* be received by their respective recipient.
*/
struct OrderComponents {
address offerer;
address zone;
OfferItem[] offer;
ConsiderationItem[] consideration;
OrderType orderType;
uint256 startTime;
uint256 endTime;
bytes32 zoneHash;
uint256 salt;
bytes32 conduitKey;
uint256 counter;
}
/**
* @dev An offer item has five components: an item type (ETH or other native
* tokens, ERC20, ERC721, and ERC1155, as well as criteria-based ERC721 and
* ERC1155), a token address, a dual-purpose "identifierOrCriteria"
* component that will either represent a tokenId or a merkle root
* depending on the item type, and a start and end amount that support
* increasing or decreasing amounts over the duration of the respective
* order.
*/
struct OfferItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
}
/**
* @dev A consideration item has the same five components as an offer item and
* an additional sixth component designating the required recipient of the
* item.
*/
struct ConsiderationItem {
ItemType itemType;
address token;
uint256 identifierOrCriteria;
uint256 startAmount;
uint256 endAmount;
address payable recipient;
}
/**
* @dev A spent item is translated from a utilized offer item and has four
* components: an item type (ETH or other native tokens, ERC20, ERC721, and
* ERC1155), a token address, a tokenId, and an amount.
*/
struct SpentItem {
ItemType itemType;
address token;
uint256 identifier;
uint256 amount;
}
/**
* @dev A received item is translated from a utilized consideration item and has
* the same four components as a spent item, as well as an additional fifth
* component designating the required recipient of the item.
*/
struct ReceivedItem {
ItemType itemType;
address token;
uint256 identifier;
uint256 amount;
address payable recipient;
}
/**
* @dev For basic orders involving ETH / native / ERC20 <=> ERC721 / ERC1155
* matching, a group of six functions may be called that only requires a
* subset of the usual order arguments. Note the use of a "basicOrderType"
* enum; this represents both the usual order type as well as the "route"
* of the basic order (a simple derivation function for the basic order
* type is `basicOrderType = orderType + (4 * basicOrderRoute)`.)
*/
struct BasicOrderParameters {
// calldata offset
address considerationToken; // 0x24
uint256 considerationIdentifier; // 0x44
uint256 considerationAmount; // 0x64
address payable offerer; // 0x84
address zone; // 0xa4
address offerToken; // 0xc4
uint256 offerIdentifier; // 0xe4
uint256 offerAmount; // 0x104
BasicOrderType basicOrderType; // 0x124
uint256 startTime; // 0x144
uint256 endTime; // 0x164
bytes32 zoneHash; // 0x184
uint256 salt; // 0x1a4
bytes32 offererConduitKey; // 0x1c4
bytes32 fulfillerConduitKey; // 0x1e4
uint256 totalOriginalAdditionalRecipients; // 0x204
AdditionalRecipient[] additionalRecipients; // 0x224
bytes signature; // 0x244
// Total length, excluding dynamic array data: 0x264 (580)
}
/**
* @dev Basic orders can supply any number of additional recipients, with the
* implied assumption that they are supplied from the offered ETH (or other
* native token) or ERC20 token for the order.
*/
struct AdditionalRecipient {
uint256 amount;
address payable recipient;
}
/**
* @dev The full set of order components, with the exception of the counter,
* must be supplied when fulfilling more sophisticated orders or groups of
* orders. The total number of original consideration items must also be
* supplied, as the caller may specify additional consideration items.
*/
struct OrderParameters {
address offerer; // 0x00
address zone; // 0x20
OfferItem[] offer; // 0x40
ConsiderationItem[] consideration; // 0x60
OrderType orderType; // 0x80
uint256 startTime; // 0xa0
uint256 endTime; // 0xc0
bytes32 zoneHash; // 0xe0
uint256 salt; // 0x100
bytes32 conduitKey; // 0x120
uint256 totalOriginalConsiderationItems; // 0x140
// offer.length // 0x160
}
/**
* @dev Orders require a signature in addition to the other order parameters.
*/
struct Order {
OrderParameters parameters;
bytes signature;
}
/**
* @dev Advanced orders include a numerator (i.e. a fraction to attempt to fill)
* and a denominator (the total size of the order) in addition to the
* signature and other order parameters. It also supports an optional field
* for supplying extra data; this data will be included in a staticcall to
* `isValidOrderIncludingExtraData` on the zone for the order if the order
* type is restricted and the offerer or zone are not the caller.
*/
struct AdvancedOrder {
OrderParameters parameters;
uint120 numerator;
uint120 denominator;
bytes signature;
bytes extraData;
}
/**
* @dev Orders can be validated (either explicitly via `validate`, or as a
* consequence of a full or partial fill), specifically cancelled (they can
* also be cancelled in bulk via incrementing a per-zone counter), and
* partially or fully filled (with the fraction filled represented by a
* numerator and denominator).
*/
struct OrderStatus {
bool isValidated;
bool isCancelled;
uint120 numerator;
uint120 denominator;
}
/**
* @dev A criteria resolver specifies an order, side (offer vs. consideration),
* and item index. It then provides a chosen identifier (i.e. tokenId)
* alongside a merkle proof demonstrating the identifier meets the required
* criteria.
*/
struct CriteriaResolver {
uint256 orderIndex;
Side side;
uint256 index;
uint256 identifier;
bytes32[] criteriaProof;
}
/**
* @dev A fulfillment is applied to a group of orders. It decrements a series of
* offer and consideration items, then generates a single execution
* element. A given fulfillment can be applied to as many offer and
* consideration items as desired, but must contain at least one offer and
* at least one consideration that match. The fulfillment must also remain
* consistent on all key parameters across all offer items (same offerer,
* token, type, tokenId, and conduit preference) as well as across all
* consideration items (token, type, tokenId, and recipient).
*/
struct Fulfillment {
FulfillmentComponent[] offerComponents;
FulfillmentComponent[] considerationComponents;
}
/**
* @dev Each fulfillment component contains one index referencing a specific
* order and another referencing a specific offer or consideration item.
*/
struct FulfillmentComponent {
uint256 orderIndex;
uint256 itemIndex;
}
/**
* @dev An execution is triggered once all consideration items have been zeroed
* out. It sends the item in question from the offerer to the item's
* recipient, optionally sourcing approvals from either this contract
* directly or from the offerer's chosen conduit if one is specified. An
* execution is not provided as an argument, but rather is derived via
* orders, criteria resolvers, and fulfillments (where the total number of
* executions will be less than or equal to the total number of indicated
* fulfillments) and returned as part of `matchOrders`.
*/
struct Execution {
ReceivedItem item;
address offerer;
bytes32 conduitKey;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title The interface for StakefishValidator
/// @notice Defines implementation of the wallet (deposit, withdraw, collect fees)
interface IStakefishValidator {
enum State {
PreDeposit,
PostDeposit,
Active,
ExitRequested,
Exited,
Withdrawn,
Burnable
}
/// @dev aligns into 32 byte
struct StateChange {
State state; // 1 byte
bytes15 userData; // 15 byte (future use)
uint128 changedAt; // 16 byte
}
function validatorIndex() external view returns (uint256);
function pubkey() external view returns (bytes memory);
function withdrawnBalance() external view returns (uint256);
function feePoolAddress() external view returns (address);
function stateHistory(uint256 index)
external
view
returns (StateChange memory);
/// @notice Inspect state of the change
function lastStateChange() external view returns (StateChange memory);
/// @notice NFT Owner requests a validator exit
/// State.Running -> State.ExitRequested
/// emit ValidatorExitRequest(pubkey)
function requestExit() external;
/// @notice user withdraw balance and charge a fee
function withdraw() external;
/// @notice get pending fee pool rewards
function pendingFeePoolReward() external view returns (uint256, uint256);
/// @notice claim fee pool and forward to nft owner
function claimFeePool(uint256 amountRequested) external;
function getProtocolFee() external view returns (uint256);
function getNFTArtUrl() external view returns (string memory);
/// @notice computes commission, useful for showing on UI
function computeCommission(uint256 amount) external view returns (uint256);
function render() external view returns (string memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// prettier-ignore
enum OrderType {
// 0: no partial fills, anyone can execute
FULL_OPEN,
// 1: partial fills supported, anyone can execute
PARTIAL_OPEN,
// 2: no partial fills, only offerer or zone can execute
FULL_RESTRICTED,
// 3: partial fills supported, only offerer or zone can execute
PARTIAL_RESTRICTED
}
// prettier-ignore
enum BasicOrderType {
// 0: no partial fills, anyone can execute
ETH_TO_ERC721_FULL_OPEN,
// 1: partial fills supported, anyone can execute
ETH_TO_ERC721_PARTIAL_OPEN,
// 2: no partial fills, only offerer or zone can execute
ETH_TO_ERC721_FULL_RESTRICTED,
// 3: partial fills supported, only offerer or zone can execute
ETH_TO_ERC721_PARTIAL_RESTRICTED,
// 4: no partial fills, anyone can execute
ETH_TO_ERC1155_FULL_OPEN,
// 5: partial fills supported, anyone can execute
ETH_TO_ERC1155_PARTIAL_OPEN,
// 6: no partial fills, only offerer or zone can execute
ETH_TO_ERC1155_FULL_RESTRICTED,
// 7: partial fills supported, only offerer or zone can execute
ETH_TO_ERC1155_PARTIAL_RESTRICTED,
// 8: no partial fills, anyone can execute
ERC20_TO_ERC721_FULL_OPEN,
// 9: partial fills supported, anyone can execute
ERC20_TO_ERC721_PARTIAL_OPEN,
// 10: no partial fills, only offerer or zone can execute
ERC20_TO_ERC721_FULL_RESTRICTED,
// 11: partial fills supported, only offerer or zone can execute
ERC20_TO_ERC721_PARTIAL_RESTRICTED,
// 12: no partial fills, anyone can execute
ERC20_TO_ERC1155_FULL_OPEN,
// 13: partial fills supported, anyone can execute
ERC20_TO_ERC1155_PARTIAL_OPEN,
// 14: no partial fills, only offerer or zone can execute
ERC20_TO_ERC1155_FULL_RESTRICTED,
// 15: partial fills supported, only offerer or zone can execute
ERC20_TO_ERC1155_PARTIAL_RESTRICTED,
// 16: no partial fills, anyone can execute
ERC721_TO_ERC20_FULL_OPEN,
// 17: partial fills supported, anyone can execute
ERC721_TO_ERC20_PARTIAL_OPEN,
// 18: no partial fills, only offerer or zone can execute
ERC721_TO_ERC20_FULL_RESTRICTED,
// 19: partial fills supported, only offerer or zone can execute
ERC721_TO_ERC20_PARTIAL_RESTRICTED,
// 20: no partial fills, anyone can execute
ERC1155_TO_ERC20_FULL_OPEN,
// 21: partial fills supported, anyone can execute
ERC1155_TO_ERC20_PARTIAL_OPEN,
// 22: no partial fills, only offerer or zone can execute
ERC1155_TO_ERC20_FULL_RESTRICTED,
// 23: partial fills supported, only offerer or zone can execute
ERC1155_TO_ERC20_PARTIAL_RESTRICTED
}
// prettier-ignore
enum BasicOrderRouteType {
// 0: provide Ether (or other native token) to receive offered ERC721 item.
ETH_TO_ERC721,
// 1: provide Ether (or other native token) to receive offered ERC1155 item.
ETH_TO_ERC1155,
// 2: provide ERC20 item to receive offered ERC721 item.
ERC20_TO_ERC721,
// 3: provide ERC20 item to receive offered ERC1155 item.
ERC20_TO_ERC1155,
// 4: provide ERC721 item to receive offered ERC20 item.
ERC721_TO_ERC20,
// 5: provide ERC1155 item to receive offered ERC20 item.
ERC1155_TO_ERC20
}
// prettier-ignore
enum ItemType {
// 0: ETH on mainnet, MATIC on polygon, etc.
NATIVE,
// 1: ERC20 items (ERC777 and ERC20 analogues could also technically work)
ERC20,
// 2: ERC721 items
ERC721,
// 3: ERC1155 items
ERC1155,
// 4: ERC721 items where a number of tokenIds are supported
ERC721_WITH_CRITERIA,
// 5: ERC1155 items where a number of ids are supported
ERC1155_WITH_CRITERIA
}
// prettier-ignore
enum Side {
// 0: Items that can be spent
OFFER,
// 1: Items that must be received
CONSIDERATION
}{
"remappings": [
"contracts/=contracts/",
"ds-test/=lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"pnm-contracts/=lib/pnm-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"bytecodeHash": "ipfs"
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "london",
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IPoolAddressesProvider","name":"provider","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"ADDRESSES_PROVIDER","outputs":[{"internalType":"contract IPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ASSET_LISTING_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BRIDGE_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EMERGENCY_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FLASH_BORROWER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RISK_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"addAssetListingAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridge","type":"address"}],"name":"addBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"addEmergencyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"addFlashBorrower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"addPoolAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"addRiskAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAssetListingAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bridge","type":"address"}],"name":"isBridge","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isEmergencyAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"isFlashBorrower","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isPoolAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isRiskAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"removeAssetListingAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridge","type":"address"}],"name":"removeBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"removeEmergencyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"removeFlashBorrower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"removePoolAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"removeRiskAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"bytes32","name":"adminRole","type":"bytes32"}],"name":"setRoleAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
0x60a06040523480156200001157600080fd5b5060405162001094380380620010948339810160408190526200003491620001e3565b806001600160a01b03166080816001600160a01b0316815250506000816001600160a01b0316630e67178c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200008f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b59190620001e3565b604080518082019091526002815261373560f01b60208201529091506001600160a01b038216620001045760405162461bcd60e51b8152600401620000fb91906200020a565b60405180910390fd5b50620001126000826200011a565b50506200025a565b6200012682826200012a565b5050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000126576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001863390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6001600160a01b0381168114620001e057600080fd5b50565b600060208284031215620001f657600080fd5b81516200020381620001ca565b9392505050565b600060208083528351808285015260005b8181101562000239578581018301518582016040015282016200021b565b506000604082860101526040601f19601f8301168501019250505092915050565b608051610e1e6200027660003960006102420152610e1e6000f3fe608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063674b5e4d1161011a5780639a2b96f7116100ad578063b5bfddea1161007c578063b5bfddea14610472578063b8f6dba714610487578063d547741f1461049c578063f83695cb146104af578063fa50f297146104c257600080fd5b80639a2b96f7146104315780639ac9d80b14610444578063a217fddf14610457578063a21bce151461045f57600080fd5b80637a9a93f4116100e95780637a9a93f4146103e55780637be53ca1146103f857806391d148541461040b5780639712fdf81461041e57600080fd5b8063674b5e4d146103955780636e76fc8f146103a8578063726600ce146103bd57806378bb0a43146103d057600080fd5b80632500f2b6116101925780633c5a08e5116101615780633c5a08e5146103455780634f16b425146103585780635577b7a91461036d5780635b9a94e41461038257600080fd5b80632500f2b6146102f9578063253cf9801461030c5780632f2ff15d1461031f57806336568abe1461033257600080fd5b8063179efb09116101ce578063179efb091461028f5780631e4e0091146102a257806322650caf146102b5578063248a9ca3146102c857600080fd5b806301ffc9a71461020057806304df017d146102285780630542975c1461023d57806313ee32e01461027c575b600080fd5b61021361020e366004610b11565b6104d5565b60405190151581526020015b60405180910390f35b61023b610236366004610b57565b61050c565b005b6102647f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161021f565b61021361028a366004610b57565b610527565b61023b61029d366004610b57565b610541565b61023b6102b0366004610b72565b610559565b61023b6102c3366004610b57565b610574565b6102eb6102d6366004610b94565b60009081526020819052604090206001015490565b60405190815260200161021f565b610213610307366004610b57565b61058c565b61023b61031a366004610b57565b6105a6565b61023b61032d366004610bad565b6105be565b61023b610340366004610bad565b6105e4565b61023b610353366004610b57565b610667565b6102eb600080516020610d4983398151915281565b6102eb600080516020610dc983398151915281565b61023b610390366004610b57565b61067f565b6102136103a3366004610b57565b610697565b6102eb600080516020610da983398151915281565b6102136103cb366004610b57565b6106b1565b6102eb600080516020610d6983398151915281565b61023b6103f3366004610b57565b6106cb565b610213610406366004610b57565b6106e3565b610213610419366004610bad565b6106f9565b61023b61042c366004610b57565b610722565b61023b61043f366004610b57565b61073a565b61023b610452366004610b57565b610752565b6102eb600081565b61023b61046d366004610b57565b61076a565b6102eb600080516020610d8983398151915281565b6102eb600080516020610d2983398151915281565b61023b6104aa366004610bad565b61077e565b61023b6104bd366004610b57565b6107a4565b6102136104d0366004610b57565b6107bc565b60006001600160e01b03198216637965db0b60e01b148061050657506301ffc9a760e01b6001600160e01b03198316145b92915050565b610524600080516020610d898339815191528261077e565b50565b6000610506600080516020610d69833981519152836106f9565b610524600080516020610da9833981519152826105be565b600061056581336107d6565b61056f838361083a565b505050565b610524600080516020610d29833981519152826105be565b6000610506600080516020610da9833981519152836106f9565b610524600080516020610dc98339815191528261077e565b6000828152602081905260409020600101546105da81336107d6565b61056f8383610885565b6001600160a01b03811633146106595760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106638282610909565b5050565b610524600080516020610d498339815191528261077e565b610524600080516020610d49833981519152826105be565b6000610506600080516020610d49833981519152836106f9565b6000610506600080516020610d89833981519152836106f9565b610524600080516020610da98339815191528261077e565b6000610506600080516020610d29833981519152835b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610524600080516020610d89833981519152826105be565b610524600080516020610d69833981519152826105be565b610524600080516020610dc9833981519152826105be565b610524600080516020610d69833981519152825b60008281526020819052604090206001015461079a81336107d6565b61056f8383610909565b610524600080516020610d298339815191528261077e565b6000610506600080516020610dc9833981519152836106f9565b6107e082826106f9565b610663576107f8816001600160a01b0316601461096e565b61080383602061096e565b604051602001610814929190610bfd565b60408051601f198184030181529082905262461bcd60e51b825261065091600401610c72565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b61088f82826106f9565b610663576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556108c53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61091382826106f9565b15610663576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600061097d836002610cbb565b610988906002610cd2565b67ffffffffffffffff8111156109a0576109a0610ce5565b6040519080825280601f01601f1916602001820160405280156109ca576020820181803683370190505b509050600360fc1b816000815181106109e5576109e5610cfb565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610a1457610a14610cfb565b60200101906001600160f81b031916908160001a9053506000610a38846002610cbb565b610a43906001610cd2565b90505b6001811115610abb576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610a7757610a77610cfb565b1a60f81b828281518110610a8d57610a8d610cfb565b60200101906001600160f81b031916908160001a90535060049490941c93610ab481610d11565b9050610a46565b508315610b0a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610650565b9392505050565b600060208284031215610b2357600080fd5b81356001600160e01b031981168114610b0a57600080fd5b80356001600160a01b0381168114610b5257600080fd5b919050565b600060208284031215610b6957600080fd5b610b0a82610b3b565b60008060408385031215610b8557600080fd5b50508035926020909101359150565b600060208284031215610ba657600080fd5b5035919050565b60008060408385031215610bc057600080fd5b82359150610bd060208401610b3b565b90509250929050565b60005b83811015610bf4578181015183820152602001610bdc565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610c35816017850160208801610bd9565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610c66816028840160208801610bd9565b01602801949350505050565b6020815260008251806020840152610c91816040850160208701610bd9565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761050657610506610ca5565b8082018082111561050657610506610ca5565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610d2057610d20610ca5565b50600019019056fe12ad05bde78c5ab75238ce885307f96ecd482bb402ef831f99e7018a0f169b7b8aa855a911518ecfbe5bc3088c8f3dda7badf130faaf8ace33fdc33828e1816719c860a63258efbd0ecb7d55c626237bf5c2044c26c073390b74f0c13c85743308fb31c3e81624356c3314088aa971b73bcc82d22bc3e3b184b4593077ae32785c91514091af31f62f596a314af7d5be40146b2f2355969392f055e12e0982fb939b8dfb57ecef2aea54a93a15e86768b9d4089f1ba61c245e6ec980695f4ca4a2646970667358221220e02ec6b69d916867339b3b9e77785ba9956f74807e8ab35b705e2e48ada207a964736f6c63430008110033000000000000000000000000c75dcf8855de359f1fa8c2c92ca001cfee952101
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063674b5e4d1161011a5780639a2b96f7116100ad578063b5bfddea1161007c578063b5bfddea14610472578063b8f6dba714610487578063d547741f1461049c578063f83695cb146104af578063fa50f297146104c257600080fd5b80639a2b96f7146104315780639ac9d80b14610444578063a217fddf14610457578063a21bce151461045f57600080fd5b80637a9a93f4116100e95780637a9a93f4146103e55780637be53ca1146103f857806391d148541461040b5780639712fdf81461041e57600080fd5b8063674b5e4d146103955780636e76fc8f146103a8578063726600ce146103bd57806378bb0a43146103d057600080fd5b80632500f2b6116101925780633c5a08e5116101615780633c5a08e5146103455780634f16b425146103585780635577b7a91461036d5780635b9a94e41461038257600080fd5b80632500f2b6146102f9578063253cf9801461030c5780632f2ff15d1461031f57806336568abe1461033257600080fd5b8063179efb09116101ce578063179efb091461028f5780631e4e0091146102a257806322650caf146102b5578063248a9ca3146102c857600080fd5b806301ffc9a71461020057806304df017d146102285780630542975c1461023d57806313ee32e01461027c575b600080fd5b61021361020e366004610b11565b6104d5565b60405190151581526020015b60405180910390f35b61023b610236366004610b57565b61050c565b005b6102647f000000000000000000000000c75dcf8855de359f1fa8c2c92ca001cfee95210181565b6040516001600160a01b03909116815260200161021f565b61021361028a366004610b57565b610527565b61023b61029d366004610b57565b610541565b61023b6102b0366004610b72565b610559565b61023b6102c3366004610b57565b610574565b6102eb6102d6366004610b94565b60009081526020819052604090206001015490565b60405190815260200161021f565b610213610307366004610b57565b61058c565b61023b61031a366004610b57565b6105a6565b61023b61032d366004610bad565b6105be565b61023b610340366004610bad565b6105e4565b61023b610353366004610b57565b610667565b6102eb600080516020610d4983398151915281565b6102eb600080516020610dc983398151915281565b61023b610390366004610b57565b61067f565b6102136103a3366004610b57565b610697565b6102eb600080516020610da983398151915281565b6102136103cb366004610b57565b6106b1565b6102eb600080516020610d6983398151915281565b61023b6103f3366004610b57565b6106cb565b610213610406366004610b57565b6106e3565b610213610419366004610bad565b6106f9565b61023b61042c366004610b57565b610722565b61023b61043f366004610b57565b61073a565b61023b610452366004610b57565b610752565b6102eb600081565b61023b61046d366004610b57565b61076a565b6102eb600080516020610d8983398151915281565b6102eb600080516020610d2983398151915281565b61023b6104aa366004610bad565b61077e565b61023b6104bd366004610b57565b6107a4565b6102136104d0366004610b57565b6107bc565b60006001600160e01b03198216637965db0b60e01b148061050657506301ffc9a760e01b6001600160e01b03198316145b92915050565b610524600080516020610d898339815191528261077e565b50565b6000610506600080516020610d69833981519152836106f9565b610524600080516020610da9833981519152826105be565b600061056581336107d6565b61056f838361083a565b505050565b610524600080516020610d29833981519152826105be565b6000610506600080516020610da9833981519152836106f9565b610524600080516020610dc98339815191528261077e565b6000828152602081905260409020600101546105da81336107d6565b61056f8383610885565b6001600160a01b03811633146106595760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106638282610909565b5050565b610524600080516020610d498339815191528261077e565b610524600080516020610d49833981519152826105be565b6000610506600080516020610d49833981519152836106f9565b6000610506600080516020610d89833981519152836106f9565b610524600080516020610da98339815191528261077e565b6000610506600080516020610d29833981519152835b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b610524600080516020610d89833981519152826105be565b610524600080516020610d69833981519152826105be565b610524600080516020610dc9833981519152826105be565b610524600080516020610d69833981519152825b60008281526020819052604090206001015461079a81336107d6565b61056f8383610909565b610524600080516020610d298339815191528261077e565b6000610506600080516020610dc9833981519152836106f9565b6107e082826106f9565b610663576107f8816001600160a01b0316601461096e565b61080383602061096e565b604051602001610814929190610bfd565b60408051601f198184030181529082905262461bcd60e51b825261065091600401610c72565b600082815260208190526040808220600101805490849055905190918391839186917fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff9190a4505050565b61088f82826106f9565b610663576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556108c53390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61091382826106f9565b15610663576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6060600061097d836002610cbb565b610988906002610cd2565b67ffffffffffffffff8111156109a0576109a0610ce5565b6040519080825280601f01601f1916602001820160405280156109ca576020820181803683370190505b509050600360fc1b816000815181106109e5576109e5610cfb565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110610a1457610a14610cfb565b60200101906001600160f81b031916908160001a9053506000610a38846002610cbb565b610a43906001610cd2565b90505b6001811115610abb576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110610a7757610a77610cfb565b1a60f81b828281518110610a8d57610a8d610cfb565b60200101906001600160f81b031916908160001a90535060049490941c93610ab481610d11565b9050610a46565b508315610b0a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610650565b9392505050565b600060208284031215610b2357600080fd5b81356001600160e01b031981168114610b0a57600080fd5b80356001600160a01b0381168114610b5257600080fd5b919050565b600060208284031215610b6957600080fd5b610b0a82610b3b565b60008060408385031215610b8557600080fd5b50508035926020909101359150565b600060208284031215610ba657600080fd5b5035919050565b60008060408385031215610bc057600080fd5b82359150610bd060208401610b3b565b90509250929050565b60005b83811015610bf4578181015183820152602001610bdc565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610c35816017850160208801610bd9565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610c66816028840160208801610bd9565b01602801949350505050565b6020815260008251806020840152610c91816040850160208701610bd9565b601f01601f19169190910160400192915050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761050657610506610ca5565b8082018082111561050657610506610ca5565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610d2057610d20610ca5565b50600019019056fe12ad05bde78c5ab75238ce885307f96ecd482bb402ef831f99e7018a0f169b7b8aa855a911518ecfbe5bc3088c8f3dda7badf130faaf8ace33fdc33828e1816719c860a63258efbd0ecb7d55c626237bf5c2044c26c073390b74f0c13c85743308fb31c3e81624356c3314088aa971b73bcc82d22bc3e3b184b4593077ae32785c91514091af31f62f596a314af7d5be40146b2f2355969392f055e12e0982fb939b8dfb57ecef2aea54a93a15e86768b9d4089f1ba61c245e6ec980695f4ca4a2646970667358221220e02ec6b69d916867339b3b9e77785ba9956f74807e8ab35b705e2e48ada207a964736f6c63430008110033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.