Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MEP803, added downlink price and func to get owner's profile list. #22

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion proposals/mep-803.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,25 @@ interface IIMEP803 {
/// The parameters is the index of app, owner and url.
event ProfileUrlChanged(uint256 idx, address owner, string url);

/// @dev This event gets emitted when a device profile downlink price changed
/// The parameters is the index of app, owner and the new price.
event DownlinkPriceChanged(
uint256 idx,
address owner,
uint256 downlinkPrice
);

/// @notice Return the name of contract, use to identiry the version of the contract
function name() external view returns (string memory);

/// @notice Create a device profile
/// @param _name The name of of the device profile
/// @param _url The url of of the device profile
/// @param _downlinkPrice The price for Downlink, unit in MXC
function createProfile(
string memory _name,
string memory _url
string memory _url,
uint256 _downlinkPrice
) external returns (uint256);

/// @notice rename a device profile
Expand All @@ -78,8 +89,19 @@ interface IIMEP803 {
/// @param _url The url of of the device profile
function setProfileUrl(uint256 _idx, string memory _url) external;

/// @notice Set the Downlink Price of the device profile
/// @param _idx The device profile index
/// @param _downlinkPrice The price for Downlink, unit in MXC
function setDownlinkPrice(uint256 _idx, uint256 _downlinkPrice) external;

/// @notice Return the number of profiles belong to the sender.
function ownerProfileIdxCount() external view returns (uint256);

/// @notice Return a list of profiles belong to the sender. Up to 10.
/// @param _offset The starting index of owner's profile
function getOwnerProfileList(
uint256 _offset
) external view returns (DeviceProfile[] memory);
}
```

Expand All @@ -93,6 +115,7 @@ struct DeviceProfile {
address owner;
string url;
bool active;
uint256 downlinkPrice;
}

contract Storage1 {
Expand Down
Loading