Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"42":{"fakeUSDT":"0x9a90c5f52642a60266d14708bbb880137c62cf4d","derivaDEXToken":"0xbdb154a3c2abd40b2f66a74c7afc49ded904cef9","derivaDEX":"0x09ea2fdfad884c43529b4637dd102fa2ae686834"},"1337":{"derivaDEX":"0x25b8fe1de9daf8ba351890744ff28cf7dfa8f5e3","governance":"0x48bacb9266a570d521063ef5dd96e61686dbe788","timelock":"0x0b1ba0af832d7c05fd64161e0db78e85978e8082","insuranceFund":"0x34d402f14d58e001d8efbe6585051bf9706aa064","ddx":"0x1dc4c1cefef38a777b15aa20260a54e584b16c48"}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Imports - React | |
import React, { Component } from 'react'; | |
// Imports - Redux | |
import { connect } from 'react-redux'; | |
import { Field, reduxForm } from 'redux-form'; | |
// Imports - Frameworks (Semantic-UI and Material-UI) | |
import { Message } from "semantic-ui-react"; | |
import Grid from '@material-ui/core/Grid'; | |
import Button from '@material-ui/core/Button'; | |
import FormControl from "@material-ui/core/FormControl/FormControl"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Imports - React | |
import React, { Component } from "react"; | |
// Imports - Redux | |
import connect from "react-redux/es/connect/connect"; | |
// Imports - Frameworks (Semantic-UI and Material-UI) | |
import { Container, Message } from "semantic-ui-react"; | |
import Paper from "@material-ui/core/Paper"; | |
import { withStyles } from "@material-ui/core"; | |
// Imports - Initialize Enigma | |
import getEnigmaInit from "../utils/getEnigmaInit.js"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers} from 'redux'; | |
import { reducer as formReducer } from 'redux-form'; | |
// Responds to initializeEnigma action to save enigma-js client library object | |
const initializeEnigmaReducer = (enigma = null, action) => { | |
if (action.type === 'ENIGMA_INITIALIZED') { | |
return action.payload; | |
} | |
return enigma; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Redux action for when enigma-js client library has been initialized | |
export const initializeEnigma = (enigma) => { | |
return { | |
type: 'ENIGMA_INITIALIZED', | |
payload: enigma | |
}; | |
}; | |
// Redux action for when web3 accounts have been initialized | |
export const initializeAccounts = (accounts) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const dotenv = require('dotenv'); | |
const {Enigma, utils, eeConstants} = require('enigma-js/node'); | |
var EnigmaContract; | |
if(typeof process.env.SGX_MODE === 'undefined' || (process.env.SGX_MODE != 'SW' && process.env.SGX_MODE != 'HW' )) { | |
console.log(`Error reading ".env" file, aborting....`); | |
process.exit(); | |
} else if (process.env.SGX_MODE == 'SW') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Built-In Attributes | |
#![no_std] | |
// Imports | |
extern crate eng_wasm; | |
extern crate eng_wasm_derive; | |
extern crate serde; | |
use eng_wasm::*; | |
use eng_wasm_derive::pub_interface; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// onChange listener to trigger enigma task when poll has ended | |
async handleTimerEnd(pollID) { | |
const { polls } = this.state; | |
await this.enigmaTask(pollID); | |
const pollStatusUpdateEvent = this.props.voting.PollStatusUpdate(); | |
pollStatusUpdateEvent.watch(async (error, result) => { | |
let pollStatus = await this.props.voting.getPollStatus.call(pollID, { | |
from: this.props.enigmaSetup.accounts[this.props.curAccount], | |
gas: GAS | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Specify signatures of callable/callback functions (with no spaces!) | |
const CALLABLE = "countVotes(uint,uint[],uint[])"; | |
const CALLBACK = "updatePollStatus(uint,uint,uint)"; | |
async enigmaTask(pollID) { | |
let poll = await this.props.voting.polls.call(pollID, { | |
from: this.props.enigmaSetup.accounts[this.props.curAccount], | |
gas: GAS | |
}); | |
let pollCreator = poll[0]; |
NewerOlder