How to interact with "MOMP" smart contract
Tags: momp, mompnetwork, cryptography, cryptocurrency
Published: 2021-09-29 15:35:25

---
title: How to interact with "MOMP" smart contract
published: true
description: 
tags: momp, mompnetwork, cryptography, cryptocurrency
cover_image: https://res.cloudinary.com/dpnrocxf9/image/upload/v1632282216/logo.png
---


Greetings everyone,

## Brief about "MOMP Network"
"MOMP" (Money Over Mail Protocol) provides a mechanism for sending money to email addresses on top of decentralized network. MOMP itself is a set of rules (Protocol) originally created by "[Jeevanjot Singh](https://www.linkedin.com/in/jeevanjot-singh/)" and currently implemented by [momp.network](https://momp.network). Learn more about "MOMP" from the [document](https://github.com/genievot/momp-network-document/blob/main/Momp%20protocol%20document%2024-SEP-2021.pdf)


## Process to interact with "MOMP" smart contract

> You need a supported web wallet to perform any operation for "MOMP", Currently supported wallet is **Superhero** and you can add it on your browser from extension marketplace, For e.g. [Chrome browser wallet extension](https://chrome.google.com/webstore/detail/superhero/mnhmmkepfddpifjkamaligfeemcbhdne)

There are some useful methods that might doesn't exist in a front-end currently. You can directly use the "MOMP" smart contract to interact with those methods.

### First Steps:
- For ease, Use an online editor to load the MOMP smart contract e.g. Ae studio. Visit [https://studio.aepps.com/](https://studio.aepps.com/) and change your settings from Testnet to `Mainnet`. Select option **Browser Wallet** and make sure that your wallet's network is `Mainnet`. Look for permissions and if agree then click accept.
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/1.png)

- Now, Copy the smart contract code of "MOMP" from [github link](https://github.com/genievot/momp-network-smart_contract/blob/main/merged_momp.aes) and add it in a new file inside the editor.
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/2.png)

- Now, You need to call the existing contract instead of deploying new one. The existing MOMP contract is deployed on mainnet address at `ct_2uJthb5s1D8c8F8ZYMAZ6LYGWno5ubFnrmkkHLE1FBzN3JruQw`. So fill this contract address the input field next to **use at address** and click that `use at address`
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/3.png)

- Now, You can see your contract under `Deployed Contract` section. Expand the contract to see its methods.
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/4.png)

### Calling methods
> There are numerous methods that are useful for an individual to learn more about MOMP. But lets focus on some that currently you can use easily. `Call Locally` methods are read only methods that won't require any transaction fee and can be called with appropriate parameters ([]) to get the status of a state variable or any other information returnable.

- `get_base_fee` (get base fee) :- It gets you the current base fee (Transaction fee - SMTP base fee) of MOMP smart contract.

- `get_registration_fee` (get registration fee) :- It gets you current registration fee that is required to register & verify your email on top of smart contract.

- `get_time_for_refund_in` (get time for refund in) :- It gets you current millisecond value that is being added to each payment to mark its expiry (transaction block time + returned value)

- `clients_balance` (clients balance) [Email {hashed using Sha256}] :- Using unregistered (unverified) email (hashed with sha256 in bytes32 format), you can fetch your current balance in the smart contract.

- `clients_pub_key` (clients pub key) [Email {hashed using Sha256}] :- Using the email (hashed with sha256 in bytes32 format), You can find public key of the email.

- `get_time_for_refund_in_for_payment_id` (get time for refund in for payment id) [Payment id, Address of sender] :- It gets you current millisecond value (UNIX Timestamp) that show when a payment will expire (Can be claimed from both side now [Sender & Receiver])
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/7.png)

- `claim refund` (claim refund) [Payment Id] :- Using payment ID, Sender can claim their amount back if it is expired.

- `getNextQueryID` :- It fetches the upcoming payment ID or query ID from Say Network's SMTP module for visual use.
![momp smart contract](https://res.cloudinary.com/dpnrocxf9/image/upload/v1632928969/momp%20network/Smart%20contract%20interaction/5.png)

**Note:** 
- In this process neither sender nor receiver will ever need to expose their email on the public blockchain network.

Learn more about this protocol from this [document (AKA white paper)](https://github.com/genievot/momp-network-document/blob/main/Momp%20protocol%20document%2024-SEP-2021.pdf)

### Links
- Visit [Website](https://momp.network)
- Join MOMP Network on [Discord](https://discord.gg/grsA7QUZhJ)
- Follow on [twitter](https://twitter.com/genievot)