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

EOS smart contract #1

Open
zlumer opened this issue Jul 20, 2018 · 0 comments
Open

EOS smart contract #1

zlumer opened this issue Jul 20, 2018 · 0 comments
Assignees

Comments

@zlumer
Copy link
Member

zlumer commented Jul 20, 2018

Master contract

  1. Data Update Request data structure:
  • data type hash (256bit) — unique identifier of the data provider
  • timestamp (unixtime in milliseconds)
  • receiving contract address
  • txhash — hash for the transaction that satisfied data request
  1. Method requestData()
  • should create a Data Update Request for oracles to process.
  • puts a new DUR into EOS contract table for further procession.

Consumer contract

  1. Private method check_data_age()
  • should check whether the data is up to date or not.
  • should throw if data is antique.
  • data is considered outdated after a specified timeout in seconds or blocks. Oudated data should be updated immediately (in the same transaction).
  • data is considered antique after a specified timeout in seconds or blocks. Antique data prevents contract from processing any more transactions until it's manually updated.
  • timeout should be configurable in the contract variable.
  1. Private method request_data()
  • should request new data from the Master contract.
  • should be called automatically when the data is outdated (check_data_age() returns truthy value).
  1. Public method request_data_manually()
  • can be called only if data is outdated or antique (tested by check_data_age()).
  • calls request_data() internally.
  1. Restricted method update_data()
  • can be called only by Ducatur Oracle.
  • updates data in the contract.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants