BoostryJP / ibet-SmartContract

Tokens and DEX contracts available in the ibet DeFi network 🔗
https://ibet.jp/ibet-for-fin
Apache License 2.0
18 stars 3 forks source link

[FEATURE] address-to-address messaging contract #315

Closed YoshihitoAso closed 3 years ago

YoshihitoAso commented 3 years ago

1. Is your feature request related to a problem? Please describe.

Reference; https://github.com/ethereum/EIPs/issues/802

2. Describe the solution you'd like

I propose the following specification.

Specification

Methods

Send message

function sendMessage(address _to, string memory _text)

Last Index

function lastIndex(address _owner) constant returns (uint256)

Get last message

function getLastMessage(address _who) constant returns (address _from, string memory _text, uint256 _time)

Get message by index

function getMessageByIndex(address _who, uint256 _index) constant returns (address _from, string memory _text, uint256 _time)

Get public key

function getPublicKey(address _who) constant returns (string memory _key, string memory _key_type)

Set public key

function setPublicKey(string memory _key, string memory _key_type)

Events

New message

event Message(address indexed sender, address indexed receiver, uint256 time, string text)

Public key updated

event PublicKeyUpdated(address indexed who, string key, string key_type)