Repository navigation
Expand file tree
/
Copy pathIOpdexStandardMarket.cs
More file actions
90 lines (78 loc) · 4.07 KB
/
Copy pathIOpdexStandardMarket.cs
File metadata and controls
90 lines (78 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using Stratis.SmartContracts;
public interface IOpdexStandardMarket : IOpdexMarket
{
/// <summary>
/// Flag to authorize traders or not.
/// </summary>
bool AuthTraders { get; }
/// <summary>
/// Flag to authorize liquidity providers or not.
/// </summary>
bool AuthProviders { get; }
/// <summary>
/// Flag to authorize liquidity pool creators or not.
/// </summary>
bool AuthPoolCreators { get; }
/// <summary>
/// Flag indicating if the market owner collects 1/6 of all transaction fees.
/// </summary>
bool MarketFeeEnabled { get; }
/// <summary>
/// The wallet address of the active owner of the market.
/// </summary>
/// <remarks>
/// The market owner's privileges include the ability to adjust any user's permission, qualification for any permission,
/// is the collector of any market fees accrued when enabled and has the ability to release ownership by setting a new
/// pending owner to claim ownership.
/// </remarks>
Address Owner { get; }
/// <summary>
/// A pending wallet address that has been suggested to take ownership of the contract. This value
/// acts as a whitelist for access to <see cref="ClaimPendingOwnership"/>.
/// </summary>
Address PendingOwner { get; }
/// <summary>
/// Checks if the provided address is authorized for the given permission.
/// </summary>
/// <param name="address">The address to check permissions for.</param>
/// <param name="permission">
/// The permission to check authorization of. See <see cref="Permissions"/> for list of available options.
/// </param>
/// <returns>Flag describing if the address is authorized or not.</returns>
bool IsAuthorized(Address address, byte permission);
/// <summary>
/// Checks if the provided primary and secondary addresses are authorized for the given permission.
/// </summary>
/// <param name="primary">The primary address to check permissions for.</param>
/// <param name="secondary">The secondary address to check permissions for.</param>
/// <param name="permission">The permission to check authorizations for.</param>
/// <returns>Flag describing if both of the addresses are authorized or not.</returns>
bool IsAuthorized(Address primary, Address secondary, byte permission);
/// <summary>
/// Allows permitted addresses to set an authorization for a provided address and permission.
/// </summary>
/// <param name="address">The address to set the permission for.</param>
/// <param name="permission">The permission being set. See <see cref="Permissions"/> for list of available options.</param>
/// <param name="authorize">Flag describing if the address should be authorized or not.</param>
void Authorize(Address address, byte permission, bool authorize);
/// <summary>
/// Public method allowing the current contract owner to whitelist a new pending owner. The newly pending owner
/// will then call <see cref="ClaimPendingOwnership"/> to accept ownership.
/// </summary>
/// <param name="pendingOwner">The address to set as the new pending owner.</param>
void SetPendingOwnership(Address pendingOwner);
/// <summary>
/// Public method to allow the pending new owner to accept ownership replacing the current contract owner.
/// </summary>
void ClaimPendingOwnership();
/// <summary>
/// Looks up a pool by the provided SRC token address and collects the specified amount of market fees (LP tokens).
/// Collected fees from the pool are transferred to the current <see cref="Owner"/> of the market.
/// </summary>
/// <remarks>
/// See <see cref="IOpdexLiquidityPool.GetBalance"/> for retrieving the current amount of fees available for collection held by the market contract.
/// </remarks>
/// <param name="token">The SRC token address to lookup the liquidity pool by.</param>
/// <param name="amount">The amount of fees (LP tokens) to collect from the pool and transfer to the market owner.</param>
void CollectMarketFees(Address token, UInt256 amount);
}