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

[Data Feed Oracle] Issue 2: Data Verification, Dispute Resolution, and Incentives #61

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
13 changes: 13 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# EditorConfig is awesome: https://EditorConfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = false

[*.ral]
indent_size = 4
2 changes: 2 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/dist/
**/templates/
16 changes: 16 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": [
"prettier",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"header/header": ["off"]
},
"parserOptions": {
"project": "tsconfig.json",
"ecmaVersion": 2020,
"sourceType": "module"
},
"parser": "@typescript-eslint/parser"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ral linguist-language=Rust
7 changes: 7 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
coverage/
lerna-debug.log
/dist
/dev
.deployments.devnet.json
artifacts/
25 changes: 25 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
node_modules/

# Dotfiles
.vscode
.DS_Store

# Files generated by devnet
/dev/*
!dev/user.conf

# Files generated by executing smart contracts
/artifacts/

# Config files
license-header.js
/configs/

# Tests
coverage/

# GitHub Actions
.github/

src/**/*.test.ts
**/fixtures/
93 changes: 93 additions & 0 deletions data-feed-oracle-verification-disputeResolution/.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"fullNodeVersion": "v3.8.5",
"compilerOptionsUsed": {
"ignoreUnusedConstantsWarnings": false,
"ignoreUnusedVariablesWarnings": false,
"ignoreUnusedFieldsWarnings": false,
"ignoreUnusedPrivateFunctionsWarnings": false,
"ignoreUpdateFieldsCheckWarnings": false,
"ignoreCheckExternalCallerWarnings": false,
"ignoreUnusedFunctionReturnWarnings": false,
"skipAbstractContractCheck": false
},
"infos": {
"AddOracle": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"AncillaryData": {
"sourceFile": "datafeed.ral",
"sourceCodeHash": "d3a8e986e637c6bdfff86458033dde8537d1a1d42708f23db190cc956b280b99",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"CompleteRequest": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"IFungibleToken": {
"sourceFile": "..\\node_modules\\@alephium\\web3\\std\\fungible_token_interface.ral",
"sourceCodeHash": "62910bf11e1eeb6cb2fd468626ff606a9b06306b2b81590c3b10f6deb5966bde",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"MakeRequest": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"ProposePrice": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"RemoveOracle": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"Request": {
"sourceFile": "datafeed.ral",
"sourceCodeHash": "d3a8e986e637c6bdfff86458033dde8537d1a1d42708f23db190cc956b280b99",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"SetCurrentTime": {
"sourceFile": "scripts.ral",
"sourceCodeHash": "64648e66c97b410c96f2d3b35367b2d5291c8e18286edcf838d425cb49dbdcb8",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"Testable": {
"sourceFile": "datafeed.ral",
"sourceCodeHash": "d3a8e986e637c6bdfff86458033dde8537d1a1d42708f23db190cc956b280b99",
"bytecodeDebugPatch": "",
"codeHashDebug": ""
},
"Token": {
"sourceFile": "token.ral",
"sourceCodeHash": "31da4da8fb6c30b3cc60c6da86790758bda7d5620164c0fbfa20469f3a534542",
"bytecodeDebugPatch": "",
"codeHashDebug": "03cbbd308bd80bfe297a4bc92ee1db1f4803983033792c0ec9d4b69220ad4d3e"
},
"TokenFactory": {
"sourceFile": "token_factory.ral",
"sourceCodeHash": "e4a7384bb6125cdf5a23fc3b3b979d9a1f9a3e85746f592c1b6a6ee9dfe9cf8b",
"bytecodeDebugPatch": "=6-2+69=11-1+f=114+16087e0240204372656174656420746f6b656e20636f6e747261637420776974682049443a2000=6",
"codeHashDebug": "dc5e2968a9cbada3c13e298932547a0e1a84766db741b66f3178b6adb39c7702"
},
"WeatherDataFeed": {
"sourceFile": "datafeed.ral",
"sourceCodeHash": "d3a8e986e637c6bdfff86458033dde8537d1a1d42708f23db190cc956b280b99",
"bytecodeDebugPatch": "=12-2+b6=2-1=1+8=2+4=1-1=2-2+86=2-2+a8=1-3+207=2-2+cf=2-2+cf4=2-1+8=1-8+50e=2+2=1-1=2+a14=2+0=1-2=1+1a463=1-3=2-2+c1=137-1+9=125-1+c=38+7a7e0214696e73657274206174206d617020706174683a2000=155-1+6=60+7a7e0214696e73657274206174206d617020706174683a2000=33-1+5=60+7a7e021472656d6f7665206174206d617020706174683a2000=289-1+9=184+7a7e0214696e73657274206174206d617020706174683a2000=1903-1+4=37-1+a=38+7a7e021472656d6f7665206174206d617020706174683a2000=44+7a7e0214696e73657274206174206d617020706174683a2000=48",
"codeHashDebug": "68b943b4ed9eaa34b4ed8ced2fa9937cd665be7dc061a99d0c5968dec36c8eea"
}
}
}
33 changes: 33 additions & 0 deletions data-feed-oracle-verification-disputeResolution/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# My dApp Template

## Install

```
npm install
```

## Start a local devnet for testing and development

```
npx @alephium/cli@latest devnet start
```

## Compile

Compile the TypeScript files into JavaScript:

```
npx @alephium/cli@latest compile
```

## Stop/restart devnet

```
npx @alephium/cli@latest devnet stop
```

## Testing

```
npx @alephium/cli@latest test
```
33 changes: 33 additions & 0 deletions data-feed-oracle-verification-disputeResolution/alephium.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { Configuration } from '@alephium/cli'
import { Address } from '@alephium/web3'

export type Settings = {
beneficiary: Address
biddingEnd: number
revealEnd: number
}

const configuration: Configuration<Settings> = {
networks: {
devnet: {
nodeUrl: 'http://127.0.0.1:22973',
// here we could configure which address groups to deploy the contract
privateKeys: ['a642942e67258589cd2b1822c631506632db5a12aabcf413604e785300d762a5'],
settings: undefined as unknown as Settings
},

testnet: {
nodeUrl: process.env.NODE_URL as string,
privateKeys: process.env.PRIVATE_KEYS === undefined ? [] : process.env.PRIVATE_KEYS.split(','),
settings: undefined as unknown as Settings
},

mainnet: {
nodeUrl: process.env.NODE_URL as string,
privateKeys: process.env.PRIVATE_KEYS === undefined ? [] : process.env.PRIVATE_KEYS.split(','),
settings: undefined as unknown as Settings
}
}
}

export default configuration
Loading