Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clear-signing): Add Merchant Moe DEX Support for Mantle Network #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions developer-preview/src/app/DevicesDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const DevicesDemo = ({
chainId={chainId}
contractAddress={contractAddress}
chosenOperation={chosenOperation}
info={metadata.info}
owner={metadata.owner}
info={metadata?.info ?? {}}
owner={metadata?.owner ?? ""}
operationType={type}
/>
</div>
Expand Down
119 changes: 119 additions & 0 deletions registry/merchantmoe/calldata-MoeRouter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"context": {
"$id": "Merchant Moe Router",
"contract": {
"deployments": [
{
"chainId": 5000,
"address": "0x1e2098BaD83241A1327Ff205c5521C39Ca9A754c"
}
],
"abi": "https://raw.githubusercontent.com/kamalbuilds/ledger-asset-dapps/refs/heads/main/mantle/merchant-moe/merchantmoerouter.json"
}
},
"metadata": {
"owner": "Merchant Moe",
"info": {
"legalName": "Merchant Moe DEX",
"lastUpdate": "2024-11-16",
"url": "https://merchantmoe.com"
}
},
"display": {
"formats": {
"swapExactTokensForTokens": {
"intent": "Swap Tokens",
"fields": [
{
"path": "amountIn",
"label": "Amount to Send",
"format": "tokenAmount",
"params": {
"tokenPath": "path.[0]"
}
},
{
"path": "amountOutMin",
"label": "Minimum to Receive",
"format": "tokenAmount",
"params": {
"tokenPath": "path.[-1]"
}
},
{
"path": "to",
"label": "Recipient",
"format": "addressName",
"params": {
"types": ["eoa"],
"sources": ["local", "ens"]
}
},
{
"path": "deadline",
"label": "Valid Until",
"format": "date",
"params": {
"encoding": "timestamp"
}
}
],
"required": ["amountIn", "amountOutMin", "to", "deadline"]
},
"addLiquidity": {
"intent": "Add Liquidity",
"fields": [
{
"path": "tokenA",
"label": "First Token",
"format": "addressName"
},
{
"path": "tokenB",
"label": "Second Token",
"format": "addressName"
},
{
"path": "amountADesired",
"label": "Desired Amount A",
"format": "tokenAmount",
"params": {
"tokenPath": "tokenA"
}
},
{
"path": "amountBDesired",
"label": "Desired Amount B",
"format": "tokenAmount",
"params": {
"tokenPath": "tokenB"
}
},
{
"path": "amountAMin",
"label": "Minimum Amount A",
"format": "tokenAmount",
"params": {
"tokenPath": "tokenA"
}
},
{
"path": "amountBMin",
"label": "Minimum Amount B",
"format": "tokenAmount",
"params": {
"tokenPath": "tokenB"
}
}
],
"required": [
"amountADesired",
"amountBDesired",
"amountAMin",
"amountBMin"
]
}
}
}
}
97 changes: 97 additions & 0 deletions registry/merchantmoe/eip712-moe-permit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"$schema": "../../specs/erc7730-v1.schema.json",
"context": {
"eip712": {
"deployments": [
{
"chainId": 5000,
"address": "0x1e2098BaD83241A1327Ff205c5521C39Ca9A754c"
}
],
"domain": {
"name": "Merchant Moe",
"version": "1"
},
"schemas": [
{
"types": {
"EIP712Domain": [
{
"name": "name",
"type": "string"
},
{
"name": "version",
"type": "string"
},
{
"name": "chainId",
"type": "uint256"
},
{
"name": "verifyingContract",
"type": "address"
}
],
"Permit": [
{
"name": "owner",
"type": "address"
},
{
"name": "spender",
"type": "address"
},
{
"name": "value",
"type": "uint256"
},
{
"name": "nonce",
"type": "uint256"
},
{
"name": "deadline",
"type": "uint256"
}
]
},
"primaryType": "Permit"
}
]
}
},
"display": {
"formats": {
"Permit": {
"intent": "Approve Token Spending",
"fields": [
{
"path": "spender",
"label": "Spender",
"format": "addressName",
"params": {
"types": ["contract"],
"sources": ["local", "ens"]
}
},
{
"path": "value",
"label": "Amount",
"format": "tokenAmount"
},
{
"path": "deadline",
"label": "Valid Until",
"format": "date",
"params": {
"encoding": "timestamp"
}
}
],
"required": ["spender", "value", "deadline"],
"excluded": ["nonce"]
}
}
}
}