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.
There are two primary methods of interacting with Meter:
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
web3.jsto 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. Additionally, the sender of a transaction must rely on the transaction hash returned by the node instead of generating it directly offline.
When interacting with Meter you must use "Injected Web3" in Remix alongside Metamask.
Warringstakes Testnet Endpoints:
Currency Symbol: MTR
ERC20 System Interface:
Faucet for Testnet:
Currency Symbol: MTR
ERC20 System Interface:
-MTR (Optional): 0x687A6294D0D6d63e751A059bf1ca68E4AE7B13E2
Meter explorer uses Sourcify for verifying 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 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.
Meter team has deployed a forked version of Gnosis Safe multsig wallet on the Meter mainnet. It can be found at:
- 1.Currently, there is a limitation that MTR and MTRG could 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.Meter network now requires all transactions to contain chainID. Please make sure to configure your deployment script properly.
- 3.The minimum gas price on Meter is currently 500gwei. Even if a lower gas price is specified, the network will still charge 500gwei silently. Make sure you have enough MTR in the account.
- 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.
You are able to access all of our functionality and create Meter native transactions through this interface. We have implemented an Ethereum web3 compatible interface library called meterify.
In order to install Meterify run the following commands:
npm install meterify
Using the code below you can create a web3 instance. You are then able to use the Ethereum web3 interfaces to interact with the Meter mainnet.
const meterify = require(“meterify”).meterify;
const Web3 = require(“web3");
const web3 = meterify(new Web3(), “https://mainnet.meter.io”);