Vendors are third parties who want to integrate their platform with the MoC ecosystem. Vendors can charge a markup of up to 1% of the value to mint/redeem operations, and receive this value as MoC tokens. These tokens neither receive rewards nor vote nor can they participate as an oracle or as no other function that MoC stakeholders have in the Staking Machine.
Note that once a vendor is unregistered, they will not receive any more profits.
When a vendor decides to integrate their platform with the MoC ecosystem, they must be registered first. Then, they will receive a markup for every transaction they are involved in (denoted by the parameter vendorAccount).
If the user who makes the transaction has balance and allowance of MoC token, this markup will be charged in MoC; otherwise it will be charged in RBTC. The exact percentage of the markup cannot be more than 1%. This is set in the vendors mapping of the MoCVendors contract (the vendor account address is the key), and the value to check is markup.
Note that the markup has also a precision of 18 decimals, i.e. a 1 * 10^15 in that parameter means that 0.1% is being charged as a commission.
Base commissions and markup in money on chain webapp:
Before start operations with MoCVendor we need to allow to MoCVendors.sol and MoC.sol using MoC Token. The approval transaction is used to grant permission for the smart contract to transfer a certain amount of the token, called allowance.
The functions that interest us are the following:
Approve (tx) involve contract address and amount of token to allow
function approve(address _contract, uint256 _amount) public returns (bool success)
Allowance (call) function return remaining amount of token amount
function allowance(address _owner, address _contract) public view returns (uint256 remaining)
Example Call approve:
Contract to allow
Amount in wei
The approve transaction is part of the ERC-20 standard and you can find more information here.
Staking and MoC Vendors
Upon registration, vendors must add stake using the function addStake(uint256 staking) defined in the MoCVendors contract ABI interface. This allows the vendor to receive the profits in MoC token when an user perform a mint/redeem operation through vendor's integration.