MVN Token Contract
Empowering the Maven Ecosystem with MVN
The MVN Token Contract governs the operations of Maven Finance's native token, MVN.
As the fundamental currency within the Maven Finance ecosystem, the MVN Token Contract ensures the smooth functioning of token transactions, from transfers to staking and governance.
Within this contract, the mechanisms for the management of MVN tokens, as well as the rules governing the maximum total supply of the MVN token through its inflation rate, are laid out.
Whether you're earning MVN through yield farming, staking for governance power, or transacting within the Maven ecosystem, the MVN Token Contract plays a pivotal role in your interaction with the platform.
FA2 Token Contract Entrypoints
assertMetadata
function assertMetadata(string key, bytes hash)
Asserts whether the given metadata matches the one on the token contract
key
string
The key in the metadata bigmap on the token contract
hash
bytes
The metadata hash to be compared with the result from the key-value given
transfer
function transfer(fa2TransferType transferList)
Transfers tokens from one user to another
transferList
fa2TransferType: list(transferType transfer)
A list of transfers to be processed
transfer
transferType: address from_, list(transferDestinationType tx) txs
Specifies the sender from_ and a list of transfer destination transactions
from_
address
Sender of the token
txs
list(transferDestinationType tx)
List of transfer destination transactions
tx
transferDestinationType: address to_, nat tokenId, nat amount
Specifies the transfer destination of the transaction
to_
address
Recipient of the transfer operation
tokenId
nat
The id of the token to be transferred
amount
nat
The total amount of tokens to be transferred
balance_of
function balance_of(list(balanceOfRequestType balanceOfRequest) requests, contract(list(balanceOfResponseType balanceOfResponse) callback)
Facilitates inter-contract calls to retrieve the balance of a given user
requests
list(balanceOfRequestType balanceOfRequest)
A list of balance_of requests for the balance of given addresses
callback
contract(list(balanceOfResponseType balanceOfResponse))
A list of contracts to send the balanceOf requests to
balanceOfResponse
balanceOfResponseType: balanceOfRequestType balanceOfRequest, nat balance
A balanceOf response to be forwarded to the contract specified in the callback
balanceOfRequest
balanceOfRequestType: address owner, nat tokenId
Specifies the token id and balance of owner requested from
owner
address
The requested user address to find the balance of
tokenId
nat
The requested token id to find the balance of
balance
nat
The balance of the requested user address and token id
update_operators
function update_operators(list(updateOperatorVariantType updateOperatorVariant) updateOperatorsList)
Updates the operators for a given token id and owner
updateOperatorsList
list(updateOperatorVariantType updateOperatorVariant)
A list of updateOperators transactions to be processed
updateOperatorVariant
updateOperatorVariantType: | operatorParameterType Add_operator | operatorParameterType Remove_operator
Specify whether an operator should be added or removed
Add_operator
operatorParameterType: address owner, address operator, nat tokenId
Authorises an operator to act on behalf of the owner for the given token id
Remove_operator
operatorParameterType: address owner, address operator, nat tokenId
Removes the authority of an operator to act on behalf of the owner for the given token id
owner
address
Address of the user to set the operator on
operator
address
Address of the operator to be authorized
tokenId
nat
Id of the token where the operator will be set
mint
function mint(address userAddress, nat tokenAmount)
Mints a given token amount to the provided user address
userAddress
address
The user address to receive new minted tokens
tokenAmount
nat
The token amount to be minted
burn
function burn(nat tokenAmount)
Burns the provided token amount
tokenAmount
nat
The token amount to be burned
Housekeeping Entrypoints
setAdmin
function setAdmin(address newAdminAddress)
Sets a new admin address for the contract
newAdminAddress
address
The address of the new admin
setGovernance
function setGovernance(address newGovernanceAddress)
Sets a new governance contract address
newGovernanceAddress
address
The address of the new governance contract
updateWhitelistContracts
function updateWhitelistContracts(address whitelistContractAddress, updateType update)
Add, update or remove a whitelist contract in the whitelistContracts map in the storage
whitelistContractAddress
address
The contract address to be updated in the whitelist contracts bigmap
updateType
updateType: | unit Update | unit Remove
Specifies whether the whitelistContractAddress should be updated or removed from the whitelist contracts bigmap
updateGeneralContracts
function updateGeneralContracts(string generalContractName, address generalContractAddress, updateType update)
Add, update or remove a general contract in the generalContracts map in the storage
generalContractName
string
The identifier key to be set in the general contracts bigmap which will be the general contract name in camelcase
generalContractAddress
address
The contract address to be updated in the general contracts bigmap
updateType
updateType: | unit Update | unit Remove
Specifies whether the generalContractAddress should be updated or removed from the general contracts bigmap
mistakenTransfer
function mistakenTransfer(transferActionType transferList)
Transfers any mav or token that may have mistakenly been sent to this contract
transferList
transferActionType:
list(address to_, nat tokenAmount, token tokenType)
A list of transfers of tokens to recipients
to_
address
The recipient of the mistaken transfer
tokenAmount
nat
The amount of tokens to be transferred
token
tokenType: | unit Mav | (address tokenContractAddress) Fa12 | (address tokenContractAddress, nat tokenId) MRC-20
The token type of the token to be transferred, corresponding to either Mav, MRC-10 OR MRC-20
Protected Entrypoints
updateInflationRate
function updateInflationRate(nat newInflationRate)
Updates the inflation rate for the MVN Token, which is the rate of increase of the maximum total supply allowed
newInflationRate
nat
The new inflation rate for the MVN Token Contract
triggerInflation
function triggerInflation()
Triggers inflation for the MVN Token, where the maximum total supply limit is increased based on the inflation rate percentage of the current MVN total supply.
The inflation rate may be triggered only once every 360 days and only when at least 90% of the maximum supply has been minted.
View Methods
getAdmin
function getAdmin()
Returns the contract admin
getGovernanceAddress
function getGovernanceAddress()
Returns the contract governance address
getWhitelistContractOpt
function getWhitelistContractOpt(address contractAddress)
Returns unit if contract address is whitelisted, else returns none
getGeneralContractOpt
function getGeneralContractOpt(string contractName)
Returns the contract address if the contract name is found, else returns none
get_balance
function get_balance(address userAddress * nat tokenId)
Returns the balance for the given userAddress and tokenId, else returns 0
all_tokens
function all_tokens()
Returns a list of token ids used by the token contract (in this case, only the zero token id is used)
is_operator
function is_operator(address ownerAddress, address operatorAddress, nat tokenId)
Returns the operator record for the given ownerAddress and tokenId, else returns none
token_metadata
function token_metadata(nat tokenId)
Returns the token metadata for the given token id, else returns none
total_supply
function total_supply()
Returns the maximum supply of MVN Tokens
getMaximumSupply
function getMaximumSupply()
Returns the maximum supply of MVN Tokens
getInflationRate
function getInflationRate()
Returns the current inflation rate of the MVN Token Contract
getNextInflationRateTimestamp
function getNextInflationRateTimestamp()
Returns the timestamp of the next instance when the inflation rate can be triggered for the MVN Token Contract
Last updated