Skip to content

Feature/hysp clear signing#715

Open
Keyur279 wants to merge 3 commits intodevelopfrom
feature/hysp-clear-signing
Open

Feature/hysp clear signing#715
Keyur279 wants to merge 3 commits intodevelopfrom
feature/hysp-clear-signing

Conversation

@Keyur279
Copy link
Copy Markdown
Collaborator

Adding clear signing support for 4 HYSP vault functions on Ethereum mainnet. Each function has a unique 4-byte selector (calculated from keccak256(functionSignature)[0:4]). The firmware reads these selectors from the transaction's data field to identify which function is being called, then parses the arguments and displays human-readable information to the user.
The 4 functions:

  1. approve(address,uint256) - Selector: 0x095ea7b3
    • Standard ERC-20 function (not HYSP-specific)
    • Gives a vault permission to spend tokens from user's wallet
    • 2 args: spender address (who can spend), amount (how much they can spend)
    • Used twice: once for USDC→vault, once for mevUSD→vault
  2. depositInstant(address,uint256,uint256,bytes32) - Selector: 0xc02dd27a
    • Midas-specific function on Issuance Vault
    • Deposits tokens (USDC/USDT) and receives mevUSD
    • 4 args: tokenIn (which token depositing), amount, minReceive (slippage protection), referrerId (for tracking)
  3. redeemInstant(address,uint256,uint256) - Selector: 0x8b53f75e
    • Midas-specific function on Redemption Vault
    • Burns mevUSD and receives tokens back (USDC/USDT) with 0.5% fee
    • 3 args: tokenOut (which token to receive), amount (mevUSD burning), minReceive (slippage protection)
  4. redeemRequest(address,uint256) - Selector: 0xbfc2d46a
    • Midas-specific function on Redemption Vault
    • Queued redemption (no fee, ~24-48hr wait)
    • 2 args: tokenOut, amount
      Key contract addresses:
  • USDC: 0xa0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 (6 decimals)
  • USDT: 0xdAC17F958D2ee523a2206206994597C13D831ec7 (6 decimals)
  • mevUSD: 0x548857309BEfb6Fb6F20a9C5A56c9023D892785B (18 decimals)
  • Midas Issuance Vault: 0x5455222CCDd32F85C1998f57DC6CF613B4498C2a
  • Midas Redemption Vault: 0x9C3743582e8b2d7cCb5e08caF3c9C33780ac446f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant