www.asagaia.com
  • Welcome to Asagaia documentation!
  • 1xMM Project
    • Introduction
    • Mini-game Manual
      • Position Management
        • Open a position
        • Reduce or Close a position
        • Position results
        • Profit and Loss computation
        • Penalty
      • Bonuses
        • !!Bonus limitations!!
      • Tapping
      • Position Details
      • User Profile
      • Levels and Benefits
    • Perpetual Constant Maturity Option
    • API
      • 1XMM Token
        • Public Methods
          • Read
          • Write
        • Events
        • Errors
      • 1xMM Pools
        • Public Methods
          • Read
          • Write
    • The 1xMM Pool for 1XMM tokens
Powered by GitBook
On this page
  1. 1xMM Project
  2. API
  3. 1XMM Token
  4. Public Methods

Write

approve
approve(address spender, uint256 value) returns(bool)

Provides an allowance to spender on the account of msg.sender .

emit Approval
burn
burn(uint256 amount)

Burns amount of 1XMM tokens for msg.sender .

burn(address account, uint256 amount)

Burn amount of 1XMM tokens for account. account must provide allowance to msg.sender for this transaction to be accepted. This function is similar to burnFrom.

emit Burnt

When tokens are burnt, the account of user impacted by the burn is reduced by amount value, as well as the cap and the totalSupply .

burnFrom
burnFrom(address account, uint256 amount)

Burn amount of 1XMM tokens for account. account must provide allowance to msg.sender for this transaction to be accepted.

emit Burnt
depositEther
depositEther() payable returns(uint256 amountToken)

Allow users to deposit native ETH on the 1XMM smart contract and receive in exchange the equivalent amount of 1XMM tokens. The amount of 1XMM tokens, amountToken, is computed such as:

amountToken = (msg.value * EthExchangeRate) / 10000

The amount of tokens is compared to availableTokens. If amountToken > availableTokens, the difference of ETH is given back to the user.

emit Deposited
emit Allocated

Notes:

  • this function is available only if ethDepositIsAllowed is set to true

  • for kyc purposes this function will not be available at project start

sellBack
sellBack(uint128 amountToken)

Allows users to sell back amountToken of 1XMM tokens against ETH. The sell back can occur only if ETHExchangeIsAllowed == true.

The exchange is performed at ETHExchangeRate such as:

ETHAmount = (amountToken * 10000) / ETHExchangeRate

If ETHAmount is bigger than the available amount of ETH stored on the 1XMM contract, the amount of 1XMM tokens is adjusted to match the available quantity of ETH. The quantity of 1XMM tokens which have been exchanged is burnt.

emit Burnt
emit ChangedBack
emit Withdrawn
sellBackAgainst
sellBackAgainst(uint128 amountToken, address tokenToBeReceived)

Allows users to sell back amountToken of 1XMM tokens against tokenToBeReceived. The sell back can occur only if exchange against tokenToBeReceived is allowed. The exchange is performed at rate such as:

amountTokenToBeReceived = (amountToken * 10000) / rate

If amountTokenToBeReceived is bigger than the available amount of expected tokens stored on the 1XMM contract, the amount of 1XMM tokens is adjusted. The quantity of 1XMM tokens which have been exchanged is burnt.

emit Burnt
emit ChangedBackFor
emit Withdrawn
transfer
transfer(address to, uint256 value) returns(bool)

Allows msg.sender to transfer 1XMM tokens to to account.

emit Transfer
transferFrom
transferFrom(address from, address to, uint256 value) returns(bool)

Allows a user to transfer 1XMM tokens from from account, to to account.

The transfer can only occur if msg.sender has received allowance from from.

emit Transfer
PreviousReadNextEvents

Last updated 2 months ago