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

[$7800 iDNA] Build an oracle-driven dapp using RefundableOracleLock smart contract #628

Open
midenaio opened this issue Feb 4, 2021 · 7 comments

Comments

@midenaio
Copy link
Member

midenaio commented Feb 4, 2021

[$7800 iDNA] Build an oracle-driven dapp using RefundableOracleLock smart contract

Prize pool

Total prize pool is 65K iDNA. There are 6 prizes to be distributed:

  • 25k iDNA - 1 prize
  • 15k iDNA - 1 prize
  • 10k iDNA - 1 prize
  • 5k iDNA - 3 prizes

All the prizes are paid in iDNA at the price of $0.12

Challenge description

Submission Requirements

All code must be open source.
All submissions must be working solutions.
Submissions must use one or more Idena smart contracts.
Use cases:

1. Decentralized Kickstarter (prizes: 5K-15K iDNA)
A website that allows any validated or not validated Idena user to create a wallet to collect funds for a project. Coins of such a wallet will be unlocked at a certain moment in the future based on the results of an oracle voting. If the criteria specified in the voting are not met (oracles voted against), the money is returned to all donors.

Functions:

  • Create a project with a specific deadline and criterias
  • Create a RefundableOracleLock that locks donated coins according to the criterias specified in the OracleVoting which will be started in a future date
  • Send donation
  • etc.

2. Prediction market (prizes: 5K-25K iDNA)
A website that allows taking bets on events for already created OracleVoting contracts that will be launched on a certain date in the future. When OracleVoting starts, the fact of an event occurrence is certified by oracles. The losing side's coins are sent to the winning side's contract. The coins of the winning side are distributed to the winners in proportion to their bets.

Functions:

  • Create two linked RefundableOracleLock smart contracts for locking bets according to the criteria specified in the OracleVoting (which can be launched in future)
  • Send bets
  • etc.

3. Other
Participants may choose any other use cases for development. The size of the awarded prize will depend on the use case complexity.

How to participate

Apply and submit results in comments to the issue.

Hackathon dates

February 10 - March 3, 2021

Submission deadline

18:00 UTC, March 3, 2021

Resources

Idena smart contracts
Start reading about smart contracts here:
https://github.com/idena-network/idena-desktop/wiki/Idena-smart-contracts

RefundableOracleLock smart contract:
https://github.com/idena-network/idena-desktop/wiki/RefundableOracleLock

Raw transactions
Sending raw transactions with the Idena app:
https://github.com/idena-network/idena-desktop/wiki/DNA-url#4-sign-and-send-a-raw-transaction

Protobuf model of transactions:
https://github.com/idena-network/idena-go/blob/master/protobuf/models.proto#L6

Raw transaction examples:
https://github.com/idena-network/idena-examples/tree/master/nodejs-protobuf-transaction-signing

Sign-in with Idena
https://github.com/idena-network/idena-desktop/wiki/Sign-in-with-Idena

Idena RPC
http://rpc.idena.io

Judging Criteria

  • How likely the application is to be used
  • Novelty of the use case
  • The potential positive impact for the Idena ecosystem

The decision on awarding of the prizes will be made on the basis of voting by Idena network participants and expert opinion (the Idena team and community developers). The size of the awarded prize will depend on complexity and quality of the submission.

The Idena team may consider funding further development of the winning solutions governed by the oracles voting.

Winner Announcement Date

Shortly after reviewing results by the Idena team and community voting.

@redDwarf03
Copy link

hello. Could you tell me if it exists a test environment for that ?

@midenaio
Copy link
Member Author

hello. Could you tell me if it exists a test environment for that ?

You can run an automine node locally.

could you confirm this control is ok ? https://github.com/idena-network/idena-examples/blob/4c7957dedfcece7deb33406115ea3dede8e1ce3a/nodejs-protobuf-transaction-signing/transaction.js#L88

Please check the latest protobuf models here

@redDwarf03
Copy link

ok for test. thx.
you consider this condition is ok ... so.. I don't understand why you control amount value to affect tips value :)

if (this.amount) {
data.setTips(toBuffer(this.tips));
}

@midenaio
Copy link
Member Author

Fixed. Thank you @redDwarf03 👍

@redDwarf03
Copy link

hello. Could you tell me if it exists a test environment for that ?

You can run an automine node locally.

when I run an automize node locally, I have issue with the smart contract stake:
-> "GasPrice is calculated automatically by the protocol as following: GasPrice= 0.01/NetworkSize" -> So with test environment, is it GasPrice = 0.01/1 ?
-> Minimum smart contract stake is calculated as GasPrice * 3 000 000 -> 0.01 * 3 000 000 = 30 000 ?
i have always an error with "invalid amount"
Could you give me any help to test please

Thx

@midenaio
Copy link
Member Author

-> Minimum smart contract stake is calculated as GasPrice * 3 000 000 -> 0.01 * 3 000 000 = 30 000 ?

Yes, the minimum smart contract stake seems relevant for the empty network. In order to premint required amount of coins you can use the following GenesisConf section in the node config file:

  "GenesisConf": {
    "Alloc": {
      "0x3e71....": {
        "Balance": 99999999900000000000000,
        "Stake": 99999999900000000000000
      }
    }
  }

@idena-network idena-network deleted a comment from KenMan79 Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants