Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

Commit

Permalink
Refactor naka (#14)
Browse files Browse the repository at this point in the history
* Remove node request file

* Update gitignore

* Reinit truffle;

* Remove vscode config

* Remove migration script

* Remove python script

* Replace token contracts with interfaces for naka token

* Simplify address manager and remove escrow and version vars

* Fix set event factory logic

* Rename AddressManager to ConfigManager

* Show math for arbitration len

* Finish constructor for standard event

* Add arbitration reward percentage to config mgr

* Refactor bet method

* Refactor set result

* Refactor set result

* Refactor vote

* Set arbitration end time when creating rounds

* Refactor withdraw

* Refactor withdraw escrow

* Change event name to string and add all getters

* Add token address check for fallback

* Remove oracle folder and all old contracts

* Fix config manager import ref

* Remove base contract

* Refactor event factory

* Update libs

* Add token fallback to event factory

* Change whitelist logic for adding new

* Call add to whitelist when creating event

* Change hex for create event

* Implement withdraw logic in factory

* Change all uint256 to uint

* Add event round to all necessary events

* Add storage for all totals and result totals

* Fix logic for calculate winnings

* Add require messages to all contracts

* Remove token tests and mock token classes

* Remove old truffle config and fix finalize check

* Fix syntax errors

* Use abi.decode for event token fallback and remove unused byte utils

* Fix most remaining compile errors

* Fix init event round logic

* Fix stack too deep

* Rearrange order

* Add data length check for token fallback

* Add data len check for event factory

* Add missing view visibility to get next threshold

* Inline ready to withdraw modifier and add another rrequire

* Remove qweb3 from modules

* Remove status enum

* Remove final result set event

* Fix uint8 ref and make version getter pure

* Add comments to all event factory methods

* Refactor most of before each for tests

* Start with dpeloyment of contracts

* Add logic to construct event params

* Add config mgr methods var

* Convert name back to bytes32 arr

* Fix slice bytes for params

* Change event name back to string type

* Finish reading events and create new event instance

* Finish constructor init tet

* Refactor reusuable create event func and add test

* Finish remaining constructor tests

* Remove old constants

* Fix fallback func and remove bluebird

* Add bet test

* Cleanup syntax

* Add logs

* Change bet to use token fallback

* Change calculate winnings logic

* Adjust withdraw method and event

* Fix syntax errors

* Remove fallback function test

* Add event address to winnings withdrawn

* Add getters for threshold and arbitration time

* Remove assert from length for tokenFallback

* Add address param for did withdraw

* Add bet placed emit on result set
  • Loading branch information
dwalintukan committed May 17, 2019
1 parent 4662af3 commit 5b6a1fe
Show file tree
Hide file tree
Showing 58 changed files with 3,941 additions and 5,847 deletions.
225 changes: 117 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,60 @@
# Created by https://www.gitignore.io/api/node,macos,linux,windows,solidity,soliditytruffle
# Created by https://www.gitignore.io/api/node,linux,macos,windows,solidity,soliditytruffle,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,solidity,soliditytruffle,visualstudiocode

### Solidity ###
### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
Expand All @@ -23,7 +71,7 @@ coverage
# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
Expand Down Expand Up @@ -59,6 +107,7 @@ typings/

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand All @@ -73,162 +122,122 @@ typings/
.vuepress/dist

# Serverless directories
.serverless
.serverless/

### SolidityTruffle ###
# depedencies
node_modules

# testing
coverage

# production
build
build_webpack
# FuseBox cache
.fusebox/

# misc
.DS_Store
.env
npm-debug.log
.truffle-solidity-loader
.vagrant/**
blockchain/geth/**
blockchain/keystore/**
blockchain/history

#truffle
.tern-port
yarn.lock
package-lock.json

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon
# DynamoDB Local files
.dynamodb/

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
### Solidity ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Compiled binary addons (https://nodejs.org/api/addons.html)

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/
# TypeScript v1 declaration files

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# parcel-bundler cache (https://parceljs.org/)

# next.js build output

# nuxt.js build output

# vuepress build output

# Serverless directories

# FuseBox cache

# DynamoDB Local files

### SolidityTruffle ###
# depedencies
node_modules

# testing

# production
build
build_webpack

# misc
npm-debug.log
.truffle-solidity-loader
.vagrant/**
blockchain/geth/**
blockchain/keystore/**
blockchain/history

#truffle
.tern-port
yarn.lock
package-lock.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history

### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
Desktop.ini
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,macos,linux,windows,solidity

### Compiled
build/
installed_contracts/

### Dotenv
.env
# End of https://www.gitignore.io/api/node,linux,macos,windows,solidity,soliditytruffle,visualstudiocode
Empty file removed .node-xmlhttprequest-sync-2317
Empty file.
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# ethereum
# Bodhi Prediction Market for Nakachain
Loading

0 comments on commit 5b6a1fe

Please sign in to comment.