The Monerium e-money offers programmable fiat money on blockchains, an indispensable building block for the nascent blockchain economy.
Monerium EMI is an Electronic Money Institution, currently the only financial entity licenced to issue e-money on blockchains. Electronic money (e-money) has been recognized in the European Economic Area (EEA) as a digital alternative to cash since 2000 when the first e-money Directive was introduced. Monerium e-money is 1:1 backed in fully segregated, unencumbered, high-quality liquid assets and unconditionally redeemable on demand. Read more about e-money here.
EUR | GBP | ISK | USD |
---|---|---|---|
eur.monerium.eth |
gbp.monerium.eth |
isk.monerium.eth |
usd.monerium.eth |
EUR | GBP | ISK | USD |
---|---|---|---|
Polygon.Pos.EUR |
Polygon.Pos.GBP |
Polygon.Pos.ISK |
Polygon.Pos.USD |
EUR | GBP | ISK | USD |
---|---|---|---|
Gnosischain.EUR |
Gnosischain.GBP |
Gnosischain.ISK |
Gnosischain.USD |
For the innovators, product builders, and other curious minds we've opened up a sandboxed version of our system that is connected to the Rinkeby test network. Play around with our money in a safe environment to understand how this fits into your platform. Go to sandbox.
Please fill out the "Partner with Monerium" form on monerium.com to get test money for the Ropsten or Kovan test networks.
We at Monerium er really exited to talk to all developers and builders that want to use money in their applications. Go to monerium.com and fill out the "Partner with Monerium" form and our expert staff will be available to help you every step of the way, from implementation to ongoing operations.
Each token has the following ERC20 and ERC677 methods available to integrate with your application.
contract Euro {
// Transfers tokens [ERC20].
transfer(to, amount)
// Transfers tokens from a specific address [ERC20].
transferFrom(from, to, amount)
// Approves a spender [ERC20].
approve(spender, amount)
// Transfers tokens and subsequently calls a method
// on the recipient [ERC677].
transferAndCall(to, amount, data)
// Returns the total supply.
totalSupply()
// Returns the number tokens associated with an address.
balanceOf(who)
// Returns the allowance for a spender
allowance(owner, spender)
}
The user gives your smart contract the right to take the money by itself from their address using the approve
method.
Once approved, your contract can call the transferFrom
method in the Monerium contract and transfer money from the address.
transferAndCall
transfers money and calls the receiving contract's onTokenTransfer
method with additional data and triggers an event Transfer.
Four cooperating Ethereum smart-contracts are deployed for each e-money currency token that is ERC20 compliant.
- Token Frontend: This contract implements the ERC20 token standard and provides a permanent Ethereum address for the token system. The contract only exposes the required ERC20 functionality to the user and delegates all of the execution to the controller.
- Controller: The controller is responsible for the business logic. The controllers are further separated by the functionality they provide into; StandardController, MintableController and SmartController.
- Token Storage: Storage of e-money token ledger.
- Validator: The validator can be used by the controllers to approve and validate transactions before they are made.
Using this design we're able to upgrade the business logic, to fix bugs or add functionality, while providing a fixed address on the blockchain and permanent access to the token bookkeeping.
The token system is implemented using Solidity, the most widely used high level language targeting the EVM. We build upon community vetted libraries where possible to minimize the risk of bugs.
Additional functionality has been implemented in MintableTokenLib.sol
and SmartTokenLib.sol
. This includes minting and burning tokens and defining validators who determine whether token transactions are valid or not.
Functionality which requires authorization is protected by OpenZeppelin's implementation of the Ownable contract. The management of the private key of the owner is very simple at the moment but for v1.0.0 a multi-signature account or a simple DAO will be used.
Libraries in Solidity provide the means to deploy an implementation once as a compiled byte code but without an execution context (storage). Contracts deployed subsequently can then be statically linked to the library.
Our token system takes advantage of this feature to save gas deploying multiple tokens. It can also be argued that sharing audited libraries between contracts can reduce the risk of bugs and worst case ease the replacement of a buggy implementation.
-
Clone the repository
git clone --recursive https://github.com/monerium/smart-contracts.git cd smart-contracts
-
Install dependencies
yarn install
-
Run truffle
npx truffle develop
-
Compile token system
truffle(develop)> compile --all
-
Deploy
truffle(develop)> migrate --reset
-
Run test suite
truffle(develop)> test
To ease the development, deployment and interaction with the token system we're using truffle.
Truffle's ganache simulates full client behavior and makes developing Ethereum applications much faster while Truffle is a development environment, testing framework and asset pipeline for Ethereum.
Development happens on the master branch and we use Semantic Versioning for our tags. The first pre-release version deployed on a non-testrpc blockchain is v0.7.0.
# npx truffle migrate [--network <name>]
The token system ships with JavaScript unit tests.
# make test
Code coverage for the token system can be checked with solidity-coverage.
# make coverage
The smart contracts were audited by Ackee Blockchain Security. The report is available here.
Copyright 2023 Monerium ehf.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.