MoCVendors
MoCVendors - version: 0.1.12
struct VendorDetails {
bool isActive,
uint256 markup,
uint256 totalPaidInMoC,
uint256 staking
}
Constants & Variables
contract IMoC internal moc;
contract IMoCState internal mocState;
contract IMoCExchange internal mocExchange;
uint8 public constant VENDORS_LIST_ARRAY_MAX_LENGTH;
uint256 public constant VENDOR_MAX_MARKUP;
address public vendorGuardianAddress;
mapping(address => struct MoCVendors.VendorDetails) public vendors;
address[] public vendorsList;
uint256[50] private upgradeGap;
Parameters
Name | Type | Description |
---|---|---|
account | address | |
markup | uint256 | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
markup | uint256 | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
staking | uint256 | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
staking | uint256 | |
Parameters
Name | Type | Description |
---|---|---|
account | address | |
Parameters
Name | Type | Description |
---|---|---|
vendorGuardianAddress | address | |
Parameters
Name | Type | Description |
---|---|---|
vendorAdress | address | |
paidMoC | uint256 | |
paidRBTC | uint256 | |
Checks if vendor (msg.sender) is active
modifier onlyActiveVendor() internal
Arguments
Checks if address is allowed to call function
modifier onlyVendorGuardian() internal
Arguments
Initializes the contract
function initialize(address connectorAddress, address _governor, address _vendorGuardianAddress) public nonpayable initializer
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. |
Gets the count of active registered vendors
function getVendorsCount() public view
returns(vendorsCount uint256)
Returns
Amount of active registered vendors
Arguments
Allows to register a vendor
function registerVendor(address account, uint256 markup) public nonpayable onlyVendorGuardian
returns(isActive bool)
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 |
Allows to unregister a vendor
function unregisterVendor(address account) public nonpayable onlyVendorGuardian
returns(isActive bool)
Returns
false if vendor was unregistered successfully; otherwise false
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
Allows an active vendor (msg.sender) to add staking
function addStake(uint256 staking) public nonpayable onlyActiveVendor
Arguments
Name | Type | Description |
---|---|---|
staking | uint256 | Staking the vendor wants to add |
Allows an active vendor (msg.sender) to remove staking
function removeStake(uint256 staking) public nonpayable onlyActiveVendor
Arguments
Name | Type | Description |
---|---|---|
staking | uint256 | Staking the vendor wants to remove |
⤾ overrides IMoCVendors.updatePaidMarkup
Allows to update paid markup to vendor
function updatePaidMarkup(address account, uint256 mocAmount, uint256 rbtcAmount) public nonpayable onlyWhitelisted
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
mocAmount | uint256 | paid markup in MoC |
rbtcAmount | uint256 | paid markup in RBTC |
⤾ overrides IMoCVendors.getIsActive
Gets if a vendor is active
function getIsActive(address account) public view
returns(bool)
Returns
true if vendor is active; false otherwise
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
⤾ overrides IMoCVendors.getMarkup
Gets vendor markup
function getMarkup(address account) public view
returns(uint256)
Returns
Vendor markup
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
⤾ overrides IMoCVendors.getTotalPaidInMoC
Gets vendor total paid in MoC
function getTotalPaidInMoC(address account) public view
returns(uint256)
Returns
Vendor total paid in MoC
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
⤾ overrides IMoCVendors.getStaking
Gets vendor staking
function getStaking(address account) public view
returns(uint256)
Returns
Vendor staking
Arguments
Name | Type | Description |
---|---|---|
account | address | Vendor address |
⤾ overrides IMoCVendors.resetTotalPaidInMoC
Allows to reset all active vendor's total paid in MoC during settlement
function resetTotalPaidInMoC() public nonpayable onlyWhitelisted
Arguments
Returns the address is authorized to register and unregister vendors.
function getVendorGuardianAddress() public view
returns(address)
Arguments
Sets the address which will be authorized to register and unregister vendors.
function setVendorGuardianAddress(address _vendorGuardianAddress) public nonpayable onlyAuthorizedChanger
Arguments
Name | Type | Description |
---|---|---|
_vendorGuardianAddress | address | Address which will be authorized to register and unregister vendors. |
function initializeContracts() internal nonpayable
Arguments
function initializeValues(address _governor, address _vendorGuardianAddress) internal nonpayable
Arguments
Name | Type | Description |
---|---|---|
_governor | address | |
_vendorGuardianAddress | address | |
Sets the address which will be authorized to register and unregister vendors.
function setVendorGuardianAddressInternal(address _vendorGuardianAddress) internal nonpayable
Arguments
Name | Type | Description |
---|---|---|
_vendorGuardianAddress | address | Address which will be authorized to register and unregister vendors. |
Last modified 1yr ago