Main Contract
Search…
Introduction
Money on Chain platform
Main concepts
System states
Public actions
Contracts architecture
Contract mocks
Relevant patterns and choices
Data dictionary
Getting started
Integration with MoC platform
Introduction to MoC
Getting BPros
Getting DoCs
Getting BTCx
Commission fees values
Vendors
Fees calculation
From outside the blockchain
Smart contracts
Contracts verification
ABIs documentation
BProToken
BtcPriceProviderMock
DocToken
ERC20Mintable
Governed
Initializable
MakeStoppable
MakeUnstoppable
MoC
MoCBProxManager
MoCBProxManagerUpdater
MoCBucketContainer
MoCConnector
MoCConverter
MoCEMACalculator
MoCExchange
MoCHelperLib
MoCHelperLibMock
MoCInrate
MoCLibConnection
MoCPriceProviderMock
MoCSettlement
MoCSettlementMock
MoCState
MoCStateMock
MoCToken
MoCVendors
MoCWhitelist
MockMakeStoppable
MockMakeUnstoppable
MockStopper
MockUpgradeDelegator
MockUpgraderTemplate
OwnerBurnableToken
Pausable
PriceFeed
PriceFeederAdder
PriceFeederRemover
PriceProvider
RevertingOnSend
Stoppable
Stopper
UpgradeDelegator
UpgraderTemplate
Powered By
GitBook
MoCVendors
View Source:
contracts/MoCVendors.sol
​
↗ Extends:
MoCVendorsEvents
,
MoCBase
,
MoCLibConnection
,
Governed
,
IMoCVendors
​
MoCVendors
- version: 0.1.12
Structs
VendorDetails
1
struct VendorDetails {
2
bool isActive,
3
uint256 markup,
4
uint256 totalPaidInMoC,
5
uint256 staking
6
}
Copied!
Contract Members
Constants & Variables
1
contract IMoC internal moc;
Copied!
​
1
contract IMoCState internal mocState;
Copied!
​
1
contract IMoCExchange internal mocExchange;
Copied!
​
1
uint8 public constant VENDORS_LIST_ARRAY_MAX_LENGTH;
Copied!
​
1
uint256 public constant VENDOR_MAX_MARKUP;
Copied!
​
1
address public vendorGuardianAddress;
Copied!
​
1
mapping(address => struct MoCVendors.VendorDetails) public vendors;
Copied!
​
1
address[] public vendorsList;
Copied!
​
1
uint256[50] private upgradeGap;
Copied!
​
VendorRegistered
Parameters
Name
Type
Description
account
address
​
markup
uint256
​
VendorUpdated
Parameters
Name
Type
Description
account
address
​
markup
uint256
​
VendorUnregistered
Parameters
Name
Type
Description
account
address
​
VendorStakeAdded
Parameters
Name
Type
Description
account
address
​
staking
uint256
​
VendorStakeRemoved
Parameters
Name
Type
Description
account
address
​
staking
uint256
​
TotalPaidInMoCReset
Parameters
Name
Type
Description
account
address
​
VendorGuardianAddressChanged
Parameters
Name
Type
Description
vendorGuardianAddress
address
​
VendorReceivedMarkup
Parameters
Name
Type
Description
vendorAdress
address
​
paidMoC
uint256
​
paidRBTC
uint256
​
Modifiers
​
onlyActiveVendor
​
​
onlyVendorGuardian
​
onlyActiveVendor
Checks if vendor (msg.sender) is active
1
modifier onlyActiveVendor() internal
Copied!
Arguments
onlyVendorGuardian
Checks if address is allowed to call function
1
modifier onlyVendorGuardian() internal
Copied!
Arguments
Functions
​
initialize(address connectorAddress, address _governor, address _vendorGuardianAddress)
​
​
getVendorsCount()
​
​
registerVendor(address account, uint256 markup)
​
​
unregisterVendor(address account)
​
​
addStake(uint256 staking)
​
​
removeStake(uint256 staking)
​
​
updatePaidMarkup(address account, uint256 mocAmount, uint256 rbtcAmount)
​
​
getIsActive(address account)
​
​
getMarkup(address account)
​
​
getTotalPaidInMoC(address account)
​
​
getStaking(address account)
​
​
resetTotalPaidInMoC()
​
​
getVendorGuardianAddress()
​
​
setVendorGuardianAddress(address _vendorGuardianAddress)
​
​
initializeContracts()
​
​
initializeValues(address _governor, address _vendorGuardianAddress)
​
​
setVendorGuardianAddressInternal(address _vendorGuardianAddress)
​
initialize
Initializes the contract
1
function initialize(address connectorAddress, address _governor, address _vendorGuardianAddress) public nonpayable initializer
Copied!
Arguments
Name
Type
Description
connectorAddress
address
MoCConnector contract address
_governor
address
Governor contract address
_vendorGuardianAddress
address
Address which will be authorized to register and unregister vendors.
getVendorsCount
Gets the count of active registered vendors
1
function getVendorsCount() public view
2
returns(vendorsCount uint256)
Copied!
Returns
Amount of active registered vendors
Arguments
registerVendor
Allows to register a vendor
1
function registerVendor(address account, uint256 markup) public nonpayable onlyVendorGuardian
2
returns(isActive bool)
Copied!
Returns
true if vendor was registered successfully; otherwise false
Arguments
Name
Type
Description
account
address
Vendor address
markup
uint256
Markup which vendor will perceive from mint/redeem operations
unregisterVendor
Allows to unregister a vendor
1
function unregisterVendor(address account) public nonpayable onlyVendorGuardian
2
returns(isActive bool)
Copied!
Returns
false if vendor was unregistered successfully; otherwise false
Arguments
Name
Type
Description
account
address
Vendor address
addStake
Allows an active vendor (msg.sender) to add staking
1
function addStake(uint256 staking) public nonpayable onlyActiveVendor
Copied!
Arguments
Name
Type
Description
staking
uint256
Staking the vendor wants to add
removeStake
Allows an active vendor (msg.sender) to remove staking
1
function removeStake(uint256 staking) public nonpayable onlyActiveVendor
Copied!
Arguments
Name
Type
Description
staking
uint256
Staking the vendor wants to remove
updatePaidMarkup
⤾ overrides IMoCVendors.updatePaidMarkup
Allows to update paid markup to vendor
1
function updatePaidMarkup(address account, uint256 mocAmount, uint256 rbtcAmount) public nonpayable onlyWhitelisted
2
returns(bool)
Copied!
Arguments
Name
Type
Description
account
address
Vendor address
mocAmount
uint256
paid markup in MoC
rbtcAmount
uint256
paid markup in RBTC
getIsActive
⤾ overrides IMoCVendors.getIsActive
Gets if a vendor is active
1
function getIsActive(address account) public view
2
returns(bool)
Copied!
Returns
true if vendor is active; false otherwise
Arguments
Name
Type
Description
account
address
Vendor address
getMarkup
⤾ overrides IMoCVendors.getMarkup
Gets vendor markup
1
function getMarkup(address account) public view
2
returns(uint256)
Copied!
Returns
Vendor markup
Arguments
Name
Type
Description
account
address
Vendor address
getTotalPaidInMoC
⤾ overrides IMoCVendors.getTotalPaidInMoC
Gets vendor total paid in MoC
1
function getTotalPaidInMoC(address account) public view
2
returns(uint256)
Copied!
Returns
Vendor total paid in MoC
Arguments
Name
Type
Description
account
address
Vendor address
getStaking
⤾ overrides IMoCVendors.getStaking
Gets vendor staking
1
function getStaking(address account) public view
2
returns(uint256)
Copied!
Returns
Vendor staking
Arguments
Name
Type
Description
account
address
Vendor address
resetTotalPaidInMoC
⤾ overrides IMoCVendors.resetTotalPaidInMoC
Allows to reset all active vendor's total paid in MoC during settlement
1
function resetTotalPaidInMoC() public nonpayable onlyWhitelisted
Copied!
Arguments
getVendorGuardianAddress
Returns the address is authorized to register and unregister vendors.
1
function getVendorGuardianAddress() public view
2
returns(address)
Copied!
Arguments
setVendorGuardianAddress
Sets the address which will be authorized to register and unregister vendors.
1
function setVendorGuardianAddress(address _vendorGuardianAddress) public nonpayable onlyAuthorizedChanger
Copied!
Arguments
Name
Type
Description
_vendorGuardianAddress
address
Address which will be authorized to register and unregister vendors.
initializeContracts
1
function initializeContracts() internal nonpayable
Copied!
Arguments
initializeValues
1
function initializeValues(address _governor, address _vendorGuardianAddress) internal nonpayable
Copied!
Arguments
Name
Type
Description
_governor
address
​
_vendorGuardianAddress
address
​
setVendorGuardianAddressInternal
Sets the address which will be authorized to register and unregister vendors.
1
function setVendorGuardianAddressInternal(address _vendorGuardianAddress) internal nonpayable
Copied!
Arguments
Name
Type
Description
_vendorGuardianAddress
address
Address which will be authorized to register and unregister vendors.
Previous
MoCToken
Next
MoCWhitelist
Last modified
7mo ago
Copy link
Contents
Structs
VendorDetails
Contract Members
VendorRegistered
VendorUpdated
VendorUnregistered
VendorStakeAdded
VendorStakeRemoved
TotalPaidInMoCReset
VendorGuardianAddressChanged
VendorReceivedMarkup
Modifiers
onlyActiveVendor
onlyVendorGuardian
Functions
initialize
getVendorsCount
registerVendor
unregisterVendor
addStake
removeStake
updatePaidMarkup
getIsActive
getMarkup
getTotalPaidInMoC
getStaking
resetTotalPaidInMoC
getVendorGuardianAddress
setVendorGuardianAddress
initializeContracts
initializeValues
setVendorGuardianAddressInternal