NAV
Im token logo imToken API Documentation DApp-SDK Tokenlon-Onboarding Tokenlon-MMSK Tokenlon-MMProxy
  • Introduction
  • API
  • dapp
  • Security
  • English

    Introduction

    Market Maker Proxy is a market-based token repositories library, an Ethereum Smart Contract (MMProxy) written using Solidity. After joining the Tokenlon Ecology, the market maker should deposit the tokens for market making into the MMProxy contract. The market maker has the full ownership of the MMP contract as well as the token recharge, withdrawal and authorization processes.

    API

    Permissions

    There are two permissions in the contract, owner and operator.

    Owner has the operation permission of the contract authority interface, and the operator has the operation authority of the contract function interface.

    transferOwnership

    Transfer owner permissions.

    Owner is the highest authority of the contract and has full management of the contract.

    API

    transferOwnership(address newOwner)
    

    Parameters

    Note

    -Only Owner has the interface operation permission -Use with caution, error in transferring the address may result in the contract asset not being able to withdraw!

    setOperator

    Sets the operator.

    The operator has the operational rights of the contract function. Only the owner can specify the operator, and the operator can withdraw and authorize the contract.

    API

    setOperator(address newOperator)
    

    Parameters

    Note

    -Only Owner has the interface operation permission

    Function

    setSigner

    Settings for Signer.

    The signer is the order signature wallet address in MMSK. When the market maker accesses Tokenlon, the MMSK wallet address needs to be set to the MMProxy contract.

    API

    setSigner(address signer)
    

    Parameters

    Note

    -Only Operator has the interface operation permission -signer Wallet has MMProxy contract ability to transfer Tokens

    setAllowance Grants

    The contract's specified token transfer rights to the sender.

    Market makers need to license the supported tokens to the 0x ERC20Proxy contract (0x deployment address).

    0x ERC20Proxy(mainnet): 0x95e6f48254609a6ee006f7d493c8e5fb97094cef

    API

    setAllowance(address[] memory token_addrs, address spender)
    

    Parameters

    Note

    -Only Operator has the interface operation permission

    closeAllowanceCloses

    the specified token transfer permission of the contract.

    Tokens that are no longer supported by market makers can be turned off by themselves.

    API

    closeAllowance(address[] memory token_addrs, address spender)
    

    Parameters

    Note

    -Only Operator has the interface operation permission

    withdraw

    Token specified in the withdrawal contract.

    API

    withdraw(address token, address to, uint256 amount)WithdrawWithdrawal amount
    

    Parameters

    Note

    -Only Operator has the interface operation permission -The withdrawal amount is bigInt, does not contain decimals

    dapp

    Note: dapp is in Beta stage. Use is at your own risk.

    For the market maker to use the MMProxy contract, we provide the corresponding dapp tooling.

    Project link: github(NOT READY)

    dapp link: https://consenlabs.github.io/contract-admin/mmp.html?addr={mmProxyContractAddress}

    {mmProxyContractAddress} is your MMProxy contract address.

    cold (offline) wallet settings: imToken 2.0 - How do I use cold wallet?

    Security

    To ensure the contract operations, it is recommended to use 3 separate wallets:

    1. owner wallet: MMProxy permission owner, used to set the contract operator permissions
    2. operator wallet: For MMProxy function settings and withdrawal
    3. signer wallet: For signing orders in MMSK

    wallet requirements

    Operation flow

    1. Prepare a new operator wallet, store a certain amount of ETH for operating the contract
    2. Set the operator with the owner wallet
    3. Use the operator wallet configure or withdraw the contract.
    4. Set the operator to 0x0000.. (empty address) using the owner wallet.