TokenManager
Base contract for all token managers.
Runs on SKALE Chains, accepts messages from mainnet, creates clones of tokens. TokenManager mints tokens when user locks tokens on mainnet and burn them when user exits.
onlyAutomaticDeploy onlyAutomaticDeploy()
modifier
Modifier to make a function callable only if caller is granted with AUTOMATIC_DEPLOY_ROLE
.
onlyTokenRegistrar onlyTokenRegistrar()
modifier
Modifier to make a function callable only if caller is granted with TOKEN_REGISTRAR_ROLE
.
onlyMessageProxy onlyMessageProxy()
modifier
Modifier to make a function callable only if caller is messageProxy
.
rightTransaction rightTransaction(string targetSchainName, address to)
modifier
Modifier to make a function callable only if a message does not aim mainnet, target SKALE chain has token manager and receiver is set.
checkReceiverChain checkReceiverChain(bytes32 fromChainHash, address sender)
modifier
Modifier to make a function callable only if sender is deposit box on mainnet or token manager on other SKALE chain.
enableAutomaticDeploy enableAutomaticDeploy()
external
Turn on automatic deploy on schain.
Requirements:
-
Function caller has to be granted with
AUTOMATIC_DEPLOY_ROLE
.
disableAutomaticDeploy disableAutomaticDeploy()
external
Turn off automatic deploy on schain.
Requirements:
-
Function caller has to be granted with
AUTOMATIC_DEPLOY_ROLE
.
addTokenManager addTokenManager(string schainName, address newTokenManager)
external
Adds a TokenManager on SKALE chain to this TokenManager.
Requirements:
-
msg.sender
must be contract owner ortokenManagerLinker
contract. -
SKALE chain must not already be added.
-
TokenManager address must be non-zero.
removeTokenManager removeTokenManager(string schainName)
external
Remove a TokenManager on SKALE chain from TokenManager.
Requirements:
-
msg.sender
must be contract owner ortokenManagerLinker
contract. -
SKALE chain must already be set.
changeDepositBoxAddress changeDepositBoxAddress(address newDepositBox)
external
Change Deposit Box address This function should be executed only in emergency.
Requirements:
-
msg.sender
must be contract owner. -
{newDepositBox} must be set.
hasTokenManager hasTokenManager(string schainName) → bool
external
Checks whether TokenManager is connected to a {schainName} SKALE chain TokenManager.
initializeTokenManager initializeTokenManager(string newSchainName, contract IMessageProxyForSchain newMessageProxy, contract ITokenManagerLinker newIMALinker, contract ICommunityLocker newCommunityLocker, address newDepositBox)
public
Is called once during contract deployment.
_checkSender _checkSender(bytes32 fromChainHash, address sender) → bool
internal
DepositBoxWasChanged DepositBoxWasChanged(address oldValue, address newValue)
event
Emitted when deposit box address was changed.