Meter Docs
Search
K
Links

Introduction to Developer Documentation

Meter is a DeFi infrastructure with a built-in, crypto-native, metastable currency called MTR. You can use Meter as a Layer 1 blockchain to build DeFi apps on top of, or as a highly-decentralized, high-performance side chain for Ethereum and other public chains.
The current Ethereum version on Meter is 1.10.17
There are two primary methods of interacting with Meter: Ethereum compatible RPC or Meter Native Restful APIs. This section describes the Ethereum compatible RPC interface and native Restful APIs are detailed here.

1. Ethereum RPC

In order to better support existing Ethereum dApp developers, we developed an Ethereum emulation mode for Meter. Through an addon module called webgear Meter nodes are able to understand Ethereum transaction format and support the standard Ethereum RPC interface. It is like using the Apple M1 silicon to run x86 applications with a 100x performance improvement. Developers are even able to use their preferred Ethereum development tools like Remix, ethers.js and web3.js to interact with Meter. Due to the limitations of the Ethereum RPC, not all Meter functionality is available in Ethereum emulation mode. In this mode, MTRG must be treated as a special ERC20 token via a system contract.
The other difference between Meter and Ethereum is that Meter removed the sequential nonce concept in Ethereum and uses a random number as nonce instead. The Ethereum emulation layer will automatically generate the random nonce, you will not be able to replace a transaction with the same nonce.
When interacting with Meter you must use "Injected Web3" in Remix alongside Metamask.

Testnet:

Warringstakes Testnet Endpoints:
ChainID: 83
Currency Symbol: MTR
ERC20 System Interface:
MTRG: 0x8a419ef4941355476cf04933e90bf3bbf2f73814
MTR: 0x4cb6cef87d8cadf966b455e8bd58fff32aba49d1
Useful Contracts:
Multi-call3(Official Deployment): 0xcA11bde05977b3631167028862bE2a173976CA11
WMTR: 0xfAC315d105E5A7fe2174B3EB1f95C257A9A5e271
Faucet for Testnet:

Mainnet:

RPC Endpoint:
RPC:
BlockPi also provides API key based endpoints
https://rpc.meter.io (port 8545 on the mainnet docker)
https://rpc-meter.jellypool.xyz (community maintained)
Websocket:
wss://ws.meter.io (port 8546 on the mainnet docker)
https://blockpi.io/ provides wss access through API keys
ChainID: 82
Currency Symbol: MTR
ERC20 System Interface:
-MTRG: 0x228ebBeE999c6a7ad74A6130E81b12f9Fe237Ba3
-MTR (Optional): 0x687A6294D0D6d63e751A059bf1ca68E4AE7B13E2
Useful Contracts:
Multi-call3 (Official Deployment): 0xcA11bde05977b3631167028862bE2a173976CA11
WMTR: 0x160361ce13ec33C993b5cCA8f62B6864943eb083
List of Common ERC20 Tokens on Meter mainnet:

2. Source Code Verification

Meter explorer uses Sourcify to verify the onchain contracts' byte code is exactly the same as the source code. Verifying contracts also allows the explorer to properly decode smart contract transactions. There are various tools (for example Remix plugins) that help developers to verify on Sourcify.
The submission for source code can be either done through Meter Explorer or Sourcify Portal. If a contract is verified through the Sourcify Portal, it may take a few hours for the Meter Explorer to pick up the information.
There are two levels of verification: 1. source code match and 2. both source code, metadata match. Source code match is considered the minimum for contract verification purposes.
The main difference between Sourcify and Etherscan verification is that Sourcify requires metadata to be uploaded for verification in addition to source code and byte code. Information on finding the metadata file is available in Sourcify Documents. Both the Meter Explorer and Sourcify website allow uploading zip file. If your file is too large, we recommend directly using the Sourcify website to upload multiple files. If you are using Truffle, sometimes after you upload the json file, Sourcify complains not able to find the corresponding find .sol files in your local file path. You could try zip all the contract source code in a file and upload to Sourcify website. It will typically resolve the issue. From time to time, Sourcify may have problem recognizing files uploaded from Windows computers. You could try using a Mac to upload the files.

3. Multisig Wallet

Meter team has deployed a forked UI of Gnosis Safe multsig wallet on the Meter mainnet. The smart contracts for the multsig were officially deployed by the Gnosis team. It can be found at:
Meter Multisig Wallet
Meter Multsig Wallet

4. Graph Node

The meter foundation maintains two separate graph nodes for the Meter Testnet and mainnet for dApp developers. They are for testing purposes only. If you need production-level graph nodes on Meter mainnet, please reach out to the team on Discord or Telegram. We are happy to host the subgraph on our production graph nodes.
On testnet:
In the package.json file for your subgraph:
"create-test": "graph create --node http://graphtest.meter.io:8020/ [graph-name]",
"remove-test": "graph remove --node http://graphtest.meter.io:8020/ [graph-name]",
"deploy-test": "graph deploy --node http://graphtest.meter.io:8020/ --ipfs http://graphtest.meter.io:50
In the subgraph.yaml file for your subgraph:
network:metertest
On Mainnet:
In the package.json file for your subgraph:
"create-mainnet": "graph create --node http://graph.meter.io:8020/ [graph-name]",
"remove-mainnet": "graph remove --node http://graph.meter.io:8020/ [graph-name]",
"deploy-mainnet": "graph deploy --node http://graph.meter.io:8020/ --ipfs http://graph.meter.io:5001 [graph-name]",
In the subgraph.yaml file for your subgraph:
network:meter

5. APIs

  1. 1.
    Thirdweb.com provides RPC endpoints, tools, smart contract libraries, and APIs for developers to launch dApp quickly:
  1. 2.
    covalenthq.com provides data analytics APIs on the Meter mainnet.

6. Bridges

Meter Passport provides connection to 8 different chains. To add ERC20 or NFT tokens to the supported list, please make a pull request based on the instructions here: https://github.com/meterio/token-list

7. Oracles

Currently, Band Protocol and Witnet are providing price feeds to the Meter mainnet and testnet. Detailed documentation can be found on their respective websites. Pyth Network provides real-time data in an on-demand-based push model. The Meter Foundation is also actively talking to various Oracle providers to bring them onboard on Meter.

8. Important Things to Pay Attention to:

  1. 1.
    Currently, there is a limitation that MTR and MTRG can only be sent to a contract address through smart contract interactions. For example, if you want to send MTR to a contract address manually, you will have to use the above ERC20 system interface.
  2. 2.
    Meter network now requires all transactions to contain chainID. Please make sure to configure your deployment script properly.
  3. 3.
    The minimum gas price on Meter is currently 100gwei (Use eth_estimateGas to obtain the gas price). Even if a lower gas price is specified, the network will still charge 100gwei silently. Make sure you have enough MTR in the account.
  4. 4.
    Meter network is front-running resistant. It does not order transactions by the gas price specified. Transactions are ordered by the time the proposing node receives them. By default, if a transaction is not processed within 320 blocks after the network receives it, it will automatically expire.
  5. 5.
    Meter does not require sequential nonce for each account. If you want to deploy your contract to a specified address, please use the deterministic deployment method for Ethereum. If you want to use an EOA address and specific nonce to create a deterministic contract address, you will have to force the nonce of your transaction (for example in MetaMask) instead of relying on the random nonce returned from the RPC. As long as the nonce has not been used, the transaction will be processed and the same contract address can be created.
  6. 6.
    If you use Ethereum RPC to obtain the next nonce, you will receive a random number. In fact, you could use any nonce when sending a transaction on Meter. However, transactions from the same account with duplicated nonce will not be executed. Precomputed Ethereum tx hash is also guaranteed to be the same as on-chain hash.