AssetsManager is a helper contract which allows centralized access to tokens' management on top of chronobank platforms. It is used in pair with PlatformsManager and provides a creation of token extensions for platforms. Contract also has methods for quick access to token info such as: - token address by symbol, - if token exists in a system, - if a user is a owner of a token.
/contracts/assets/AssetsManager.sol

constructor

AssetsManager

inputs0address_store
inputs1bytes32_crate
event

Error 9cf38cf2

inputs0addressself
inputs1uint256errorCode
event

TokenExtensionRegistered adaec20b

inputs0addressself
inputs1addressplatform
inputs2addresstokenExtension
event

TokenExtensionRequested f149a753

inputs0addressself
inputs1addressplatform
inputs2addresstokenExtension
event

TokenExtensionUnregistered 3f50f7da

inputs0addressself
inputs1addresstokenExtension
function, constant

_getOwnedAssetsFromPlatforms 72c35564

inputs0address[]_platforms
inputs1address_user
function

assetOwnerAdded 660a333e

This method is deprecated and used only for backward compatibility with platforms

inputs0bytes32
inputs1address
inputs2address
function

assetOwnerRemoved 26046743

This method is deprecated and used only for backward compatibility with platforms

inputs0bytes32
inputs1address
inputs2address
function

changeContractOwnership 557f4bc9

Prepares ownership pass. * Can only be called by current owner.

inputs0address_to

address of the next owner. 0x0 is not allowed.

outputs0bool
function

claimContractOwnership 4592cd1d

Finalize ownership pass. * Can only be called by pending owner.

outputs0bool
function, constant

containsTokenExtension 6bc8acf5

Checks if a provided token extension address is a part of the system

inputs0address_tokenExtension

address of a token extension

outputs0bool
function, constant

contractOwner ce606ee0

function, constant

contractsManager 53253d31

function

destroy 83197ef0

function

emitError df26ca08

Emitting events

inputs0uint256errorCode
function

emitTokenExtensionRegistered 8f8068bb

inputs0address_platform
inputs1address_tokenExtension
function

emitTokenExtensionRequested 9e6c2765

inputs0address_platform
inputs1address_tokenExtension
function

emitTokenExtensionUnregistered 2d305c82

inputs0address_tokenExtension
function, constant

getAssetBySymbol 28aea08b

Gets token's address which is associated with a symbol

inputs0bytes32_symbol

symbol associated with some token

outputs0address
function, constant

getAssetForOwnerAtIndex 2cd060ce

Returns the exact asset symbol hosted in a platform with passed user as an owner by accessing it by index.

inputs0address_platform

hosting platform

inputs1address_owner

user to be checked for ownership

inputs2uint256_idx

index of a symbol. Should no more than number of assets for this owner minus 1

outputs0bytes32
function, constant

getAssetsForOwnerCount 17db1071

Gets a number of assets in a platform where passed user is an owner.

inputs0address_platform

hosting platform

inputs1address_owner

user to be checked for ownership

outputs0uint256count
function, constant

getEventsHistory fff10aba

function, constant

getManagersForAsset 406aa8fc

inputs0address_asset
function, constant

getOwnedAssetsFromPlatforms f79d1877

inputs0address[]_platforms
function, constant

getTokenExtension e5ebb7a5

Gets an associated token extension address with provided platform. If no token extension was found then return 0x0.

inputs0address_platform

platform address for associated token extension

outputs0address
function, constant

getTokenExtensionFactory 44ef3ea5

Gets an address of currenty used token extension factory

outputs0address
function, constant

getTokenFactory 925d6ba2

Gets an address of currenty used token and proxy factory

outputs0address
function

init 184b9559

Initalizer. Used by contract owner to initialize and re-initialize contract after deploying new versions of related dependencies.

inputs0address_contractsManager

contracts manager

inputs1address_tokenExtensionFactory

token extension factory address

inputs2address_tokenFactory

token and proxy factory address

outputs0uint256
function, constant

isAssetOwner 25742b46

Checks if a user has access rights and an owner of a token with provided symbol

inputs0bytes32_symbol

symbol associated with some token

inputs1address_user

a user which should be tested for ownership

outputs0bool
function, constant

isAssetSymbolExists d5ed0d17

Checks if a token with such symbol is registered in the system

inputs0bytes32_symbol

symbol associated with some token

outputs0bool
function, constant

isAuthorized fe9fbb80

inputs0addresskey
function, constant

lookupManager 4fe59012

Will crash if no manager in the system with given identifier.

Returns manager's address by its identifier (type).

inputs0bytes32_identifier

is a manager's identifier. 0x0 is not allowed.

function, constant

pendingContractOwner 5aa77d3c

function

registerTokenExtension 89c165d0

Registers and stores token extension of a platform into the system. Mostly this method should be used when platform's token extention was removed manually from AssetsManager or there was no token extension at all. It is preferred to create token extension by calling requestTokenExtension: this will ensure that the latest version of token extension contract will be used. There might be ONLY ONE token extension at a time associated with a platform and be registered in the system. Can be used only by platform's owner associated with this token extension.

inputs0address_tokenExtension

address of token extension

outputs0uint256
function

requestTokenExtension c97f5787

Provides a way to "request" (meant check if a token extension exists for a passed platform and if it doesn't then create a new one).

inputs0address_platform

address of a platform for which token extension is requested

outputs0uint256
function

setContractsManager 71d3b573

Setter for ContractsManager. Force overrides currect manager.

inputs0address_contractsManager

contracts manager. 0x0 is not allowed.

function

setEventsHistory 6521afd7

inputs0address_eventsHistory
function

setTokenExtensionFactory b5fb8421

Sets a new address of token extension factory contract as currently used in AssetsManager

inputs0address_tokenExtensionFactory

address of an updated token extension factory contract

outputs0uint256
function

setTokenFactory 2f73a9f8

Sets a new address of token and proxy factory contract as currently used in AssetsManager

inputs0address_tokenFactory

address of an updated token and proxy factory contract

outputs0uint256
function

transferContractOwnership a843c51f

Direct ownership pass without change/claim pattern. Can be invoked only by current contract owner

inputs0address_to

the next contract owner

outputs0bool
function

unregisterTokenExtension db06471f

Unregisters and removes token extension from the system. It should be used when you know what are you doing, because it will remove record of token extension for a platform and to continue using an associated token extension with platform you should register a new token extension address or request a brand new one (see requestTokenExtension method). Can be used only by platform's owner associated with this token extension.

inputs0address_tokenExtension

address of a token extension

outputs0uint256
function

withdrawnTokens d8f9659b

inputs0address[]tokens
inputs1address_to