Git Source

Inherits: IAppManagerErrors, IPermissionModifierErrors, IInputErrors, IZeroAddressError, IOwnershipErrors

Author: @ShaneDuncan602, @oscarsernarosero, @TJ-Everett

Interface for app manager server functions.

This interface is a lightweight counterpart to AppManager. It should be used by calling contracts that only need inquiry actions

Functions

isSuperAdmin

This function is where the super admin role is actually checked

function isSuperAdmin(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if admin, false if not

isAppAdministrator

This function is where the app administrator role is actually checked

function isAppAdministrator(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if app administrator, false if not

isRuleAdministrator

This function is where the rule administrator role is actually checked

function isRuleAdministrator(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if rule administrator, false if not

isTreasuryAccount

This function is where the rTreasury account role is actually checked

function isTreasuryAccount(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if TREASURY_ACCOUNT, false if not

isAccessLevelAdmin

This function is where the access level admin role is actually checked

function isAccessLevelAdmin(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if ACCESS_LEVEL_ADMIN_ROLE, false if not

isRiskAdmin

This function is where the risk admin role is actually checked

function isRiskAdmin(address account) external view returns (bool);

Parameters

NameTypeDescription
accountaddressaddress to be checked

Returns

NameTypeDescription
<none>boolsuccess true if RISK_ADMIN_ROLE, false if not

getAllTags

Get all the tags for the address

function getAllTags(address _address) external view returns (bytes32[] memory);

Parameters

NameTypeDescription
_addressaddressAddress to retrieve the tags

Returns

NameTypeDescription
<none>bytes32[]tags Array of all tags for the account

getAccessLevel

Get the AccessLevel Score for the specified account

function getAccessLevel(address _account) external view returns (uint8);

Parameters

NameTypeDescription
_accountaddressaddress of the user

Returns

NameTypeDescription
<none>uint8

getRiskScore

Get the Risk Score for an account.

function getRiskScore(address _account) external view returns (uint8);

Parameters

NameTypeDescription
_accountaddressaddress upon which the risk score was set

Returns

NameTypeDescription
<none>uint8score risk score(0-100)

getPauseRules

Get all pause rules for the token

function getPauseRules() external view returns (PauseRule[] memory);

Returns

NameTypeDescription
<none>PauseRule[]PauseRule An array of all the pause rules

hasTag

Check to see if an account has a specific general tag

function hasTag(address _account, bytes32 _tag) external view returns (bool);

Parameters

NameTypeDescription
_accountaddressAddress to check
_tagbytes32Tag to be checked for

Returns

NameTypeDescription
<none>boolsuccess true if account has the tag, false if it does not

getAccessLevelProvider

Get the address of the access level provider

function getAccessLevelProvider() external view returns (address);

Returns

NameTypeDescription
<none>addressaccessLevelProvider Address of the access level provider

registerToken

This function allows the devs to register their token contract addresses. This keeps everything in sync and will aid with the token factory

function registerToken(string calldata _tokenId, address _tokenAddress) external;

Parameters

NameTypeDescription
_tokenIdstringThe token id(may be NFT or ERC20)
_tokenAddressaddressAddress corresponding to the tokenId

deregisterToken

This function allows the devs to deregister a token contract address. This keeps everything in sync and will aid with the token factory

function deregisterToken(string calldata _tokenId) external;

Parameters

NameTypeDescription
_tokenIdstringThe token id(may be NFT or ERC20)

getTokenList

Return a the token list for calculation purposes

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

Returns

NameTypeDescription
<none>address[]tokenList list of all tokens registered

getTokenID

This function gets token identification string.

function getTokenID(address _tokenAddress) external view returns (string memory);

Parameters

NameTypeDescription
_tokenAddressaddressthe address of the contract of the token to query

Returns

NameTypeDescription
<none>stringthe identification string.

approveAddressToTradingRuleAllowlist

manage the allowlist for trading-rule bypasser accounts

function approveAddressToTradingRuleAllowlist(address _address, bool isApproved) external;

Parameters

NameTypeDescription
_addressaddressaccount in the list to manage
isApprovedboolset to true to indicate that _address can bypass trading rules.

isTradingRuleBypasser

tells if an address can bypass trading rules

function isTradingRuleBypasser(address _address) external view returns (bool);

Parameters

NameTypeDescription
_addressaddressthe address to check for

Returns

NameTypeDescription
<none>booltrue if the address can bypass trading rules, or false otherwise.

checkApplicationRules

Jump through to the gobal rules to see if the requested action is valid.

function checkApplicationRules(
    address _tokenAddress,
    address _sender,
    address _from,
    address _to,
    uint256 _amount,
    uint16 _nftValuationLimit,
    uint256 _tokenId,
    ActionTypes _action,
    HandlerTypes _handlerType
) external;

Parameters

NameTypeDescription
_tokenAddressaddressaddress of the token calling the rule check
_senderaddressaddress of the calling account passed through from the token
_fromaddressaddress of the from account
_toaddressaddress of the to account
_amountuint256amount of tokens to be transferred
_nftValuationLimituint16number of tokenID’s per collection before checking collection price vs individual token price
_tokenIduint256tokenId of the NFT token
_actionActionTypesAction to be checked
_handlerTypeHandlerTypestype of handler calling checkApplicationRules function

confirmNewDataProvider

Part of the two step process to set a new Data Provider within a Protocol AppManager. Final confirmation called by new provider

function confirmNewDataProvider(IDataEnum.ProviderType _providerType) external;

Parameters

NameTypeDescription
_providerTypeIDataEnum.ProviderTypethe type of data provider