MoCVendors

View Source: contracts/MoCVendors.sol

↗ Extends: MoCVendorsEvents, MoCBase, MoCLibConnection, Governed, IMoCVendors

MoCVendors - version: 0.1.12

Structs

VendorDetails

struct VendorDetails {
 bool isActive,
 uint256 markup,
 uint256 totalPaidInMoC,
 uint256 staking
}

Contract Members

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;

VendorRegistered

Parameters

VendorUpdated

Parameters

VendorUnregistered

Parameters

VendorStakeAdded

Parameters

VendorStakeRemoved

Parameters

TotalPaidInMoCReset

Parameters

VendorGuardianAddressChanged

Parameters

VendorReceivedMarkup

Parameters

Modifiers

onlyActiveVendor

Checks if vendor (msg.sender) is active

modifier onlyActiveVendor() internal

Arguments

onlyVendorGuardian

Checks if address is allowed to call function

modifier onlyVendorGuardian() internal

Arguments

Functions

initialize

Initializes the contract

function initialize(address connectorAddress, address _governor, address _vendorGuardianAddress) public nonpayable initializer 

Arguments

getVendorsCount

Gets the count of active registered vendors

function getVendorsCount() public view
returns(vendorsCount uint256)

Returns

Amount of active registered vendors

Arguments

registerVendor

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

unregisterVendor

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

addStake

Allows an active vendor (msg.sender) to add staking

function addStake(uint256 staking) public nonpayable onlyActiveVendor 

Arguments

removeStake

Allows an active vendor (msg.sender) to remove staking

function removeStake(uint256 staking) public nonpayable onlyActiveVendor 

Arguments

updatePaidMarkup

⤾ overrides IMoCVendors.updatePaidMarkup

Allows to update paid markup to vendor

function updatePaidMarkup(address account, uint256 mocAmount, uint256 rbtcAmount) public nonpayable onlyWhitelisted 
returns(bool)

Arguments

getIsActive

⤾ 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

getMarkup

⤾ overrides IMoCVendors.getMarkup

Gets vendor markup

function getMarkup(address account) public view
returns(uint256)

Returns

Vendor markup

Arguments

getTotalPaidInMoC

⤾ overrides IMoCVendors.getTotalPaidInMoC

Gets vendor total paid in MoC

function getTotalPaidInMoC(address account) public view
returns(uint256)

Returns

Vendor total paid in MoC

Arguments

getStaking

⤾ overrides IMoCVendors.getStaking

Gets vendor staking

function getStaking(address account) public view
returns(uint256)

Returns

Vendor staking

Arguments

resetTotalPaidInMoC

⤾ overrides IMoCVendors.resetTotalPaidInMoC

Allows to reset all active vendor's total paid in MoC during settlement

function resetTotalPaidInMoC() public nonpayable onlyWhitelisted 

Arguments

getVendorGuardianAddress

Returns the address is authorized to register and unregister vendors.

function getVendorGuardianAddress() public view
returns(address)

Arguments

setVendorGuardianAddress

Sets the address which will be authorized to register and unregister vendors.

function setVendorGuardianAddress(address _vendorGuardianAddress) public nonpayable onlyAuthorizedChanger 

Arguments

initializeContracts

function initializeContracts() internal nonpayable

Arguments

initializeValues

function initializeValues(address _governor, address _vendorGuardianAddress) internal nonpayable

Arguments

setVendorGuardianAddressInternal

Sets the address which will be authorized to register and unregister vendors.

function setVendorGuardianAddressInternal(address _vendorGuardianAddress) internal nonpayable

Arguments

Last updated