From 7b7a8bed0dd2573c9e5f8b65ecc24aaaa3df1a92 Mon Sep 17 00:00:00 2001 From: ian_lee Date: Wed, 3 Jan 2024 10:42:35 +0100 Subject: [PATCH] MEP803, added downlink price and func to get owner's profile list. --- proposals/mep-803.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/proposals/mep-803.md b/proposals/mep-803.md index b30f46c..7d9bdc1 100644 --- a/proposals/mep-803.md +++ b/proposals/mep-803.md @@ -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 @@ -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); } ``` @@ -93,6 +115,7 @@ struct DeviceProfile { address owner; string url; bool active; + uint256 downlinkPrice; } contract Storage1 {