A bridge interface for MVM Mainnet powered by MVG.
- from Mixin Mainnet
Transfer to proxy mainnet user.
- from Other Network
Deposit to proxy mainnet user.
- to Mixin Mainnet
For assets other than ETH, Call the asset contract's transferWithExtra method with extra constructed by getExtra in ~/helpers/registry.js .
For ETH, Call the bridge contract's release method also with extra constructed by getExtra in ~/helpers/registry.js.
- to Other Network
Used a proxy service that automatically swaps the user's withdrawal asset to the fee asset. And do the withdrawal process when the swap is completed. The code is also open source.
- from Mixin Mainnet
OAuth user first, filter UTXO through Mixin API with user's token, get each token information by API.
When depositing, selected token is an object contains token and output, these two will be used for creating a collectible request. After calling the createCollectibleRequest function, a code_id would be generated for user to pay. Then loop output with parameter state=signed, when output_id found, send raw tx to mainnet. The deposit is complete.
- to Mixin Mainnet
Get user tokens from https://scan.mvm.dev API, filter ERC721 tokens, get tokenURI from contract, display token image.
When withdrawing, selected token is an object contains tokenId, contractAddress and token info fetched from tokenURI. contractAddress will be used to initialize contract instance. call safeTransferFrom(address,address,uint256,bytes) to withdraw NFT. Those arguments are (from:User Metamask Address,to:Mirror Contract Address,tokenId:Fetched from tokenOfOwnerByIndex of collectible contract,data: Metamask proxy user address + extra generated from /extra API).
File: /pages/index.vue
Route: /
Main page of the asset bridge.
File: /pages/nft.vue
Route: /nft
NFT bridge.
Append your app in the following format to assets/applications.json, and create a pull request.
{
"name": "", // Name of your app
"icon": "", // Icon link of your app
"link": "", // Link to your app
"description": "" // One line description of your app
},