├── .gitignore
├── LICENSE
├── README.md
├── client
├── .gitignore
├── README.md
├── attach.sh
├── clevis.json
├── contracts.clevis
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ ├── manifest.json
│ └── semanticStylesheet.css.old
├── readme-resources
│ ├── clamp.png
│ ├── clevis-explainer
│ ├── compile-deploy.png
│ ├── eth.png
│ ├── ganache-cli.png
│ ├── ganache.png
│ ├── gas.png
│ ├── mocha.png
│ ├── solidity.png
│ ├── title-graphic.png
│ └── wallet.png
├── run.sh
├── src
│ ├── App.css
│ ├── App.js
│ ├── App.test.js
│ ├── assets
│ │ ├── arrow-left.png
│ │ ├── arrow-right.png
│ │ ├── castle.png
│ │ ├── chelsea-hello.png
│ │ ├── chisel-process.png
│ │ ├── clock.png
│ │ ├── cloud.png
│ │ ├── copy.png
│ │ ├── details.png
│ │ ├── ethereum-small.png
│ │ ├── github.png
│ │ ├── instructions.png
│ │ ├── market.png
│ │ ├── pen.png
│ │ ├── question.png
│ │ ├── shield.png
│ │ ├── tablet.png
│ │ ├── tent.png
│ │ ├── treasure.png
│ │ ├── twitter.png
│ │ └── user.png
│ ├── components
│ │ ├── ContractLoaderCustom.js
│ │ ├── DapparatusCustom.js
│ │ ├── Navigation.js
│ │ ├── assets
│ │ │ ├── erc20.png
│ │ │ ├── eth.png
│ │ │ ├── ethereum.png
│ │ │ └── metamask.png
│ │ ├── button.js
│ │ ├── dapparatus.css
│ │ ├── scaler.js
│ │ └── transactionsCustom.js
│ ├── ethereum
│ │ ├── registry.json
│ │ ├── sampleABI1.json
│ │ ├── sampleABI2.json
│ │ ├── sampleABI3.json
│ │ ├── sampleABIOpenTriviaFactory.json
│ │ ├── sampleABIOpenTriviaGame.json
│ │ ├── troubleshooting.json
│ │ ├── troubleshootingFunctions.json
│ │ ├── troubleshootingviews.json
│ │ └── web3.js
│ ├── index.css
│ ├── index.js
│ ├── playground.js
│ └── registerServiceWorker.js
├── stop.sh
├── tests
│ ├── clevis.js
│ ├── compile.js
│ ├── deploy.js
│ ├── fast.js
│ ├── full.js
│ ├── metamask.js
│ ├── publish.js
│ └── version.js
└── yarn.lock
├── db
└── mongoose.js
├── models
├── contract.js
└── user.js
├── notes.md
├── package.json
├── playgroundserver.js
├── readme-assets
├── chelsea-hello.png
├── chisel-process.png
├── create.png
├── dapp.png
├── details.png
├── instructions.png
└── security.png
├── screengrab.png
├── server.js
├── start-client.js
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | /myNotes
2 |
3 | # dependencies
4 | /node_modules
5 | /client/node_modules
6 | package-lock.json
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | build/
13 | client/build/
14 | # misc
15 | .env
16 | .DS_Store
17 | .env.local
18 | .env.development.local
19 | .env.test.local
20 | .env.production.local
21 |
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
26 | config.js
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Patrick Gallagher
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | One Click dApp
4 |
5 |
6 | Instantly build a dApp with a simple URL to bookmark or share with a friend.:zap::wrench::link: :shipit:
7 |
8 |
9 |
10 |
11 | Shareable dApps are a click away at http://oneclickdapp.com
12 |
13 | ## Problem
14 |
15 | You created a smart contract...now what?
16 |
17 | **There is no easy way to share a smart contract interface!**
18 |
19 | The goal of this project is to make it easier to interact with smart contracts. OneClickDapp instantly builds you a dApp with a simple URL to bookmark or share with a friend. Anyone with the dApp URL can interact with _your shiny new smart contract_, and access all functions at the correct address/network. Don't write a single line of front-end code. Forget about verifying your contract on Etherscan or MEW. Your dApp is just one click away!
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | ## Features Completed
28 |
29 | :white_check_mark: Custom dApp URL e.g. http://oneclickdapp.com/garcia-erosion
30 |
31 | :white_check_mark: Recent public history of dApps
32 |
33 | :white_check_mark: Auto-save your dApps using wallet address
34 |
35 | :white_check_mark: Clone an existing dApp (sources available: [MEW ethereum-lists](https://github.com/MyEtherWallet/ethereum-lists))
36 |
37 | :white_check_mark: In-page wallet for new ethereum users
38 |
39 | :white_check_mark: Twitter share Button
40 |
41 | :white_check_mark: Medieval stone-sculpting theme
42 |
43 |
44 |
45 | ## Planned
46 |
47 | - Ganache forking to emulate any mainnet dApp
48 | - IPFS for saving dApps
49 | - Custom ENS domains e.g., "myDapp.oneclickdapp.ETH"
50 | - Full decentralization for permanence and security
51 | - "Copy the code" button to build your own React app
52 | - Display Events and Transactions using Dapparatus
53 |
54 | ## Run the app locally
55 |
56 | 1. Run `npm install` in both root directory, and in `/client`
57 | 2. Create `config.js` in `./db/` and enter your mongoDB URL
58 | > process.env.MONGODB_URI = "mongodb://..."
59 | 3. cd to root directory and run `npm start`
60 |
61 | ## Contributions welcome!
62 |
63 | This tool is primarily maintained by a single person. It is self-funded and free to use.
64 |
65 | Please consider helping by submitting an issue or PR.
66 |
67 | ## Check out my other free blockchain resources
68 |
69 | - [Walrus Paper Wallet Generator](https://github.com/blockchainbuddha/Walrus-Paper-Wallet-Generator)- Print hundreds of paper wallets quickly.
70 | - [Smart Contract Troubleshooter](https://github.com/blockchainbuddha/Solidity-Troubleshooting-Guide)- A quick checklist to prevent ripping out your hair.
71 | - [Patrick's blockchain resources](https://github.com/blockchainbuddha/Intro-to-Blockchain)- If I taught it, you can find it here.
72 |
73 | ## Contact
74 |
75 | [Patrick](https://twitter.com/pi0neerpat),
76 | [Joseph](https://twitter.com/cupojoseph)
77 |
--------------------------------------------------------------------------------
/client/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | node_modules
5 |
6 | # testing
7 | coverage
8 | <<<<<<< HEAD
9 | build/
10 | =======
11 | /build/*
12 | /build
13 | /build/
14 | >>>>>>> productionBuild
15 | # misc
16 | .DS_Store
17 | .env
18 | npm-debug.log
19 | src/contracts/*
20 | deploy.network
21 | aws.json
22 | backend/redisdata
23 | accounts.json
24 | **.DS_*
25 | openzeppelin-solidity
26 | zeppelin-solidity
27 | package-lock.json
28 | *.log
29 | *.ens
30 | */*/*.abi
31 | */*/*.bytecode
32 | */*/*.address
33 | */*/*.run.xml
34 | */*/*.log.*
35 | */*/*.blockNumber
36 | */*.abi
37 | */*.bytecode
38 | */*.bib
39 | */*.address
40 | */*.run.xml
41 | */*.log.*
42 | */*.blockNumber
43 | */.clevis
44 | */*/.clevis
45 | */node_modules
46 | /node_modules
47 | public/reload.txt
48 |
49 | **/*.blockNumber
50 | **/*.head.address
51 | **/*.previous.address
52 | **/*.compiled
53 | **/*.bytecode
54 | **/*.abi
55 | **/*.address
56 | src/contracts
57 | deploy.log
58 | public/reload.txt
59 | geth.log
60 | react.log
61 |
--------------------------------------------------------------------------------
/client/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | # Creating a new **️Clevis** project:
5 |
6 | _Target audience:_ You've written and deployed several smart contracts using [Remix](remix.ethereum.org). Now you need a robust development environment with automated testing tools, and an easy-to-use command line interface.
7 |
8 | ## Install Clevis
9 |
10 | 0. Requirements: Install npm and node.js (see https://docs.npmjs.com/getting-started/installing-node).
11 |
12 | 1. Download and create a binary of Clevis
13 |
14 | ```
15 | git clone https://github.com/austintgriffith/clevis
16 | cd clevis
17 | npm install
18 | sudo npm link
19 | ```
20 |
21 | 2. Navigate to a new project folder, then
22 |
23 | ```
24 | npm link clevis
25 | clevis init
26 | ```
27 |
28 | (You may have to enter root password during this process.)
29 |
30 | 3. Check your web3 version, and be sure you are using the correct documentation for web3 ([learn more](https://github.com/blockchainbuddha/Intro-to-Blockchain#using-web3))
31 |
32 | ```
33 | clevis version
34 | ```
35 |
36 | 4. Test out a command.
37 |
38 | ```
39 | clevis sha3 "Hello World"
40 | >> SHA3
41 | >> 0x592fa743889fc7f92ac2a37bb1f5ba1daf2a5c84741ca0e0061d243a2e6707ba
42 | ```
43 |
44 | Great job!
45 |
46 | ## Set up a local Ethereum network
47 |
48 | 5. Instead of developing on the main Ethereum network, or a test-network, we will install Ganache-CLI to run a local instance, as well as a JavaScript test framework tool called mocha .
49 |
50 | ```JavaScript
51 | npm install -g ganache-cli mocha
52 | ```
53 |
54 | > Ganache allows us to process transactions :zap: instantly! Pretty sweet right?
55 |
56 | 6. In a **new terminal**
57 |
58 | ```
59 | ganache-cli
60 | >> ... // (lots of stuff here)
61 | >> Listening on 127.0.0.1:8545
62 | ```
63 |
64 | This starts a local instance of the Ethereum Virtual Machine (EVM). Ganache-CLI also creates a new wallet with multiple ethereum "accounts" (0xab23f...) and each are funded with 100 ETH. If you get stuck using Ganache-CLI [read the docs](https://github.com/trufflesuite/ganache-cli/blob/master/README.md).
65 |
66 | > _Go forth and make mistakes_! Ganache-CLI is merely an instanceof the EVM, and is _only running on your machine_.
67 |
68 | Here's how our set-up looks so far.
69 |
70 |
71 |
72 |
73 | 7. Lets ensure Clevis can talk with Ganache-CLI by asking for your wallet accounts.
74 |
75 | ```javascript
76 | clevis accounts
77 | >> Reading Accounts...
78 | >> ['0xf2A0DD5999c23f53fE8819CBbc06d2e2B05b9093',
79 | >> '0x25a62dE56EF4fe5882336b05AbF202d1375272dD',
80 | >> '0x367347648F02A6c6e0f5126185652332e91f2d00',
81 | >> '0x5aB26450D93Bd70c66CD575e47B4c72E91df876B',...
82 | ```
83 |
84 | Now make a transaction by sending `0.2 ETH` from account 0 to account 1. The proper syntax is
85 |
86 | #### clevis send [amount][fromindex] [toindex]
87 |
88 | ```javascript
89 | clevis send 0.2 0 1
90 | ```
91 |
92 | This is a good spot to try out some other commands. See the full list with
93 |
94 | ```javascript
95 | clevis help
96 | ```
97 |
98 | Excellent work so far!
99 |
100 | ## Ceate your Solidity contract
101 |
102 | > Note: these are usually referred to as "Smart Contracts." However they are neither smart, nor a contract. Can you think of a better term?
103 |
104 | 8. Create a new contract
105 |
106 | ```javascript
107 | clevis create Name
108 | ```
109 |
110 | Lets take a look at our project directory now
111 |
112 | ```java
113 | myproject
114 | │ accounts.json // Wallet accounts from Ganache-CLI (clevis accounts)
115 | │ clevis.json // Config. for network, gas price etc.
116 | │ contracts.clevis // Tracks contracts
117 | │ ...
118 | │
119 | └───contracts
120 | │ └───Name // Each contract has a folder
121 | │ │ arguments.js // Constructor arguments when deploying
122 | │ │ dependencies.js // Imports other contracts
123 | │ │ Name.sol
124 | │
125 | └───openzeppelin-solidity // Commonly used contracts
126 | └───src // Our application lives here
127 | └───tests // Useful test scripts
128 | ```
129 |
130 | 9. Paste in the example code:
131 |
132 | ```solidity
133 | pragma solidity ^0.4.24;
134 |
135 | import 'openzeppelin-solidity/contracts/ownership/Ownable.sol';
136 |
137 | contract Name is Ownable{
138 | string public name;
139 |
140 | constructor(string _name) public {
141 | name = _name;
142 | }
143 |
144 | function setName(string _name) onlyOwner public returns (bool){
145 | name = _name;
146 | return true;
147 | }
148 | }
149 | ```
150 |
151 | 10. Since we are importing a contract from the OpenZeppelin-Solidity, we must modify `dependencies.js` so the compiler will know where to look:
152 |
153 | ```js
154 | const fs = require('fs');
155 | module.exports = {
156 | 'openzeppelin-solidity/contracts/ownership/Ownable.sol': fs.readFileSync(
157 | 'openzeppelin-solidity/contracts/ownership/Ownable.sol',
158 | 'utf8'
159 | )
160 | };
161 | ```
162 |
163 | Our contract requires one argument when it's deployed. This is provided in `arguments.js`
164 |
165 | ```js
166 | module.exports = ['Hello world'];
167 | ```
168 |
169 | 11. Compile
170 |
171 | ```js
172 | clevis compile Name
173 | ```
174 |
175 | We now have some some new files in the contract folder
176 |
177 | ```java
178 | myproject
179 | └───contracts
180 | │ └───Name
181 | │ │ Name.sol
182 | │ │ ...
183 | | │ Name.abi // Application binary interface
184 | │ │ Name.bytecode // Bytecode for submitting to Ganache-CLI
185 | │ │ Name.compiled // Compiled contract + imported contracts
186 | │ │
187 | │ └───.clevis // Auto-generated test commands
188 | │ | eventOwnershipRenounced.js
189 | │ | setName.js
190 | │ | transferOwnership.js
191 | │ | ...
192 | │ ...
193 | ```
194 |
195 | ## Deploy your contract to Ganache-CLI
196 |
197 | 12. Deploy from account 0 using this syntax
198 |
199 | #### clevis deploy [contractname][accountindex]
200 |
201 | ```js
202 | clevis deploy Name 0
203 | ```
204 |
205 | Notice even more new files in our contract folder.
206 |
207 | ```java
208 | myproject
209 | └───contracts
210 | │ └───Name
211 | │ │ Name.sol
212 | │ │ ...
213 | │ │ Name.address // Contract address on the Ganache-CLI network
214 | │ │ Name.blockNumber // Block number where contract was deployed
215 | │ │ Name.head.address // ???
216 | │ │ ...
217 | │ ...
218 | ```
219 |
220 | Let's review what just happened. During compilation, Clevis compiled our contract and arguments into bytecode, which is ready to be submitted to our Ganache-CLI blockchain. We also generated the contract Abi (Application binary interface) and some useful test scripts in the `.clevis` folder, whcih will allow us to communicate with our deployed contract.
221 |
222 |
223 |
224 |
225 | 13. Let's try a test script now. Use the script `name` to get the value of `name` from your contract. Use this syntax:
226 |
227 | #### clevis contract [scriptname][contractname] [[accountIndex]] [[contractArguments...]]
228 |
229 | ```javascript
230 | clevis contract name Name
231 | >> CONTRACT
232 | >> //...(tons of useful information)
233 | >> Hello world
234 | ```
235 |
236 | Awesome! We can now request information from our smart contract. This was a simple ".call()" function, which doesn't take arguments. Call functions don't require a gas transaction fee, so we didn't need to specify an account.
237 | Here is the code that Clevis just ran for us:
238 |
239 | ```javascript
240 | // Load dependencies for talking to Ganache-CLI using Web3
241 | const ganache = require("ganache-cli");
242 | const Web3 = require("web3");
243 | // Get information about our deployed contract
244 | const contractInterface = require("./contracts/Name/Name.abi");
245 | const contractAddress = require("./contracts/Name/Name.compiled");
246 | // Instantiate web3 object
247 | const web3 = new Web3(ganache.provider({ port: "127.0.0.1:8545" }));
248 | // Instantiate contract object at the correct address
249 | const name = await new web3.eth.Contract(contractInterface, contractAddress);
250 | // Finally, query our deployed Name contract using ".call()"
251 | const response = await contract.methods.name().call();
252 | console.log(response);
253 | ```
254 |
255 | Good thing you didn't need to write that!
256 |
257 | 14. Now lets make a transaction that Δ changes the state of the contact, which will require a gas transaction fee. We will need to specify an account in our wallet. Let's use the `setName` function by calling the appropriate Clevis test script.
258 |
259 | ```javascript
260 | clevis contract setName Name 0 "My new name"
261 | >>
262 | >> transactionHash:0x656600d6db9aa7fb814662c41657abe43074dc05b7bbb66edec5a6736c4e49b1
263 | >> { transactionHash: '0x656600d6db9aa7fb814662c41657abe43074dc05b7bbb66edec5a6736c4e49b1',
264 | >> transactionIndex: 0,
265 | >> blockHash: '0xa2918570f31743aaba0fd097dc0bed1fef0a311ee0d59a1d006b6578d5a27fb9',
266 | >> blockNumber: 7,
267 | >> gasUsed: 34010,
268 | >> cumulativeGasUsed: 34010,
269 | >> contractAddress: null,
270 | >> logs: [],
271 | >> status: true,
272 | >> ...
273 | ```
274 |
275 | If you're successful, you'll see a transaction hash (think of as a receipt), and `status: true`.
276 | Clevis just ran all the code from the previous step, except instead of `contract.methods.name().call()`, it ran the following.
277 |
278 | ```javascript
279 | const accounts = await web3.eth.getAccounts();
280 | await name.methods.setName("My new name").send({
281 | from: accounts[0],
282 | gas: 1300000
283 | });
284 | ```
285 |
286 | Remember that ".call()" functions do not require gas, and simply read the current state. However ".send()" functions modify the state of the contract, therefore we must specify an account to pay the gas transaction fee.
287 |
288 | #### Congratulations! we now know how to create a new contract using Clevis, and how to read and write using the `clevis contract` commands. Next up is building out the front-end.
289 |
290 | ## Front-end Coming soon!
291 |
--------------------------------------------------------------------------------
/client/attach.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker exec -ti clevis bash
3 |
--------------------------------------------------------------------------------
/client/clevis.json:
--------------------------------------------------------------------------------
1 | {
2 | "provider": "http://localhost:8545",
3 | "gasprice": 10.9,
4 | "ethprice": 184.328460411,
5 | "deploygas": 5500000,
6 | "xfergas": 1300000,
7 | "DEBUG": true,
8 | "USE_INFURA": false,
9 | "ROOT_FOLDER": "/home/thisguy/repos/one-click-DApps/client",
10 | "CRA_FOLDER": "./src",
11 | "TESTS_FOLDER": "tests",
12 | "CONTRACTS_FOLDER": "./src/contracts"
13 | }
14 |
--------------------------------------------------------------------------------
/client/contracts.clevis:
--------------------------------------------------------------------------------
1 | splitter
2 |
--------------------------------------------------------------------------------
/client/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "client",
3 | "version": "0.0.1",
4 | "homepage": "http://oneclickdapp.com",
5 | "private": true,
6 | "proxy": "http://localhost:3001/",
7 | "dependencies": {
8 | "axios": "^0.18.0",
9 | "clevis": "0.0.104",
10 | "dapparatus": "^1.0.42",
11 | "deepmerge": "^2.2.1",
12 | "ethereum-ens": "^0.7.4",
13 | "lodash": "^4.17.11",
14 | "prop-types": "^15.6.2",
15 | "react": "^16.5.0",
16 | "react-blockies": "^1.4.0",
17 | "react-cookies": "^0.1.0",
18 | "react-scripts": "1.1.5",
19 | "react-share": "^2.3.1",
20 | "semantic-ui-react": "^0.82.4",
21 | "solc": "^0.5.0",
22 | "web3": "^1.0.0-beta.26"
23 | },
24 | "scripts": {
25 | "start": "react-scripts start",
26 | "build": "react-scripts build",
27 | "test": "react-scripts test --env=jsdom",
28 | "eject": "react-scripts eject"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/client/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/public/favicon.ico
--------------------------------------------------------------------------------
/client/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | OneClickdApp.com
12 |
13 |
14 |
18 |
19 |
20 |
21 |
35 |
36 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/client/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "OneClickdApp",
3 | "name": "One Click dApp",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": "./index.html",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#606060"
15 | }
16 |
--------------------------------------------------------------------------------
/client/readme-resources/clamp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/clamp.png
--------------------------------------------------------------------------------
/client/readme-resources/clevis-explainer:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/clevis-explainer
--------------------------------------------------------------------------------
/client/readme-resources/compile-deploy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/compile-deploy.png
--------------------------------------------------------------------------------
/client/readme-resources/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/eth.png
--------------------------------------------------------------------------------
/client/readme-resources/ganache-cli.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/ganache-cli.png
--------------------------------------------------------------------------------
/client/readme-resources/ganache.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/ganache.png
--------------------------------------------------------------------------------
/client/readme-resources/gas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/gas.png
--------------------------------------------------------------------------------
/client/readme-resources/mocha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/mocha.png
--------------------------------------------------------------------------------
/client/readme-resources/solidity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/solidity.png
--------------------------------------------------------------------------------
/client/readme-resources/title-graphic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/title-graphic.png
--------------------------------------------------------------------------------
/client/readme-resources/wallet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/readme-resources/wallet.png
--------------------------------------------------------------------------------
/client/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker run -ti --rm --name clevis -p 3000:3000 -p 8545:8545 -v ${PWD}:/dapp austingriffith/clevis
3 |
--------------------------------------------------------------------------------
/client/src/App.css:
--------------------------------------------------------------------------------
1 | .App {
2 | text-align: center;
3 | }
4 |
5 | .App-logo {
6 | animation: App-logo-spin infinite 20s linear;
7 | height: 80px;
8 | }
9 |
10 | .App-header {
11 | background-color: #fff;
12 | height: 55px;
13 | padding: 20px;
14 | color: black;
15 | }
16 |
17 | .App-title {
18 | font-size: 1.5em;
19 | }
20 |
21 | .App-intro {
22 | font-size: large;
23 | }
24 |
25 | @keyframes App-logo-spin {
26 | from {
27 | transform: rotate(0deg);
28 | }
29 | to {
30 | transform: rotate(360deg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/client/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render( , div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/client/src/assets/arrow-left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/arrow-left.png
--------------------------------------------------------------------------------
/client/src/assets/arrow-right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/arrow-right.png
--------------------------------------------------------------------------------
/client/src/assets/castle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/castle.png
--------------------------------------------------------------------------------
/client/src/assets/chelsea-hello.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/chelsea-hello.png
--------------------------------------------------------------------------------
/client/src/assets/chisel-process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/chisel-process.png
--------------------------------------------------------------------------------
/client/src/assets/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/clock.png
--------------------------------------------------------------------------------
/client/src/assets/cloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/cloud.png
--------------------------------------------------------------------------------
/client/src/assets/copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/copy.png
--------------------------------------------------------------------------------
/client/src/assets/details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/details.png
--------------------------------------------------------------------------------
/client/src/assets/ethereum-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/ethereum-small.png
--------------------------------------------------------------------------------
/client/src/assets/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/github.png
--------------------------------------------------------------------------------
/client/src/assets/instructions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/instructions.png
--------------------------------------------------------------------------------
/client/src/assets/market.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/market.png
--------------------------------------------------------------------------------
/client/src/assets/pen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/pen.png
--------------------------------------------------------------------------------
/client/src/assets/question.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/question.png
--------------------------------------------------------------------------------
/client/src/assets/shield.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/shield.png
--------------------------------------------------------------------------------
/client/src/assets/tablet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/tablet.png
--------------------------------------------------------------------------------
/client/src/assets/tent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/tent.png
--------------------------------------------------------------------------------
/client/src/assets/treasure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/treasure.png
--------------------------------------------------------------------------------
/client/src/assets/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/twitter.png
--------------------------------------------------------------------------------
/client/src/assets/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/assets/user.png
--------------------------------------------------------------------------------
/client/src/components/ContractLoaderCustom.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import deepmerge from 'deepmerge';
3 | let defaultConfig = {};
4 | defaultConfig.DEBUG = true;
5 | defaultConfig.hide = true;
6 | class ContractLoaderCustom extends Component {
7 | constructor(props) {
8 | super(props);
9 | let config = defaultConfig;
10 | if (props.config) {
11 | config = deepmerge(config, props.config);
12 | }
13 | this.state = {
14 | config: config,
15 | contracts: {}
16 | };
17 | }
18 | contractLoader() {
19 | let { DEBUG } = this.state.config;
20 | let resultingContract;
21 | const contractName = this.props.contractName;
22 | const contractAddress = this.props.address;
23 | const contractAbi = this.props.abi;
24 | try {
25 | let contractObject = {
26 | address: contractAddress,
27 | abi: JSON.parse(contractAbi),
28 | blocknumber: 0
29 | };
30 | if (DEBUG)
31 | console.log(
32 | 'ContractLoaderCustom - Loading ',
33 | contractName,
34 | contractObject
35 | );
36 | let contract = new this.props.web3.eth.Contract(
37 | contractObject.abi,
38 | contractObject.address
39 | );
40 | resultingContract = contract.methods;
41 | resultingContract._blocknumber = contractObject.blocknumber;
42 | resultingContract._address = contractObject.address;
43 | resultingContract._abi = contractObject.abi;
44 | resultingContract._contract = contract;
45 | } catch (e) {
46 | console.log('ERROR LOADING CONTRACT ' + contractName, e);
47 | }
48 | return resultingContract;
49 | }
50 | componentDidMount() {
51 | let { DEBUG } = this.state.config;
52 | if (DEBUG) console.log('ContractLoaderCustom - Loading Contracts');
53 | let contracts = {};
54 | contracts[this.props.contractName] = this.contractLoader();
55 | this.setState({ contracts: contracts }, () => {
56 | this.props.onReady(this.state.contracts, this.contractLoader.bind(this));
57 | });
58 | }
59 | render() {
60 | if (this.state.config.hide) {
61 | return false;
62 | } else {
63 | let contractDisplay = [];
64 | if (this.state.contracts) {
65 | for (let c in this.state.contracts) {
66 | contractDisplay.push(
67 |
68 | {c} ({this.state.contracts[c]._address}) - #{
69 | this.state.contracts[c]._blocknumber
70 | }
71 |
72 | );
73 | }
74 | } else {
75 | contractDisplay = 'Loading...';
76 | }
77 | return (
78 |
79 | Contracts
80 | {contractDisplay}
81 |
82 | );
83 | }
84 | }
85 | }
86 | export default ContractLoaderCustom;
87 |
--------------------------------------------------------------------------------
/client/src/components/DapparatusCustom.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import cookie from 'react-cookies';
3 | import deepmerge from 'deepmerge';
4 | import logo from './assets/metamask.png';
5 | import eth from './assets/ethereum.png';
6 | import Scaler from './scaler.js';
7 | import Blockies from 'react-blockies';
8 | import ENS from 'ethereum-ens';
9 | import Web3 from 'web3';
10 | import Button from './button.js';
11 | const queryString = require('query-string');
12 |
13 | let interval;
14 | let defaultConfig = {};
15 | defaultConfig.DEBUG = false;
16 | defaultConfig.POLLINTERVAL = 777;
17 | defaultConfig.showBalance = true;
18 |
19 | //metatx
20 | defaultConfig.metatxAccountGenerator = '//account.metatx.io';
21 |
22 | defaultConfig.onlyShowBlockie = false
23 |
24 | defaultConfig.hideNetworks = ['Mainnet'];
25 | defaultConfig.accountCutoff = 16;
26 | defaultConfig.outerBoxStyle = {
27 | float: 'right'
28 | };
29 | defaultConfig.ETHPRECISION = 10000;
30 | defaultConfig.boxStyle = {
31 | paddingRight: 75,
32 | marginTop: 0,
33 | paddingTop: 0,
34 | zIndex: 10,
35 | textAlign: 'right',
36 | width: 300
37 | };
38 | defaultConfig.boxStyleBefore = {
39 | zIndex: 9999,
40 | marginTop: 3,
41 | paddingTop: 7,
42 | zIndex: 10,
43 | color: '#666666',
44 | textAlign: 'right',
45 | width: 450
46 | };
47 | defaultConfig.textStyle = {
48 | fontSize: 20,
49 | fontWeight: 'bold',
50 | color: '#666666'
51 | };
52 | defaultConfig.warningStyle = {
53 | fontWeight: 'bold',
54 | fontSize: 24
55 | };
56 | defaultConfig.blockieStyle = {
57 | size: 6,
58 | top: 10,
59 | right: 15
60 | };
61 | defaultConfig.requiredNetwork = [
62 | 'Mainnet',
63 | 'Unknown' //allow local RPC for testing
64 | ];
65 |
66 | let burnMetaAccount = ()=>{
67 | const expires = new Date();
68 | expires.setDate(expires.getDate()-1);
69 | cookie.save('metaPrivateKey', 0, {
70 | path: '/',
71 | expires: expires
72 | });
73 | setTimeout(()=>{
74 | window.location.reload(true);
75 | },300)
76 | }
77 |
78 | class DapparatusCustom extends Component {
79 | constructor(props) {
80 | super(props);
81 | let config = defaultConfig;
82 |
83 | if (props.config) {
84 | config = deepmerge(config, props.config);
85 | if (props.config.requiredNetwork && props.config.requiredNetwork[0] != "") {
86 | config.requiredNetwork = props.config.requiredNetwork;
87 | }
88 | }
89 | let queryParams = queryString.parse(window.location.search);
90 | let metaPrivateKey = cookie.load('metaPrivateKey');
91 | let metaAccount;
92 | let account = 0;
93 | if (metaPrivateKey) {
94 | let tempweb3 = new Web3();
95 | metaAccount = tempweb3.eth.accounts.privateKeyToAccount(metaPrivateKey);
96 | account = metaAccount.address.toLowerCase();
97 | } else if (queryParams.privateKey) {
98 | const expires = new Date();
99 | expires.setDate(expires.getDate() + 365);
100 | cookie.save('metaPrivateKey', queryParams.privateKey, {
101 | path: '/',
102 | expires
103 | });
104 | window.location = window.location.href.split('?')[0];
105 | }
106 |
107 | console.log('!!!!DAPPARATUS~~~~~ ', config);
108 |
109 | this.state = {
110 | status: 'loading',
111 | network: 0,
112 | account: account,
113 | etherscan: '',
114 | config: config,
115 | avgBlockTime: 15000,
116 | lastBlockTime: 0,
117 | metaAccount: metaAccount,
118 | burnMetaAccount: burnMetaAccount,
119 | web3Fellback: false,
120 | hasRequestedAccess: false
121 | };
122 | }
123 | componentDidUpdate() {
124 | if (this.props.config) {
125 | const requiredNetwork = this.props.config.requiredNetwork;
126 | let config = this.state.config;
127 | if (requiredNetwork && requiredNetwork[0] != "" && config.requiredNetwork != requiredNetwork){
128 | config.requiredNetwork = requiredNetwork;
129 | this.setState({config: config});
130 | }
131 | }
132 | }
133 | componentDidMount() {
134 | interval = setInterval(
135 | this.checkMetamask.bind(this),
136 | this.state.config.POLLINTERVAL
137 | );
138 | this.checkMetamask();
139 | }
140 | componentWillUnmount() {
141 | clearInterval(interval);
142 | }
143 | checkMetamask() {
144 | if (this.state.config.DEBUG) console.log('DAPPARATUS - checking state...');
145 | if (typeof window.web3 == 'undefined') {
146 | console.log('Connecting to infura...');
147 | window.web3 = new Web3(this.props.fallbackWeb3Provider); //CORS ISSUES!//
148 | this.setState({ web3Fellback: true });
149 | //window.web3 = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws'))
150 | }
151 |
152 | if (typeof window.web3 == 'undefined') {
153 | if (this.state.config.DEBUG) console.log('DAPPARATUS - no web3');
154 | if (this.state.status == 'loading') {
155 | this.setState({ status: 'noweb3' }, () => {
156 | this.props.onUpdate(this.state);
157 | });
158 | } else if (this.state.status != 'noweb3') {
159 | if (this.state.config.DEBUG) console.log('DAPPARATUS - lost web3');
160 | window.location.reload(true);
161 | this.setState({ status: 'error' }, () => {
162 | this.props.onUpdate(this.state);
163 | });
164 | }
165 | } else {
166 | if (this.state.config.DEBUG) {
167 | console.log('DAPPARATUS - yes web 3', window.web3);
168 | }
169 | if (typeof window.web3.version.getNetwork != 'function') {
170 | window.window.web3.eth.net.getId((err, network) => {
171 | //console.log("NETWORK GETID",err,network)
172 | this.inspectNetwork(network);
173 | });
174 | } else {
175 | window.web3.version.getNetwork((err, network) => {
176 | this.inspectNetwork(network);
177 | });
178 | }
179 | }
180 | }
181 | inspectNetwork(network) {
182 | if (this.state.config.DEBUG) console.log('DAPPARATUS - network', network);
183 | let networkNumber = network
184 | network = translateNetwork(network);
185 | if(network=="Unknown"){
186 | if(window.web3 && window.web3.currentProvider && window.web3.currentProvider.host && window.web3.currentProvider.host.indexOf("dai.poa.network")){
187 | network="xDai"
188 | }else if(window.web3 && window.web3.currentProvider && window.web3.currentProvider.host && window.web3.currentProvider.host.indexOf("poa.network")){
189 | network="POA"
190 | }
191 | }
192 | if (this.state.config.DEBUG) console.log('DAPPARATUS - translated network', network);
193 | let accounts;
194 | try {
195 | if (this.state.config.DEBUG) console.log('DAPPARATUS - getting accounts...');
196 | window.web3.eth.getAccounts((err, _accounts) => {
197 | //console.log("ACCOUNTS",err,_accounts)
198 | if (!_accounts || _accounts.length <= 0 || this.state.web3Fellback) {
199 | if (!this.state.hasRequestedAccess) { // Prevent multiple prompts
200 | if (this.state.config.DEBUG) console.log('METAMASK - requesting access from user...');
201 | this.setState({ hasRequestedAccess: true},() => {
202 | this.props.onUpdate(this.state);
203 | });
204 | try{
205 | window.ethereum.enable().then(() => {
206 | window.location.reload(true);
207 | })
208 | } catch (e) {
209 | console.log(e);
210 | this.setState({ status: 'private', network: network },() => {
211 | this.props.onUpdate(this.state);
212 | });
213 | }
214 | }
215 | if (this.state.config.DEBUG) console.log('DAPPARATUS - no inject accounts - generate? ');
216 | if (!this.state.metaAccount || !this.state.metaAccount.address) {
217 | this.setState({ status: 'noaccount' }, () => {
218 | if (this.state.config.metatxAccountGenerator) {
219 | console.log('Connecting to ' + this.state.config.metatxAccountGenerator + '...');
220 | window.location = this.state.config.metatxAccountGenerator;
221 | } else {
222 | console.log("Generating account...")
223 | let result = window.web3.eth.accounts.create();
224 | //console.log("GENERATE",result)
225 | const expires = new Date();
226 | expires.setDate(expires.getDate() + 365);
227 | cookie.save('metaPrivateKey', result.privateKey, {
228 | path: '/',
229 | expires
230 | });
231 | setTimeout(()=>{
232 | window.location.reload(true);
233 | },300)
234 | this.setState({ metaAccount: result, account: result.address.toLowerCase(), burnMetaAccount:burnMetaAccount },()=>{
235 | this.props.onUpdate(this.state);
236 | });
237 | }
238 |
239 | });
240 | } else {
241 | let currentAccounts = [];
242 | //console.log("generated account",this.state.metaAccount)
243 | currentAccounts.push(this.state.metaAccount.address);
244 | //console.log("currentAccounts",currentAccounts)
245 | this.inspectAccounts(currentAccounts, network);
246 | }
247 | if(this.state.metaAccount){
248 | //console.log("metaAccount",this.state.metaAccount)
249 | this.loadBlockBalanceAndName(this.state.metaAccount.address, network);
250 | }else{
251 | //console.lob("no metaAccount")
252 | }
253 | } else {
254 | if (this.state.config.DEBUG)
255 | console.log('DAPPARATUS - injected account: ', _accounts);
256 | this.inspectAccounts(_accounts, network);
257 | this.setState({ metaAccount: false });
258 | }
259 | });
260 | } catch (e) {
261 | console.log(e);
262 | if (this.state.metamask != -1)
263 | this.setState({ metamask: -1, network: network, web3: web3 });
264 | }
265 | }
266 | inspectAccounts(currentAccounts, network) {
267 | if (this.state.config.DEBUG)
268 | console.log(
269 | 'DAPPARATUS - accounts:',
270 | currentAccounts,
271 | this.state.account
272 | );
273 | if (currentAccounts && this.state.account) {
274 | if (currentAccounts.length <= 0) {
275 | //window.location.reload(true);
276 | console.log('RELOAD BECAUSE LOST ACCOUNTS?');
277 | } else if (this.state.account != currentAccounts[0].toLowerCase()) {
278 | // window.location.reload(true);
279 | console.log('RELOAD BECAUSE DIFFERENT ACCOUNTS?');
280 | }
281 | }
282 | if (!currentAccounts) {
283 | if (this.state.status != 'error')
284 | this.setState({ status: 'error', network: network }, () => {
285 | this.props.onUpdate(this.state);
286 | });
287 | } else if (currentAccounts.length <= 0) {
288 | if (this.state.status != 'locked')
289 | this.setState({ status: 'locked', network: network }, () => {
290 | this.props.onUpdate(this.state);
291 | });
292 | } else {
293 | this.loadBlockBalanceAndName(currentAccounts[0].toLowerCase(), network);
294 | }
295 | }
296 | loadBlockBalanceAndName(account, network) {
297 |
298 | if (this.state.config.DEBUG) console.log("LOADING BALANCE...")
299 | window.web3.eth.getBlockNumber((err, block) => {
300 | if (this.state.config.DEBUG) console.log("BLOCK",err,block)
301 | window.web3.eth.getBalance('' + account, (err, balance, e) => {
302 | if (this.state.config.DEBUG) console.log("BALANCE",err,balance,e)
303 | if (typeof balance == 'string') {
304 | balance = parseFloat(balance) / 1000000000000000000;
305 | } else if (balance) {
306 | balance = balance.toNumber() / 1000000000000000000;
307 | }
308 | //if (this.state.config.DEBUG) console.log("Adjusted balance",balance)
309 | let etherscan = 'https://etherscan.io/';
310 | if (network) {
311 | if (network == 'Unknown' || network == 'private') {
312 | etherscan = 'http://localhost:8000/#/';
313 | } else if (network == 'POA') {
314 | etherscan = 'https://blockscout.com/poa/core/';
315 | } else if (network == 'xDai') {
316 | etherscan = 'https://blockscout.com/poa/dai/';
317 | } else if (network != 'Mainnet') {
318 | etherscan = 'https://' + network.toLowerCase() + '.etherscan.io/';
319 | }
320 | }
321 | if (this.state.config.DEBUG){
322 | console.log('DAPPARATUS - etherscan', etherscan);
323 | }
324 |
325 | if (
326 | this.state.status != 'ready' ||
327 | this.state.block != block ||
328 | this.state.balance != balance
329 | ) {
330 | web3 = new Web3(window.web3.currentProvider);
331 | let ens = new ENS(window.web3.currentProvider);
332 | if (this.state.config.DEBUG)
333 | console.log('attempting to ens reverse account....');
334 | try {
335 | var address = ens
336 | .reverse(account)
337 | .name()
338 | .catch(err => {
339 | if (this.state.config.DEBUG)
340 | console.log(
341 | 'catch ens error (probably just didn\'t find it, ignore silently)'
342 | );
343 | })
344 | .then(data => {
345 | console.log('ENS data', data);
346 | if (data) {
347 | this.setState({ ens: data }, () => {
348 | this.props.onUpdate(this.state);
349 | });
350 | }
351 | });
352 | } catch (e) {}
353 |
354 | console.log(
355 | 'Saving web3, generated account:',
356 | this.state.metaAccount,
357 | web3
358 | );
359 | let update = {
360 | status: 'ready',
361 | block: block,
362 | balance: balance,
363 | network: network,
364 | web3Provider: window.web3.currentProvider,
365 | etherscan: etherscan,
366 | account: account.toLowerCase(),
367 | metaAccount: this.state.metaAccount
368 | };
369 | if (block != this.state.block) {
370 | //block update
371 | if (this.state.lastBlockTime) {
372 | let timeItTook = Date.now() - this.state.lastBlockTime;
373 | update.avgBlockTime = Math.round(
374 | (this.state.avgBlockTime * 4) / 5 + timeItTook / 5
375 | );
376 | }
377 | update.lastBlockTime = Date.now();
378 | }
379 | this.setState(update, () => {
380 | this.props.onUpdate(this.state);
381 | });
382 | }
383 | });
384 | });
385 | }
386 | render() {
387 | let dapparatus = 'loading.';
388 | if (this.props.config.hide) {
389 | dapparatus = [];
390 | }
391 | else if (this.state.status == 'loading') {
392 | dapparatus = (
393 |
394 | loading...
395 |
399 |
400 | );
401 | } else if (this.state.status == 'noweb3') {
402 | dapparatus = (
403 |
404 | No Web3 Connection
405 |
409 |
410 | );
411 | } else if (this.state.status == 'noaccount') {
412 | let mmClick = () => {
413 | window.open('https://metamask.io', '_blank');
414 | };
415 | dapparatus = 'Generating Account...';
416 | } else if (this.state.status == 'locked') {
417 | dapparatus = (
418 |
419 |
420 | Please Unlock MetaMask
421 |
422 |
426 |
427 | );
428 | } else if (this.state.status == 'error') {
429 | dapparatus = (
430 |
431 |
Error Connecting
432 |
436 |
437 | );
438 | } else if (this.state.status == 'ready') {
439 | let requiredNetworkText = '';
440 | for (let n in this.state.config.requiredNetwork) {
441 | if (this.state.config.requiredNetwork[n] != 'Unknown' && this.state.config.requiredNetwork[n] != '') {
442 | if (requiredNetworkText != '') requiredNetworkText += 'or ';
443 | requiredNetworkText += this.state.config.requiredNetwork[n] + ' ';
444 | }
445 | }
446 | if (!this.state.metaAccount &&
447 | this.state.config.requiredNetwork &&
448 | this.state.config.requiredNetwork.indexOf(this.state.network) < 0
449 | ) {
450 | dapparatus = (
451 |
452 |
453 | Please switch network to {requiredNetworkText}
454 |
455 |
459 |
460 | );
461 | } else {
462 | let network = this.state.network;
463 | if (this.state.config.hideNetworks.indexOf(network) >= 0) network = '';
464 |
465 |
466 |
467 | let balance = '';
468 | if (this.state.config.showBalance) {
469 | balance =
470 | Math.round(this.state.balance * this.state.config.ETHPRECISION) /
471 | this.state.config.ETHPRECISION;
472 | }
473 |
474 | let displayName = this.state.account.substr(
475 | 0,
476 | this.state.config.accountCutoff
477 | );
478 | if (this.props.replaceName) {
479 | displayName = this.props.replaceName;
480 | } else if (this.state.ens) {
481 | displayName = this.state.ens;
482 | }
483 |
484 |
485 | let textDisplay = (
486 |
487 |
488 | {displayName}
489 |
490 |
491 |
492 | {network}{' '}
493 |
502 | {balance}
503 |
504 |
505 |
506 | )
507 |
508 | if(this.props.customContent){
509 | textDisplay = this.props.customContent()
510 | }
511 |
512 | if(this.state.config.onlyShowBlockie){
513 | textDisplay = (
514 |
515 |
516 |
517 | )
518 | }
519 |
520 | dapparatus = (
521 |
542 | );
543 | }
544 | } else {
545 | dapparatus = 'error unknown state: ' + this.state.status;
546 | }
547 | return (
548 |
549 |
550 | {dapparatus}
551 |
552 |
553 | );
554 | }
555 | }
556 | export default DapparatusCustom;
557 |
558 | function translateNetwork(network) {
559 | if (network == 5777) {
560 | return 'Private';
561 | } else if (network == 1) {
562 | return 'Mainnet';
563 | } else if (network == 2) {
564 | return 'Morden';
565 | } else if (network == 3) {
566 | return 'Ropsten';
567 | } else if (network == 4) {
568 | return 'Rinkeby';
569 | } else if (network == 42) {
570 | return 'Kovan';
571 | } else if (network == 99) {
572 | return 'POA';
573 | } else if (network == 100) {
574 | return 'xDai';
575 | } else {
576 | return 'Unknown';
577 | }
578 | }
579 |
--------------------------------------------------------------------------------
/client/src/components/Navigation.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Button, Image } from 'semantic-ui-react';
3 | const arrowLeft = require('../assets/arrow-left.png');
4 | const arrowRight = require('../assets/arrow-right.png');
5 |
6 | class Navigation extends Component {
7 | constructor(props) {
8 | super(props);
9 | let step = this.props.step;
10 | this.state = { step };
11 | }
12 | handleClick = () => {
13 | let newStep = this.state.step + (this.props.direction === 'left' ? -1 : 1);
14 | this.setState({ step: newStep }, () => {
15 | this.props.onUpdate(this.state);
16 | });
17 | };
18 | doNothing = () => {};
19 | render() {
20 | let style = {
21 | position: 'fixed',
22 | paddingTop: 30,
23 | marginBottom: 0,
24 | top: 100,
25 | left: 10,
26 | opacity: .75,
27 | zIndex: 10,
28 | paddingRight: 10
29 | };
30 | let image = arrowLeft;
31 | if (this.props.direction === 'right') {
32 | style.right = 10;
33 | style.left = null;
34 | image = arrowRight;
35 | }
36 | let onClick = this.handleClick;
37 | if (this.props.formSubmit) {
38 | onClick = this.doNothing;
39 | }
40 |
41 | return (
42 |
43 |
44 |
45 |
46 |
47 | );
48 | }
49 | }
50 | //
51 |
52 | export default Navigation;
53 |
--------------------------------------------------------------------------------
/client/src/components/assets/erc20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/components/assets/erc20.png
--------------------------------------------------------------------------------
/client/src/components/assets/eth.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/components/assets/eth.png
--------------------------------------------------------------------------------
/client/src/components/assets/ethereum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/components/assets/ethereum.png
--------------------------------------------------------------------------------
/client/src/components/assets/metamask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/client/src/components/assets/metamask.png
--------------------------------------------------------------------------------
/client/src/components/button.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import "./dapparatus.css"
3 |
4 | class Button extends Component {
5 | constructor(props) {
6 | super(props);
7 | this.state = {
8 | clicked:false
9 | }
10 | }
11 | click(){
12 | if(!this.state.clicked){
13 | this.setState({clicked:true})
14 | setTimeout(()=>{
15 | this.setState({clicked:false})
16 | },5000)
17 | this.props.onClick.apply( this, arguments );
18 | }
19 | }
20 | render(){
21 | let color = this.props.color
22 |
23 | if(!color || color=="blue"){
24 | color = "#6081c3"
25 | }else if(color=="green"){
26 | color = "#6ac360"
27 | }else if(color=="orange"){
28 | color = "#f7861c"
29 | }else if(color=="yellow"){
30 | color = "#f7ea1c"
31 | }else if(color=="red"){
32 | color = "#fe2311"
33 | }
34 |
35 | if(this.state&&this.state.clicked){
36 | color = "#999999"
37 | }
38 |
39 | const buttonStyles = {
40 | display: 'inline-block',
41 | padding: '5px 17px',
42 | backgroundColor: color,
43 | border: 'none',
44 | color: '#ffffff',
45 | cursor: 'pointer',
46 | fontFamily: 'Roboto, sans-serif',
47 | fontSize: '16px',
48 | fontWeight: '700',
49 | textTransform: 'uppercase',
50 | boxShadow: '0 2px 5px 0px rgba(0, 0, 0, 0.25)',
51 | textShadow: '1px 1px 2px rgba(0,0,0,0.2)',
52 | margin: 5,
53 | }
54 |
55 |
56 | if(this.props.size=="2"){
57 | buttonStyles.padding = '7.5px 25.5px'
58 | buttonStyles.fontSize = "24px"
59 | buttonStyles.margin = 7.5
60 | }else if(this.props.size=="3"){
61 | buttonStyles.padding = '10px 34px'
62 | buttonStyles.fontSize = "32px"
63 | buttonStyles.margin = 10
64 | }
65 |
66 | return (
67 |
68 | {this.props.children}
69 |
70 | )
71 | }
72 |
73 |
74 | }
75 |
76 | export default Button
77 |
--------------------------------------------------------------------------------
/client/src/components/dapparatus.css:
--------------------------------------------------------------------------------
1 | .grow { transition: all .1s ease-in-out; outline: none;}
2 | .grow:hover { transform: scale(1.1); outline: none;}
3 | .grow:active { transform: scale(0.95); filter:grayscale(100%); outline: none;}
4 |
--------------------------------------------------------------------------------
/client/src/components/scaler.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import deepmerge from 'deepmerge';
3 | let defaultConfig = {}
4 | defaultConfig.DEBUG = false;
5 | defaultConfig.startZoomAt = 900
6 | defaultConfig.origin = "top left"
7 | defaultConfig.adjustedZoom = 1.0
8 |
9 | class Scaler extends Component {
10 | constructor(props) {
11 | super(props);
12 | let config = defaultConfig
13 | if(props.config) {
14 | config = deepmerge(config, props.config)
15 | if(props.config.requiredNetwork){ config.requiredNetwork = props.config.requiredNetwork}
16 | }
17 | this.state = {
18 | config:config
19 | }
20 | }
21 | updateDimensions() {
22 | this.setState({ width: document.documentElement.clientWidth, height: document.documentElement.clientHeight});
23 | }
24 | componentDidMount() {
25 | this.updateDimensions();
26 | window.addEventListener("resize", this.updateDimensions.bind(this));
27 | }
28 | componentWillUnmount() {
29 | window.removeEventListener("resize", this.updateDimensions.bind(this));
30 | }
31 | render() {
32 |
33 |
34 | let zoom = 1.0
35 | if(document.documentElement.clientWidth
42 | {this.props.children}
43 |
44 | )
45 | }
46 | }
47 |
48 | export default Scaler;
49 |
--------------------------------------------------------------------------------
/client/src/components/transactionsCustom.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import deepmerge from 'deepmerge';
3 | import {Motion, spring, presets} from 'react-motion'
4 | import { Line, Circle } from 'rc-progress';
5 | import Scaler from "./scaler.js"
6 | import Web3 from 'web3';
7 | import { soliditySha3 } from 'web3-utils';
8 | import axios from 'axios';
9 |
10 | let interval
11 |
12 | let defaultConfig = {}
13 | defaultConfig.DEBUG = false;
14 | defaultConfig.hide = false;
15 | defaultConfig.TIMETOKEEPTXSAROUND = 90000;
16 | defaultConfig.CHECKONTXS = 731;
17 | defaultConfig.GASLIMITMULTIPLIER = 1.2;
18 | defaultConfig.EXPECTEDPROGRESSBARVSAVGBLOCKTIME = 2.1;
19 | defaultConfig.DEFAULTGASLIMIT = 120000;
20 |
21 |
22 | const METATXPOLL = 1777
23 |
24 | class TransactionsCustom extends Component {
25 | constructor(props) {
26 | super(props);
27 | let config = defaultConfig
28 | if(props.config) {
29 | config = deepmerge(config, props.config)
30 | }
31 | this.state = {
32 | transactions:[],
33 | currentBlock:0,
34 | config: config,
35 | callbacks: {}
36 | }
37 | if(props.metatx){
38 | this.metaTxPoll()
39 | setInterval(this.metaTxPoll.bind(this),METATXPOLL)
40 | }
41 | }
42 | metaTxPoll(){
43 | let metatxUrl = this.props.metatx.endpoint+'txs/'+this.props.account
44 | axios.get(metatxUrl, {
45 | headers: {
46 | 'Content-Type': 'application/json',
47 | }
48 | }).then((response)=>{
49 | if(response&&response.data){
50 | let currentTransactions = this.state.transactions
51 | let callbacks = this.state.callbacks
52 | let changed = false
53 | for(let d in response.data){
54 | let thisTransaction = response.data[d]
55 | let found = false
56 | for(let t in currentTransactions){
57 | if(currentTransactions[t].hash == thisTransaction.hash){
58 | found = true
59 | }
60 | }
61 | if(!found){
62 | console.log("INCOMING META TX:",response.data[d])
63 | changed=true
64 | if(this.state.config.DEBUG) console.log("Adding tx to list...")
65 | currentTransactions.push(thisTransaction)
66 | callbacks[thisTransaction.hash] = ()=>{
67 | console.log("META TX FINISHED",thisTransaction.hash)
68 | }
69 | }
70 | }
71 | if(changed){
72 | this.setState({transactions:currentTransactions,callbacks:callbacks})
73 | }
74 | }
75 | })
76 | .catch((error)=>{
77 | console.log(error);
78 | });
79 | }
80 | componentDidMount(){
81 | interval = setInterval(this.checkTxs.bind(this),this.state.config.CHECKONTXS)
82 | this.checkTxs()
83 | this.props.onReady({
84 | metatx: async (tx,maxGasLimit,txData,cb)=>{
85 | if(this.state.config.DEBUG) console.log("YOU WANT TO SEND A META TX ",tx,this.props.gwei)
86 | let callback = cb
87 | let value = 0
88 | this.sendMetaTx(this.props.metatx.contract,this.props.metaAccount.address,tx._parent._address,value,tx.encodeABI())
89 | },
90 | tx: async (tx,maxGasLimit,txData,value,cb)=>{
91 | if(this.state.config.DEBUG) console.log("YOU WANT TO SEND TX ",tx,this.props.gwei)
92 | let callback = cb
93 |
94 | console.log("==MM meta:",this.props.metaAccount)
95 | let gasLimit
96 | if(typeof maxGasLimit != "function"){
97 | gasLimit = maxGasLimit
98 | }else{
99 | try{
100 | gasLimit = Math.round((await tx.estimateGas()) * this.state.config.GASLIMITMULTIPLIER)
101 | }catch(e){
102 | gasLimit = this.state.DEFAULTGASLIMIT
103 | }
104 | }
105 | if(typeof maxGasLimit == "function"){
106 | callback = maxGasLimit
107 | }
108 |
109 | if(!value) value=0
110 |
111 | let from = this.props.account
112 | if(this.props.metaAccount) from = this.props.metaAccount.address
113 |
114 |
115 |
116 | let paramsObject = {
117 | from: from,
118 | value: value,
119 | gas: gasLimit,
120 | gasPrice: Math.round(this.props.gwei * 1000000000)
121 | }
122 |
123 |
124 |
125 | if(typeof txData == "function"){
126 | callback = txData
127 | }else if(txData){
128 | paramsObject.data = txData
129 | }
130 |
131 | if(this.props.metaAccount&&this.props.metatx){
132 | console.log("================&&&& metaAccount, send as metatx to relayer to contract :",this.props.metatx.contract)
133 | let _value = 0
134 | this.sendMetaTx(this.props.metatx.contract,this.props.metaAccount.address,tx._parent._address,_value,tx.encodeABI(),callback)
135 | }else if(this.props.balance===0&&this.props.metatx){
136 | console.log("================&&&& Etherless Account, send as metatx to relayer to contract :",this.props.metatx.contract)
137 | let _value = 0
138 | this.sendMetaTx(this.props.metatx.contract,this.props.account,tx._parent._address,_value,tx.encodeABI(),callback)
139 | }else if(this.props.metaAccount){
140 |
141 | console.log("Manually crafting... this might work...",tx,tx.arguments,tx.arguments[0].length)
142 | paramsObject.to = tx._parent._address
143 | paramsObject.data = tx.encodeABI()
144 |
145 | console.log("TTTTTX",tx,paramsObject)
146 |
147 | this.props.web3.eth.accounts.signTransaction(paramsObject, this.props.metaAccount.privateKey).then(signed => {
148 | this.props.web3.eth.sendSignedTransaction(signed.rawTransaction).on('receipt', (receipt)=>{
149 | console.log("META RECEIPT",receipt)
150 | cb(receipt)
151 | })
152 | });
153 | }else{
154 |
155 |
156 | if(this.state.config.DEBUG) console.log("gasLimit",gasLimit)
157 | if(this.state.config.DEBUG) console.log("this.props.gwei",this.props.gwei)
158 | tx.send(paramsObject,(error, transactionHash)=>{
159 | if(this.state.config.DEBUG) console.log("TX CALLBACK",error,transactionHash)
160 | let currentTransactions = this.state.transactions
161 | let found = false
162 | for(let t in currentTransactions){
163 | if(currentTransactions[t].hash == transactionHash){
164 | found = true
165 | }
166 | }
167 | if(!found){
168 | if(this.state.config.DEBUG) console.log("Adding tx to list...")
169 | let currentTransactions = this.state.transactions
170 | currentTransactions.push({hash:transactionHash,time:Date.now(),addedFromCallback:1})
171 | let callbacks = this.state.callbacks
172 | callbacks[transactionHash] = callback
173 | this.setState({transactions:currentTransactions,callbacks:callbacks})
174 | }
175 | }).on('error',(err,receiptMaybe)=>{
176 | console.log("TX ERROR",err,receiptMaybe)
177 | let currentTransactions = this.state.transactions
178 | for(let t in currentTransactions){
179 | let errString = err.toString()
180 | if(currentTransactions[t].hash&&errString.indexOf(currentTransactions[t].hash)>0){
181 | //let outofgas = errString.indexOf("ran out of gas")
182 | //if(outofgas>0){
183 | // currentTransactions[t].errorCode = 2
184 | //}else{
185 | currentTransactions[t].errorCode = 1
186 | //}
187 | }
188 | }
189 | this.setState({transactions:currentTransactions})
190 | })
191 | .on('transactionHash',(transactionHash)=>{
192 | if(this.state.config.DEBUG) console.log("TX HASH",transactionHash)
193 | let currentTransactions = this.state.transactions
194 | let found = false
195 | for(let t in currentTransactions){
196 | if(currentTransactions[t].hash == transactionHash){
197 | found = true
198 | }
199 | }
200 | if(!found){
201 | if(this.state.config.DEBUG) console.log("Adding tx to list...")
202 | let currentTransactions = this.state.transactions
203 | currentTransactions.push({hash:transactionHash,time:Date.now(),addedFromTxHash:1})
204 | this.setState({transactions:currentTransactions})
205 | }
206 | })
207 | .on('receipt',(receipt)=>{
208 | if(this.state.config.DEBUG) console.log("TX RECEIPT",receipt)
209 | let currentTransactions = this.state.transactions
210 | for(let t in currentTransactions){
211 | if(currentTransactions[t].hash == receipt.transactionHash){
212 | currentTransactions[t].receipt = 1
213 | }
214 | }
215 | this.setState({transactions:currentTransactions})
216 | }).
217 | on('confirmation', (confirmations,receipt)=>{
218 | if(this.state.config.DEBUG) console.log("TX CONFIRM",confirmations,receipt)
219 | let currentTransactions = this.state.transactions
220 | for(let t in currentTransactions){
221 | if(currentTransactions[t].hash == receipt.transactionHash){
222 | if(!currentTransactions[t].confirmations) currentTransactions[t].confirmations=1
223 | else currentTransactions[t].confirmations = currentTransactions[t].confirmations+1
224 | }
225 | }
226 | this.setState({transactions:currentTransactions})
227 | })
228 | .then((receipt)=>{
229 | if(this.state.config.DEBUG) console.log("TX THEN",receipt)
230 | let currentTransactions = this.state.transactions
231 | for(let t in currentTransactions){
232 | if(currentTransactions[t].hash == receipt.transactionHash){
233 | currentTransactions[t].then = 1
234 | }
235 | }
236 | this.setState({transactions:currentTransactions})
237 | });
238 | }
239 | },
240 | send: async (to,value,cb)=>{
241 | let {metaContract,account,web3} = this.props
242 |
243 | let weiValue = this.props.web3.utils.toWei(""+value, 'ether')
244 |
245 | let result
246 | if(this.props.metaAccount){
247 | console.log("sending with meta account:",this.props.metaAccount.address)
248 | /*result = await this.props.web3.eth.sendTransaction({
249 | from:this.props.metaAccount.address,
250 | to:to,
251 | value: weiValue,
252 | gas: 30000,
253 | gasPrice: Math.round(this.props.gwei * 1000000000)
254 | })*/
255 | let tx={
256 | to:to,
257 | value: weiValue,
258 | gas: 30000,
259 | gasPrice: Math.round(this.props.gwei * 1000000000)
260 | }
261 | this.props.web3.eth.accounts.signTransaction(tx, this.props.metaAccount.privateKey).then(signed => {
262 | this.props.web3.eth.sendSignedTransaction(signed.rawTransaction).on('receipt', (receipt)=>{
263 | console.log("META RECEIPT",receipt)
264 | cb(receipt)
265 | })
266 | });
267 | }else{
268 | console.log("sending with injected web3 account"),
269 | result = await this.props.web3.eth.sendTransaction({
270 | from:account,
271 | to:to,
272 | value: weiValue,
273 | gas: 30000,
274 | gasPrice: Math.round(this.props.gwei * 1000000000)
275 | })
276 | }
277 |
278 | console.log("RESULT:",result)
279 | cb(result)
280 | }
281 | })
282 | }
283 | componentWillUnmount(){
284 | clearInterval(interval)
285 | }
286 | async sendMetaTx(proxyAddress,fromAddress,toAddress,value,txData,callback){
287 | let {metaContract,account,web3} = this.props
288 | console.log("Loading nonce for ",fromAddress)
289 | const nonce = await metaContract.nonce(fromAddress).call()
290 | console.log("Current nonce for "+fromAddress+" is ",nonce)
291 | let rewardAddress = "0x0000000000000000000000000000000000000000"
292 | let rewardAmount = 0
293 |
294 |
295 | let parts
296 |
297 | if(typeof this.props.metaTxParts == "function"){
298 | parts = this.props.metaTxParts(proxyAddress,fromAddress,toAddress,value,txData,nonce)
299 | }else{
300 | parts = [
301 | proxyAddress,
302 | fromAddress,
303 | toAddress,
304 | web3.utils.toTwosComplement(value),
305 | txData,
306 | rewardAddress,
307 | web3.utils.toTwosComplement(rewardAmount),
308 | web3.utils.toTwosComplement(nonce),
309 | ]
310 | }
311 |
312 | console.log("PARTS",parts)
313 | const hashOfMessage = soliditySha3(...parts);
314 | const message = hashOfMessage
315 | console.log("sign",message)
316 | let sig
317 | //sign using either the meta account OR the etherless account
318 | if(this.props.metaAccount.privateKey){
319 | console.log(this.props.metaAccount.privateKey)
320 | sig = this.props.web3.eth.accounts.sign(message, this.props.metaAccount.privateKey);
321 | sig = sig.signature
322 | }else{
323 | sig = await this.props.web3.eth.personal.sign(""+message,this.props.account)
324 | }
325 |
326 | //let sig = await this.props.web3.eth.personal.sign(""+message,account)
327 | console.log("SIG",sig)
328 | let postData = {
329 | gas: this.state.gasLimit,
330 | message: message,
331 | parts:parts,
332 | sig:sig,
333 | }
334 |
335 |
336 | axios.post(this.props.metatx.endpoint+'tx', postData, {
337 | headers: {
338 | 'Content-Type': 'application/json',
339 | }
340 | }).then((response)=>{
341 | console.log("TX RESULT",response.data.transactionHash)
342 |
343 | let currentTransactions = this.state.transactions
344 | currentTransactions.push({hash:response.data.transactionHash,time:Date.now(),addedFromCallback:1,metatx:true})
345 | let callbacks = this.state.callbacks
346 | callbacks[response.data.transactionHash] = callback
347 | this.setState({transactions:currentTransactions,callbacks:callbacks})
348 |
349 | })
350 | .catch((error)=>{
351 | console.log(error);
352 | });
353 | }
354 | checkTxs() {
355 | let {web3,block} = this.props
356 | let {transactions,currentBlock,callbacks} = this.state
357 | if(this.state.config.DEBUG) console.log(" ~~ tx ~~ ")
358 | for(let t in transactions){
359 | if(!transactions[t].fullReceipt&&transactions[t].hash){
360 | if(this.state.config.DEBUG) console.log(" ~~ tx ~~ checking in on "+transactions[t].hash)
361 | web3.eth.getTransactionReceipt(transactions[t].hash,(err,receipt)=>{
362 | if(receipt){
363 | if(this.state.config.DEBUG) console.log(" ~~ tx ~~ GOT RECEPIT FOR ",transactions[t].hash)
364 | let currentTransactions = this.state.transactions
365 | for(let t in currentTransactions){
366 | if(currentTransactions[t].hash == receipt.transactionHash){
367 | if(this.state.config.DEBUG) console.log(" ~~ tx ~~ MATCHED")
368 | if(!currentTransactions[t].fullReceipt){
369 | if(this.state.config.DEBUG) console.log(" ~~ tx ~~ SETTING FULL RECEIPT ",transactions[t].hash)
370 | currentTransactions[t].fullReceipt = receipt
371 | if(typeof this.props.onReceipt =="function"){
372 | this.props.onReceipt(currentTransactions[t],receipt)
373 | }
374 | if(callbacks[currentTransactions[t].hash] && typeof callbacks[currentTransactions[t].hash] == "function"){
375 | callbacks[currentTransactions[t].hash](receipt)
376 | }
377 | console.log("CHECKING META",currentTransactions[t])
378 | if(currentTransactions[t].metatx){
379 | let thisTxHash = receipt.transactionHash
380 | let age = Date.now()-currentTransactions[t].time
381 | console.log("WAITING ON ",thisTxHash,"with age",age)
382 | setTimeout(()=>{
383 | let currentTransactions = this.state.transactions
384 | for(let t in currentTransactions){
385 | if(currentTransactions[t].hash == thisTxHash){
386 | console.log("FOUND TX TO CLOSE")
387 | currentTransactions[t].closed=true
388 | this.setState({transactions:currentTransactions})
389 | }
390 | }
391 | },30000)
392 | }
393 | }
394 |
395 | }
396 | }
397 | this.setState({transactions:currentTransactions})
398 | }
399 | })
400 | }else if(!transactions[t].closed && (transactions[t].receipt || transactions[t].block || transactions[t].errorCode)){
401 | if(!transactions[t].block || currentBlock!=transactions[t].block){
402 |
403 | let timePassed = Date.now()-transactions[t].time
404 | if(timePassed > this.state.config.TIMETOKEEPTXSAROUND){
405 | transactions[t].closed = true
406 | if(this.state.config.DEBUG) console.log("CLOSING TX",transactions[t])
407 | this.setState({transactions:transactions})
408 | }
409 | }
410 |
411 | }
412 | }
413 |
414 | if(!currentBlock){
415 | currentBlock = block+1
416 | let currentTransactions = this.state.transactions
417 | currentTransactions.push({block:block+1,time:Date.now()})
418 | this.setState({transactions:currentTransactions,currentBlock:block+1})
419 | }else{
420 | if(currentBlock!=block+1){
421 | let currentTransactions = this.state.transactions
422 | currentTransactions.push({block:block+1,time:Date.now()})
423 | this.setState({transactions:currentTransactions,currentBlock:block+1})
424 | }else{
425 | this.setState({currentTime:Date.now()})//to force a rerender
426 | }
427 | }
428 |
429 | }
430 | render() {
431 | if(this.state && this.state.config && this.state.config.hide){
432 | return (
)
433 | }
434 | let transactions = []
435 | this.state.transactions.map((transaction)=>{
436 | if(transaction.hash){
437 | let shortHash = transaction.hash.substring(0,14)
438 | let timePassed = Date.now()-transaction.time
439 | //transactions expected to take 1.5 the time blocks are taking
440 | let percent = Math.min(100,Math.round(timePassed*100/(this.props.avgBlockTime*this.state.config.EXPECTEDPROGRESSBARVSAVGBLOCKTIME*1.5)))
441 |
442 | let outAmount = 10
443 | let complete = 0
444 | let stroke = "#2db7f5"
445 | if(transaction.fullReceipt){
446 | stroke="#4ee426"
447 | complete = 1
448 | percent = 100
449 | } else if(percent<15){
450 | stroke = "#c8e3f0"
451 | } else if(percent<30){
452 | stroke = "#9bd6f0"
453 | } else if(percent<60){
454 | stroke = "#7ccbef"
455 | }
456 |
457 | if(transaction.closed){
458 | outAmount = -250
459 | }
460 | if(percent>=100&&!complete){
461 | stroke="#e4d426"
462 | }
463 |
464 | if(transaction.errorCode==1){
465 | stroke="#e93636"
466 | } else if(transaction.errorCode==2){
467 | stroke="#e9a336"
468 | }
469 |
470 | transactions.push(
471 |
479 | {currentStyles => {
480 | return (
481 |
482 |
485 | )
486 | }}
487 |
488 |
489 | )
490 | }else if(transaction.block){
491 | let timePassed = Date.now()-transaction.time
492 | let percent = Math.min(100,Math.round(timePassed*100/(this.props.avgBlockTime*this.state.config.EXPECTEDPROGRESSBARVSAVGBLOCKTIME)))
493 | //let loadedPercent = Math.round(timePassed*100/this.props.avgBlockTime)/100
494 | let complete = 0
495 | let outAmount = 10
496 | let stroke = "#2db7f5"
497 | if(this.state.currentBlock!=transaction.block){
498 | complete = 1
499 | percent = 100
500 | stroke="#4ee426"
501 | }else if(percent<15){
502 | stroke = "#c8e3f0"
503 | } else if(percent<30){
504 | stroke = "#9bd6f0"
505 | } else if(percent<60){
506 | stroke = "#7ccbef"
507 | }
508 | if(transaction.closed){
509 | outAmount = -200
510 | }
511 | if(percent>=100&&!complete){
512 | stroke="#e4d426"
513 | }
514 |
515 |
516 | transactions.push(
517 |
518 |
526 | {currentStyles => {
527 | return (
528 |
531 | )
532 | }}
533 |
534 |
535 | )
536 | }
537 | })
538 |
539 | let height = 40*transactions.length
540 | //
541 | return (
542 |
543 | {transactions}
544 |
545 | )
546 | }
547 | }
548 |
549 | export default TransactionsCustom;
550 |
--------------------------------------------------------------------------------
/client/src/ethereum/registry.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": false,
4 | "inputs": [
5 | {
6 | "name": "_address",
7 | "type": "address"
8 | },
9 | {
10 | "name": "_name",
11 | "type": "string"
12 | },
13 | {
14 | "name": "_ipfs",
15 | "type": "string"
16 | }
17 | ],
18 | "name": "addAddress",
19 | "outputs": [
20 | {
21 | "name": "",
22 | "type": "string"
23 | }
24 | ],
25 | "payable": true,
26 | "stateMutability": "payable",
27 | "type": "function"
28 | },
29 | {
30 | "constant": true,
31 | "inputs": [
32 | {
33 | "name": "",
34 | "type": "address"
35 | }
36 | ],
37 | "name": "adresses",
38 | "outputs": [
39 | {
40 | "name": "_address",
41 | "type": "address"
42 | },
43 | {
44 | "name": "_name",
45 | "type": "string"
46 | },
47 | {
48 | "name": "_ipfs",
49 | "type": "string"
50 | },
51 | {
52 | "name": "_selfAttested",
53 | "type": "bool"
54 | },
55 | {
56 | "name": "_curated",
57 | "type": "bool"
58 | },
59 | {
60 | "name": "_exists",
61 | "type": "bool"
62 | },
63 | {
64 | "name": "_submitter",
65 | "type": "address"
66 | }
67 | ],
68 | "payable": false,
69 | "stateMutability": "view",
70 | "type": "function"
71 | },
72 | {
73 | "constant": true,
74 | "inputs": [
75 | {
76 | "name": "a",
77 | "type": "address"
78 | }
79 | ],
80 | "name": "getByAddress",
81 | "outputs": [
82 | {
83 | "name": "",
84 | "type": "address"
85 | },
86 | {
87 | "name": "",
88 | "type": "string"
89 | },
90 | {
91 | "name": "",
92 | "type": "string"
93 | },
94 | {
95 | "name": "",
96 | "type": "bool"
97 | },
98 | {
99 | "name": "",
100 | "type": "bool"
101 | },
102 | {
103 | "name": "",
104 | "type": "address"
105 | }
106 | ],
107 | "payable": false,
108 | "stateMutability": "view",
109 | "type": "function"
110 | },
111 | {
112 | "constant": true,
113 | "inputs": [
114 | {
115 | "name": "a",
116 | "type": "uint256"
117 | }
118 | ],
119 | "name": "getByIndex",
120 | "outputs": [
121 | {
122 | "name": "",
123 | "type": "address"
124 | },
125 | {
126 | "name": "",
127 | "type": "string"
128 | },
129 | {
130 | "name": "",
131 | "type": "string"
132 | },
133 | {
134 | "name": "",
135 | "type": "bool"
136 | },
137 | {
138 | "name": "",
139 | "type": "bool"
140 | },
141 | {
142 | "name": "",
143 | "type": "address"
144 | }
145 | ],
146 | "payable": false,
147 | "stateMutability": "view",
148 | "type": "function"
149 | },
150 | {
151 | "constant": true,
152 | "inputs": [
153 | {
154 | "name": "a",
155 | "type": "address"
156 | },
157 | {
158 | "name": "i",
159 | "type": "uint256"
160 | }
161 | ],
162 | "name": "getHistoricalVersion",
163 | "outputs": [
164 | {
165 | "name": "",
166 | "type": "address"
167 | },
168 | {
169 | "name": "",
170 | "type": "string"
171 | },
172 | {
173 | "name": "",
174 | "type": "string"
175 | },
176 | {
177 | "name": "",
178 | "type": "bool"
179 | },
180 | {
181 | "name": "",
182 | "type": "bool"
183 | },
184 | {
185 | "name": "",
186 | "type": "address"
187 | }
188 | ],
189 | "payable": false,
190 | "stateMutability": "view",
191 | "type": "function"
192 | },
193 | {
194 | "constant": true,
195 | "inputs": [],
196 | "name": "getIndex",
197 | "outputs": [
198 | {
199 | "name": "",
200 | "type": "uint256"
201 | }
202 | ],
203 | "payable": false,
204 | "stateMutability": "view",
205 | "type": "function"
206 | },
207 | {
208 | "constant": true,
209 | "inputs": [],
210 | "name": "getPrice",
211 | "outputs": [
212 | {
213 | "name": "",
214 | "type": "uint256"
215 | }
216 | ],
217 | "payable": false,
218 | "stateMutability": "view",
219 | "type": "function"
220 | },
221 | {
222 | "constant": true,
223 | "inputs": [
224 | {
225 | "name": "a",
226 | "type": "address"
227 | }
228 | ],
229 | "name": "getVersions",
230 | "outputs": [
231 | {
232 | "name": "v",
233 | "type": "uint256"
234 | }
235 | ],
236 | "payable": false,
237 | "stateMutability": "view",
238 | "type": "function"
239 | },
240 | {
241 | "constant": true,
242 | "inputs": [
243 | {
244 | "name": "a",
245 | "type": "address"
246 | }
247 | ],
248 | "name": "isCurator",
249 | "outputs": [
250 | {
251 | "name": "",
252 | "type": "bool"
253 | }
254 | ],
255 | "payable": false,
256 | "stateMutability": "view",
257 | "type": "function"
258 | },
259 | {
260 | "constant": true,
261 | "inputs": [
262 | {
263 | "name": "",
264 | "type": "address"
265 | },
266 | {
267 | "name": "",
268 | "type": "uint256"
269 | }
270 | ],
271 | "name": "versionHistory",
272 | "outputs": [
273 | {
274 | "name": "_address",
275 | "type": "address"
276 | },
277 | {
278 | "name": "_name",
279 | "type": "string"
280 | },
281 | {
282 | "name": "_ipfs",
283 | "type": "string"
284 | },
285 | {
286 | "name": "_selfAttested",
287 | "type": "bool"
288 | },
289 | {
290 | "name": "_curated",
291 | "type": "bool"
292 | },
293 | {
294 | "name": "_exists",
295 | "type": "bool"
296 | },
297 | {
298 | "name": "_submitter",
299 | "type": "address"
300 | }
301 | ],
302 | "payable": false,
303 | "stateMutability": "view",
304 | "type": "function"
305 | }
306 | ]
307 |
--------------------------------------------------------------------------------
/client/src/ethereum/sampleABI1.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": false,
4 | "inputs": [],
5 | "name": "distributeFunds",
6 | "outputs": [
7 | {
8 | "name": "",
9 | "type": "bool"
10 | }
11 | ],
12 | "payable": true,
13 | "stateMutability": "payable",
14 | "type": "function"
15 | },
16 | {
17 | "constant": false,
18 | "inputs": [],
19 | "name": "kill",
20 | "outputs": [],
21 | "payable": false,
22 | "stateMutability": "nonpayable",
23 | "type": "function"
24 | },
25 | {
26 | "constant": false,
27 | "inputs": [
28 | {
29 | "name": "recipient",
30 | "type": "address"
31 | },
32 | {
33 | "name": "foo",
34 | "type": "uint256"
35 | }
36 | ],
37 | "name": "setRecipients",
38 | "outputs": [
39 | {
40 | "name": "recipients",
41 | "type": "bool"
42 | }
43 | ],
44 | "payable": false,
45 | "stateMutability": "nonpayable",
46 | "type": "function"
47 | },
48 | {
49 | "constant": true,
50 | "inputs": [
51 | {
52 | "name": "",
53 | "type": "uint256"
54 | }
55 | ],
56 | "name": "recipientAddress",
57 | "outputs": [
58 | {
59 | "name": "",
60 | "type": "address"
61 | }
62 | ],
63 | "payable": false,
64 | "stateMutability": "view",
65 | "type": "function"
66 | },
67 | {
68 | "constant": true,
69 | "inputs": [],
70 | "name": "viewRecipients",
71 | "outputs": [
72 | {
73 | "name": "recipients",
74 | "type": "address[]"
75 | },
76 | {
77 | "name": "foo",
78 | "type": "uint256"
79 | }
80 | ],
81 | "payable": false,
82 | "stateMutability": "view",
83 | "type": "function"
84 | },
85 | {
86 | "constant": true,
87 | "inputs": [],
88 | "name": "owner",
89 | "outputs": [
90 | {
91 | "name": "",
92 | "type": "address"
93 | }
94 | ],
95 | "payable": false,
96 | "stateMutability": "view",
97 | "type": "function"
98 | },
99 | {
100 | "constant": false,
101 | "inputs": [
102 | {
103 | "name": "_newOwner",
104 | "type": "address"
105 | }
106 | ],
107 | "name": "changeOwner",
108 | "outputs": [],
109 | "payable": false,
110 | "stateMutability": "nonpayable",
111 | "type": "function"
112 | },
113 | {
114 | "constant": true,
115 | "inputs": [],
116 | "name": "numberRecipients",
117 | "outputs": [
118 | {
119 | "name": "",
120 | "type": "uint256"
121 | }
122 | ],
123 | "payable": false,
124 | "stateMutability": "view",
125 | "type": "function"
126 | },
127 | {
128 | "constant": false,
129 | "inputs": [],
130 | "name": "reset",
131 | "outputs": [],
132 | "payable": false,
133 | "stateMutability": "nonpayable",
134 | "type": "function"
135 | },
136 | {
137 | "payable": true,
138 | "stateMutability": "payable",
139 | "type": "fallback"
140 | }
141 | ]
142 |
--------------------------------------------------------------------------------
/client/src/ethereum/sampleABI2.json:
--------------------------------------------------------------------------------
1 | [{"constant":true,"inputs":[{"name":"_interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cfoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"},{"name":"_preferredTransport","type":"string"}],"name":"tokenMetadata","outputs":[{"name":"infoUrl","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"promoCreatedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ceoAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"GEN0_STARTING_PRICE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setSiringAuctionAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pregnantKitties","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_kittyId","type":"uint256"}],"name":"isPregnant","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"GEN0_AUCTION_DURATION","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"siringAuction","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setGeneScienceAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCEO","type":"address"}],"name":"setCEO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCOO","type":"address"}],"name":"setCOO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_kittyId","type":"uint256"},{"name":"_startingPrice","type":"uint256"},{"name":"_endingPrice","type":"uint256"},{"name":"_duration","type":"uint256"}],"name":"createSaleAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"sireAllowedToAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_matronId","type":"uint256"},{"name":"_sireId","type":"uint256"}],"name":"canBreedWith","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"kittyIndexToApproved","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_kittyId","type":"uint256"},{"name":"_startingPrice","type":"uint256"},{"name":"_endingPrice","type":"uint256"},{"name":"_duration","type":"uint256"}],"name":"createSiringAuction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"val","type":"uint256"}],"name":"setAutoBirthFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_addr","type":"address"},{"name":"_sireId","type":"uint256"}],"name":"approveSiring","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newCFO","type":"address"}],"name":"setCFO","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_genes","type":"uint256"},{"name":"_owner","type":"address"}],"name":"createPromoKitty","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"secs","type":"uint256"}],"name":"setSecondsPerBlock","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"withdrawBalance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"GEN0_CREATION_LIMIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"newContractAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setSaleAuctionAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"count","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_v2Address","type":"address"}],"name":"setNewAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"secondsPerBlock","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"name":"ownerTokens","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_matronId","type":"uint256"}],"name":"giveBirth","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"withdrawAuctionBalances","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"cooldowns","outputs":[{"name":"","type":"uint32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"kittyIndexToOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_tokenId","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"cooAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"autoBirthFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"erc721Metadata","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_genes","type":"uint256"}],"name":"createGen0Auction","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_kittyId","type":"uint256"}],"name":"isReadyToBreed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"PROMO_CREATION_LIMIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_contractAddress","type":"address"}],"name":"setMetadataAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"saleAuction","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_id","type":"uint256"}],"name":"getKitty","outputs":[{"name":"isGestating","type":"bool"},{"name":"isReady","type":"bool"},{"name":"cooldownIndex","type":"uint256"},{"name":"nextActionAt","type":"uint256"},{"name":"siringWithId","type":"uint256"},{"name":"birthTime","type":"uint256"},{"name":"matronId","type":"uint256"},{"name":"sireId","type":"uint256"},{"name":"generation","type":"uint256"},{"name":"genes","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_sireId","type":"uint256"},{"name":"_matronId","type":"uint256"}],"name":"bidOnSiringAuction","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"gen0CreatedCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"geneScience","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_matronId","type":"uint256"},{"name":"_sireId","type":"uint256"}],"name":"breedWithAuto","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"matronId","type":"uint256"},{"indexed":false,"name":"sireId","type":"uint256"},{"indexed":false,"name":"cooldownEndBlock","type":"uint256"}],"name":"Pregnant","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"from","type":"address"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"approved","type":"address"},{"indexed":false,"name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"kittyId","type":"uint256"},{"indexed":false,"name":"matronId","type":"uint256"},{"indexed":false,"name":"sireId","type":"uint256"},{"indexed":false,"name":"genes","type":"uint256"}],"name":"Birth","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newContract","type":"address"}],"name":"ContractUpgrade","type":"event"}]
2 |
--------------------------------------------------------------------------------
/client/src/ethereum/sampleABI3.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": true,
4 | "inputs": [],
5 | "name": "name",
6 | "outputs": [{ "name": "", "type": "string" }],
7 | "payable": false,
8 | "type": "function"
9 | },
10 | {
11 | "constant": true,
12 | "inputs": [{ "name": "", "type": "uint256" }],
13 | "name": "punksOfferedForSale",
14 | "outputs": [
15 | { "name": "isForSale", "type": "bool" },
16 | { "name": "punkIndex", "type": "uint256" },
17 | { "name": "seller", "type": "address" },
18 | { "name": "minValue", "type": "uint256" },
19 | { "name": "onlySellTo", "type": "address" }
20 | ],
21 | "payable": false,
22 | "type": "function"
23 | },
24 | {
25 | "constant": false,
26 | "inputs": [{ "name": "punkIndex", "type": "uint256" }],
27 | "name": "enterBidForPunk",
28 | "outputs": [],
29 | "payable": true,
30 | "type": "function"
31 | },
32 | {
33 | "constant": true,
34 | "inputs": [],
35 | "name": "totalSupply",
36 | "outputs": [{ "name": "", "type": "uint256" }],
37 | "payable": false,
38 | "type": "function"
39 | },
40 | {
41 | "constant": false,
42 | "inputs": [
43 | { "name": "punkIndex", "type": "uint256" },
44 | { "name": "minPrice", "type": "uint256" }
45 | ],
46 | "name": "acceptBidForPunk",
47 | "outputs": [],
48 | "payable": false,
49 | "type": "function"
50 | },
51 | {
52 | "constant": true,
53 | "inputs": [],
54 | "name": "decimals",
55 | "outputs": [{ "name": "", "type": "uint8" }],
56 | "payable": false,
57 | "type": "function"
58 | },
59 | {
60 | "constant": false,
61 | "inputs": [
62 | { "name": "addresses", "type": "address[]" },
63 | { "name": "indices", "type": "uint256[]" }
64 | ],
65 | "name": "setInitialOwners",
66 | "outputs": [],
67 | "payable": false,
68 | "type": "function"
69 | },
70 | {
71 | "constant": false,
72 | "inputs": [],
73 | "name": "withdraw",
74 | "outputs": [],
75 | "payable": false,
76 | "type": "function"
77 | },
78 | {
79 | "constant": true,
80 | "inputs": [],
81 | "name": "imageHash",
82 | "outputs": [{ "name": "", "type": "string" }],
83 | "payable": false,
84 | "type": "function"
85 | },
86 | {
87 | "constant": true,
88 | "inputs": [],
89 | "name": "nextPunkIndexToAssign",
90 | "outputs": [{ "name": "", "type": "uint256" }],
91 | "payable": false,
92 | "type": "function"
93 | },
94 | {
95 | "constant": true,
96 | "inputs": [{ "name": "", "type": "uint256" }],
97 | "name": "punkIndexToAddress",
98 | "outputs": [{ "name": "", "type": "address" }],
99 | "payable": false,
100 | "type": "function"
101 | },
102 | {
103 | "constant": true,
104 | "inputs": [],
105 | "name": "standard",
106 | "outputs": [{ "name": "", "type": "string" }],
107 | "payable": false,
108 | "type": "function"
109 | },
110 | {
111 | "constant": true,
112 | "inputs": [{ "name": "", "type": "uint256" }],
113 | "name": "punkBids",
114 | "outputs": [
115 | { "name": "hasBid", "type": "bool" },
116 | { "name": "punkIndex", "type": "uint256" },
117 | { "name": "bidder", "type": "address" },
118 | { "name": "value", "type": "uint256" }
119 | ],
120 | "payable": false,
121 | "type": "function"
122 | },
123 | {
124 | "constant": true,
125 | "inputs": [{ "name": "", "type": "address" }],
126 | "name": "balanceOf",
127 | "outputs": [{ "name": "", "type": "uint256" }],
128 | "payable": false,
129 | "type": "function"
130 | },
131 | {
132 | "constant": false,
133 | "inputs": [],
134 | "name": "allInitialOwnersAssigned",
135 | "outputs": [],
136 | "payable": false,
137 | "type": "function"
138 | },
139 | {
140 | "constant": true,
141 | "inputs": [],
142 | "name": "allPunksAssigned",
143 | "outputs": [{ "name": "", "type": "bool" }],
144 | "payable": false,
145 | "type": "function"
146 | },
147 | {
148 | "constant": false,
149 | "inputs": [{ "name": "punkIndex", "type": "uint256" }],
150 | "name": "buyPunk",
151 | "outputs": [],
152 | "payable": true,
153 | "type": "function"
154 | },
155 | {
156 | "constant": false,
157 | "inputs": [
158 | { "name": "to", "type": "address" },
159 | { "name": "punkIndex", "type": "uint256" }
160 | ],
161 | "name": "transferPunk",
162 | "outputs": [],
163 | "payable": false,
164 | "type": "function"
165 | },
166 | {
167 | "constant": true,
168 | "inputs": [],
169 | "name": "symbol",
170 | "outputs": [{ "name": "", "type": "string" }],
171 | "payable": false,
172 | "type": "function"
173 | },
174 | {
175 | "constant": false,
176 | "inputs": [{ "name": "punkIndex", "type": "uint256" }],
177 | "name": "withdrawBidForPunk",
178 | "outputs": [],
179 | "payable": false,
180 | "type": "function"
181 | },
182 | {
183 | "constant": false,
184 | "inputs": [
185 | { "name": "to", "type": "address" },
186 | { "name": "punkIndex", "type": "uint256" }
187 | ],
188 | "name": "setInitialOwner",
189 | "outputs": [],
190 | "payable": false,
191 | "type": "function"
192 | },
193 | {
194 | "constant": false,
195 | "inputs": [
196 | { "name": "punkIndex", "type": "uint256" },
197 | { "name": "minSalePriceInWei", "type": "uint256" },
198 | { "name": "toAddress", "type": "address" }
199 | ],
200 | "name": "offerPunkForSaleToAddress",
201 | "outputs": [],
202 | "payable": false,
203 | "type": "function"
204 | },
205 | {
206 | "constant": true,
207 | "inputs": [],
208 | "name": "punksRemainingToAssign",
209 | "outputs": [{ "name": "", "type": "uint256" }],
210 | "payable": false,
211 | "type": "function"
212 | },
213 | {
214 | "constant": false,
215 | "inputs": [
216 | { "name": "punkIndex", "type": "uint256" },
217 | { "name": "minSalePriceInWei", "type": "uint256" }
218 | ],
219 | "name": "offerPunkForSale",
220 | "outputs": [],
221 | "payable": false,
222 | "type": "function"
223 | },
224 | {
225 | "constant": false,
226 | "inputs": [{ "name": "punkIndex", "type": "uint256" }],
227 | "name": "getPunk",
228 | "outputs": [],
229 | "payable": false,
230 | "type": "function"
231 | },
232 | {
233 | "constant": true,
234 | "inputs": [{ "name": "", "type": "address" }],
235 | "name": "pendingWithdrawals",
236 | "outputs": [{ "name": "", "type": "uint256" }],
237 | "payable": false,
238 | "type": "function"
239 | },
240 | {
241 | "constant": false,
242 | "inputs": [{ "name": "punkIndex", "type": "uint256" }],
243 | "name": "punkNoLongerForSale",
244 | "outputs": [],
245 | "payable": false,
246 | "type": "function"
247 | },
248 | { "inputs": [], "payable": true, "type": "constructor" },
249 | {
250 | "anonymous": false,
251 | "inputs": [
252 | { "indexed": true, "name": "to", "type": "address" },
253 | { "indexed": false, "name": "punkIndex", "type": "uint256" }
254 | ],
255 | "name": "Assign",
256 | "type": "event"
257 | },
258 | {
259 | "anonymous": false,
260 | "inputs": [
261 | { "indexed": true, "name": "from", "type": "address" },
262 | { "indexed": true, "name": "to", "type": "address" },
263 | { "indexed": false, "name": "value", "type": "uint256" }
264 | ],
265 | "name": "Transfer",
266 | "type": "event"
267 | },
268 | {
269 | "anonymous": false,
270 | "inputs": [
271 | { "indexed": true, "name": "from", "type": "address" },
272 | { "indexed": true, "name": "to", "type": "address" },
273 | { "indexed": false, "name": "punkIndex", "type": "uint256" }
274 | ],
275 | "name": "PunkTransfer",
276 | "type": "event"
277 | },
278 | {
279 | "anonymous": false,
280 | "inputs": [
281 | { "indexed": true, "name": "punkIndex", "type": "uint256" },
282 | { "indexed": false, "name": "minValue", "type": "uint256" },
283 | { "indexed": true, "name": "toAddress", "type": "address" }
284 | ],
285 | "name": "PunkOffered",
286 | "type": "event"
287 | },
288 | {
289 | "anonymous": false,
290 | "inputs": [
291 | { "indexed": true, "name": "punkIndex", "type": "uint256" },
292 | { "indexed": false, "name": "value", "type": "uint256" },
293 | { "indexed": true, "name": "fromAddress", "type": "address" }
294 | ],
295 | "name": "PunkBidEntered",
296 | "type": "event"
297 | },
298 | {
299 | "anonymous": false,
300 | "inputs": [
301 | { "indexed": true, "name": "punkIndex", "type": "uint256" },
302 | { "indexed": false, "name": "value", "type": "uint256" },
303 | { "indexed": true, "name": "fromAddress", "type": "address" }
304 | ],
305 | "name": "PunkBidWithdrawn",
306 | "type": "event"
307 | },
308 | {
309 | "anonymous": false,
310 | "inputs": [
311 | { "indexed": true, "name": "punkIndex", "type": "uint256" },
312 | { "indexed": false, "name": "value", "type": "uint256" },
313 | { "indexed": true, "name": "fromAddress", "type": "address" },
314 | { "indexed": true, "name": "toAddress", "type": "address" }
315 | ],
316 | "name": "PunkBought",
317 | "type": "event"
318 | },
319 | {
320 | "anonymous": false,
321 | "inputs": [{ "indexed": true, "name": "punkIndex", "type": "uint256" }],
322 | "name": "PunkNoLongerForSale",
323 | "type": "event"
324 | }
325 | ]
326 |
--------------------------------------------------------------------------------
/client/src/ethereum/sampleABIOpenTriviaFactory.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": true,
4 | "inputs": [
5 | {
6 | "name": "",
7 | "type": "uint256"
8 | }
9 | ],
10 | "name": "deployedGames",
11 | "outputs": [
12 | {
13 | "name": "",
14 | "type": "address"
15 | }
16 | ],
17 | "payable": false,
18 | "stateMutability": "view",
19 | "type": "function"
20 | },
21 | {
22 | "constant": true,
23 | "inputs": [],
24 | "name": "owner",
25 | "outputs": [
26 | {
27 | "name": "",
28 | "type": "address"
29 | }
30 | ],
31 | "payable": false,
32 | "stateMutability": "view",
33 | "type": "function"
34 | },
35 | {
36 | "constant": false,
37 | "inputs": [
38 | {
39 | "name": "fee",
40 | "type": "uint256"
41 | },
42 | {
43 | "name": "info",
44 | "type": "string"
45 | },
46 | {
47 | "name": "questions",
48 | "type": "string"
49 | },
50 | {
51 | "name": "answers",
52 | "type": "string"
53 | }
54 | ],
55 | "name": "createGame",
56 | "outputs": [],
57 | "payable": false,
58 | "stateMutability": "nonpayable",
59 | "type": "function"
60 | },
61 | {
62 | "constant": true,
63 | "inputs": [],
64 | "name": "getDeployedGames",
65 | "outputs": [
66 | {
67 | "name": "",
68 | "type": "address[]"
69 | }
70 | ],
71 | "payable": false,
72 | "stateMutability": "view",
73 | "type": "function"
74 | }
75 | ]
76 |
--------------------------------------------------------------------------------
/client/src/ethereum/sampleABIOpenTriviaGame.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": true,
4 | "inputs": [],
5 | "name": "entryFee",
6 | "outputs": [
7 | {
8 | "name": "",
9 | "type": "uint256"
10 | }
11 | ],
12 | "payable": false,
13 | "stateMutability": "view",
14 | "type": "function"
15 | },
16 | {
17 | "constant": true,
18 | "inputs": [],
19 | "name": "highScore",
20 | "outputs": [
21 | {
22 | "name": "",
23 | "type": "uint256"
24 | }
25 | ],
26 | "payable": false,
27 | "stateMutability": "view",
28 | "type": "function"
29 | },
30 | {
31 | "constant": true,
32 | "inputs": [],
33 | "name": "getSummary",
34 | "outputs": [
35 | {
36 | "name": "",
37 | "type": "address"
38 | },
39 | {
40 | "name": "",
41 | "type": "string"
42 | },
43 | {
44 | "name": "",
45 | "type": "uint256"
46 | },
47 | {
48 | "name": "",
49 | "type": "uint256"
50 | },
51 | {
52 | "name": "",
53 | "type": "uint256"
54 | },
55 | {
56 | "name": "",
57 | "type": "uint256"
58 | },
59 | {
60 | "name": "",
61 | "type": "bool"
62 | },
63 | {
64 | "name": "",
65 | "type": "bool"
66 | },
67 | {
68 | "name": "",
69 | "type": "uint256"
70 | },
71 | {
72 | "name": "",
73 | "type": "address[]"
74 | },
75 | {
76 | "name": "",
77 | "type": "uint256"
78 | },
79 | {
80 | "name": "",
81 | "type": "string"
82 | }
83 | ],
84 | "payable": false,
85 | "stateMutability": "view",
86 | "type": "function"
87 | },
88 | {
89 | "constant": true,
90 | "inputs": [],
91 | "name": "hasStarted",
92 | "outputs": [
93 | {
94 | "name": "",
95 | "type": "bool"
96 | }
97 | ],
98 | "payable": false,
99 | "stateMutability": "view",
100 | "type": "function"
101 | },
102 | {
103 | "constant": true,
104 | "inputs": [],
105 | "name": "manager",
106 | "outputs": [
107 | {
108 | "name": "",
109 | "type": "address"
110 | }
111 | ],
112 | "payable": false,
113 | "stateMutability": "view",
114 | "type": "function"
115 | },
116 | {
117 | "constant": false,
118 | "inputs": [],
119 | "name": "withdrawPrize",
120 | "outputs": [],
121 | "payable": false,
122 | "stateMutability": "nonpayable",
123 | "type": "function"
124 | },
125 | {
126 | "constant": false,
127 | "inputs": [
128 | {
129 | "name": "thesis",
130 | "type": "string"
131 | }
132 | ],
133 | "name": "guess",
134 | "outputs": [],
135 | "payable": false,
136 | "stateMutability": "nonpayable",
137 | "type": "function"
138 | },
139 | {
140 | "constant": false,
141 | "inputs": [],
142 | "name": "startRound",
143 | "outputs": [],
144 | "payable": false,
145 | "stateMutability": "nonpayable",
146 | "type": "function"
147 | },
148 | {
149 | "constant": true,
150 | "inputs": [
151 | {
152 | "name": "player",
153 | "type": "address"
154 | }
155 | ],
156 | "name": "getPlayer",
157 | "outputs": [
158 | {
159 | "name": "",
160 | "type": "string"
161 | },
162 | {
163 | "name": "",
164 | "type": "bool"
165 | },
166 | {
167 | "name": "",
168 | "type": "uint8"
169 | },
170 | {
171 | "name": "",
172 | "type": "uint256"
173 | },
174 | {
175 | "name": "",
176 | "type": "uint256"
177 | }
178 | ],
179 | "payable": false,
180 | "stateMutability": "view",
181 | "type": "function"
182 | },
183 | {
184 | "constant": false,
185 | "inputs": [],
186 | "name": "endGame",
187 | "outputs": [],
188 | "payable": false,
189 | "stateMutability": "nonpayable",
190 | "type": "function"
191 | },
192 | {
193 | "constant": true,
194 | "inputs": [],
195 | "name": "description",
196 | "outputs": [
197 | {
198 | "name": "",
199 | "type": "string"
200 | }
201 | ],
202 | "payable": false,
203 | "stateMutability": "view",
204 | "type": "function"
205 | },
206 | {
207 | "constant": false,
208 | "inputs": [],
209 | "name": "endRound",
210 | "outputs": [],
211 | "payable": false,
212 | "stateMutability": "nonpayable",
213 | "type": "function"
214 | },
215 | {
216 | "constant": true,
217 | "inputs": [],
218 | "name": "currentRound",
219 | "outputs": [
220 | {
221 | "name": "",
222 | "type": "uint256"
223 | }
224 | ],
225 | "payable": false,
226 | "stateMutability": "view",
227 | "type": "function"
228 | },
229 | {
230 | "constant": true,
231 | "inputs": [
232 | {
233 | "name": "",
234 | "type": "uint256"
235 | }
236 | ],
237 | "name": "rounds",
238 | "outputs": [
239 | {
240 | "name": "question",
241 | "type": "string"
242 | },
243 | {
244 | "name": "answer",
245 | "type": "string"
246 | },
247 | {
248 | "name": "started",
249 | "type": "bool"
250 | },
251 | {
252 | "name": "complete",
253 | "type": "bool"
254 | }
255 | ],
256 | "payable": false,
257 | "stateMutability": "view",
258 | "type": "function"
259 | },
260 | {
261 | "constant": true,
262 | "inputs": [],
263 | "name": "numPlayers",
264 | "outputs": [
265 | {
266 | "name": "",
267 | "type": "uint256"
268 | }
269 | ],
270 | "payable": false,
271 | "stateMutability": "view",
272 | "type": "function"
273 | },
274 | {
275 | "constant": true,
276 | "inputs": [],
277 | "name": "numRounds",
278 | "outputs": [
279 | {
280 | "name": "",
281 | "type": "uint256"
282 | }
283 | ],
284 | "payable": false,
285 | "stateMutability": "view",
286 | "type": "function"
287 | },
288 | {
289 | "constant": true,
290 | "inputs": [
291 | {
292 | "name": "",
293 | "type": "uint256"
294 | }
295 | ],
296 | "name": "winners",
297 | "outputs": [
298 | {
299 | "name": "",
300 | "type": "address"
301 | }
302 | ],
303 | "payable": false,
304 | "stateMutability": "view",
305 | "type": "function"
306 | },
307 | {
308 | "constant": false,
309 | "inputs": [],
310 | "name": "reset",
311 | "outputs": [],
312 | "payable": false,
313 | "stateMutability": "nonpayable",
314 | "type": "function"
315 | },
316 | {
317 | "constant": true,
318 | "inputs": [
319 | {
320 | "name": "",
321 | "type": "address"
322 | }
323 | ],
324 | "name": "players",
325 | "outputs": [
326 | {
327 | "name": "name",
328 | "type": "string"
329 | },
330 | {
331 | "name": "isRegistered",
332 | "type": "bool"
333 | },
334 | {
335 | "name": "score",
336 | "type": "uint8"
337 | },
338 | {
339 | "name": "winnings",
340 | "type": "uint256"
341 | },
342 | {
343 | "name": "guessedThisRound",
344 | "type": "uint256"
345 | }
346 | ],
347 | "payable": false,
348 | "stateMutability": "view",
349 | "type": "function"
350 | },
351 | {
352 | "constant": true,
353 | "inputs": [],
354 | "name": "currentQuestion",
355 | "outputs": [
356 | {
357 | "name": "",
358 | "type": "string"
359 | }
360 | ],
361 | "payable": false,
362 | "stateMutability": "view",
363 | "type": "function"
364 | },
365 | {
366 | "constant": true,
367 | "inputs": [],
368 | "name": "hasEnded",
369 | "outputs": [
370 | {
371 | "name": "",
372 | "type": "bool"
373 | }
374 | ],
375 | "payable": false,
376 | "stateMutability": "view",
377 | "type": "function"
378 | },
379 | {
380 | "constant": false,
381 | "inputs": [
382 | {
383 | "name": "name",
384 | "type": "string"
385 | }
386 | ],
387 | "name": "register",
388 | "outputs": [],
389 | "payable": true,
390 | "stateMutability": "payable",
391 | "type": "function"
392 | },
393 | {
394 | "inputs": [
395 | {
396 | "name": "creator",
397 | "type": "address"
398 | },
399 | {
400 | "name": "fee",
401 | "type": "uint256"
402 | },
403 | {
404 | "name": "info",
405 | "type": "string"
406 | },
407 | {
408 | "name": "questions",
409 | "type": "string"
410 | },
411 | {
412 | "name": "answers",
413 | "type": "string"
414 | }
415 | ],
416 | "payable": false,
417 | "stateMutability": "nonpayable",
418 | "type": "constructor"
419 | }
420 | ]
421 |
--------------------------------------------------------------------------------
/client/src/ethereum/troubleshootingFunctions.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "constant": false,
4 | "inputs": [],
5 | "name": "acceptOwnership",
6 | "outputs": [],
7 | "payable": false,
8 | "stateMutability": "nonpayable",
9 | "type": "function"
10 | },
11 | {
12 | "constant": false,
13 | "inputs": [
14 | {
15 | "name": "masternode",
16 | "type": "address"
17 | },
18 | {
19 | "name": "referral",
20 | "type": "address"
21 | }
22 | ],
23 | "name": "buyBonds",
24 | "outputs": [],
25 | "payable": true,
26 | "stateMutability": "payable",
27 | "type": "function"
28 | },
29 | {
30 | "constant": false,
31 | "inputs": [],
32 | "name": "buyCEO",
33 | "outputs": [],
34 | "payable": true,
35 | "stateMutability": "payable",
36 | "type": "function"
37 | },
38 | {
39 | "constant": false,
40 | "inputs": [
41 | {
42 | "name": "spot",
43 | "type": "uint256"
44 | }
45 | ],
46 | "name": "buyDirector",
47 | "outputs": [],
48 | "payable": true,
49 | "stateMutability": "payable",
50 | "type": "function"
51 | },
52 | {
53 | "constant": false,
54 | "inputs": [],
55 | "name": "cheatTheLine",
56 | "outputs": [],
57 | "payable": true,
58 | "stateMutability": "payable",
59 | "type": "function"
60 | },
61 | {
62 | "constant": false,
63 | "inputs": [],
64 | "name": "cheatTheLineWhale",
65 | "outputs": [],
66 | "payable": true,
67 | "stateMutability": "payable",
68 | "type": "function"
69 | },
70 | {
71 | "constant": false,
72 | "inputs": [],
73 | "name": "die",
74 | "outputs": [],
75 | "payable": false,
76 | "stateMutability": "nonpayable",
77 | "type": "function"
78 | },
79 | {
80 | "constant": false,
81 | "inputs": [],
82 | "name": "disableAuto",
83 | "outputs": [],
84 | "payable": false,
85 | "stateMutability": "nonpayable",
86 | "type": "function"
87 | },
88 | {
89 | "constant": false,
90 | "inputs": [],
91 | "name": "ethManagementPropagate",
92 | "outputs": [],
93 | "payable": false,
94 | "stateMutability": "nonpayable",
95 | "type": "function"
96 | },
97 | {
98 | "constant": false,
99 | "inputs": [],
100 | "name": "ethPropagate",
101 | "outputs": [],
102 | "payable": false,
103 | "stateMutability": "nonpayable",
104 | "type": "function"
105 | },
106 | {
107 | "constant": false,
108 | "inputs": [],
109 | "name": "exitScam",
110 | "outputs": [],
111 | "payable": false,
112 | "stateMutability": "nonpayable",
113 | "type": "function"
114 | },
115 | {
116 | "constant": false,
117 | "inputs": [],
118 | "name": "fetchP3Ddivs",
119 | "outputs": [],
120 | "payable": false,
121 | "stateMutability": "nonpayable",
122 | "type": "function"
123 | },
124 | {
125 | "constant": false,
126 | "inputs": [
127 | {
128 | "name": "bondsOwner",
129 | "type": "address"
130 | }
131 | ],
132 | "name": "fillBonds",
133 | "outputs": [],
134 | "payable": false,
135 | "stateMutability": "nonpayable",
136 | "type": "function"
137 | },
138 | {
139 | "constant": false,
140 | "inputs": [
141 | {
142 | "name": "bondsOwner",
143 | "type": "address"
144 | },
145 | {
146 | "name": "masternode",
147 | "type": "address"
148 | }
149 | ],
150 | "name": "forceBonds",
151 | "outputs": [],
152 | "payable": false,
153 | "stateMutability": "nonpayable",
154 | "type": "function"
155 | },
156 | {
157 | "constant": false,
158 | "inputs": [
159 | {
160 | "name": "stackOwner",
161 | "type": "address"
162 | },
163 | {
164 | "name": "masternode",
165 | "type": "address"
166 | }
167 | ],
168 | "name": "freelanceReinvest",
169 | "outputs": [],
170 | "payable": false,
171 | "stateMutability": "nonpayable",
172 | "type": "function"
173 | },
174 | {
175 | "constant": false,
176 | "inputs": [],
177 | "name": "helpUnstuckEth",
178 | "outputs": [],
179 | "payable": true,
180 | "stateMutability": "payable",
181 | "type": "function"
182 | },
183 | {
184 | "constant": false,
185 | "inputs": [
186 | {
187 | "name": "who",
188 | "type": "uint256"
189 | }
190 | ],
191 | "name": "managementWithdraw",
192 | "outputs": [],
193 | "payable": false,
194 | "stateMutability": "nonpayable",
195 | "type": "function"
196 | },
197 | {
198 | "constant": false,
199 | "inputs": [],
200 | "name": "payoutCheatLine",
201 | "outputs": [],
202 | "payable": false,
203 | "stateMutability": "nonpayable",
204 | "type": "function"
205 | },
206 | {
207 | "constant": false,
208 | "inputs": [],
209 | "name": "payoutCheatLineWhale",
210 | "outputs": [],
211 | "payable": false,
212 | "stateMutability": "nonpayable",
213 | "type": "function"
214 | },
215 | {
216 | "constant": false,
217 | "inputs": [],
218 | "name": "payoutRandomDistr",
219 | "outputs": [],
220 | "payable": false,
221 | "stateMutability": "nonpayable",
222 | "type": "function"
223 | },
224 | {
225 | "constant": false,
226 | "inputs": [],
227 | "name": "payoutRandomDistrAlways",
228 | "outputs": [],
229 | "payable": false,
230 | "stateMutability": "nonpayable",
231 | "type": "function"
232 | },
233 | {
234 | "constant": false,
235 | "inputs": [],
236 | "name": "payoutRandomDistrWhale",
237 | "outputs": [],
238 | "payable": false,
239 | "stateMutability": "nonpayable",
240 | "type": "function"
241 | },
242 | {
243 | "constant": false,
244 | "inputs": [],
245 | "name": "PendinglinesToLines",
246 | "outputs": [],
247 | "payable": false,
248 | "stateMutability": "nonpayable",
249 | "type": "function"
250 | },
251 | {
252 | "constant": false,
253 | "inputs": [
254 | {
255 | "name": "plays",
256 | "type": "uint256"
257 | }
258 | ],
259 | "name": "playProofOfDecreasingOddsALL",
260 | "outputs": [],
261 | "payable": true,
262 | "stateMutability": "payable",
263 | "type": "function"
264 | },
265 | {
266 | "constant": false,
267 | "inputs": [
268 | {
269 | "name": "oddsTaken",
270 | "type": "uint256"
271 | }
272 | ],
273 | "name": "playProofOfDiceRolls",
274 | "outputs": [],
275 | "payable": true,
276 | "stateMutability": "payable",
277 | "type": "function"
278 | },
279 | {
280 | "constant": false,
281 | "inputs": [
282 | {
283 | "name": "oddsTaken",
284 | "type": "uint256"
285 | }
286 | ],
287 | "name": "playProofOfEthRolls",
288 | "outputs": [],
289 | "payable": true,
290 | "stateMutability": "payable",
291 | "type": "function"
292 | },
293 | {
294 | "constant": false,
295 | "inputs": [
296 | {
297 | "name": "plays",
298 | "type": "uint256"
299 | }
300 | ],
301 | "name": "playProofOfIncreasingOdds",
302 | "outputs": [],
303 | "payable": true,
304 | "stateMutability": "payable",
305 | "type": "function"
306 | },
307 | {
308 | "constant": false,
309 | "inputs": [
310 | {
311 | "name": "plays",
312 | "type": "uint256"
313 | }
314 | ],
315 | "name": "playProofOfIncreasingOddsALL",
316 | "outputs": [],
317 | "payable": true,
318 | "stateMutability": "payable",
319 | "type": "function"
320 | },
321 | {
322 | "constant": false,
323 | "inputs": [
324 | {
325 | "name": "plays",
326 | "type": "uint256"
327 | }
328 | ],
329 | "name": "playProofOfIncreasingOddsWhale",
330 | "outputs": [],
331 | "payable": true,
332 | "stateMutability": "payable",
333 | "type": "function"
334 | },
335 | {
336 | "constant": false,
337 | "inputs": [
338 | {
339 | "name": "plays",
340 | "type": "uint256"
341 | }
342 | ],
343 | "name": "playProofOfRediculousBadOdds",
344 | "outputs": [],
345 | "payable": true,
346 | "stateMutability": "payable",
347 | "type": "function"
348 | },
349 | {
350 | "constant": false,
351 | "inputs": [
352 | {
353 | "name": "plays",
354 | "type": "uint256"
355 | }
356 | ],
357 | "name": "playRandomDistribution",
358 | "outputs": [],
359 | "payable": true,
360 | "stateMutability": "payable",
361 | "type": "function"
362 | },
363 | {
364 | "constant": false,
365 | "inputs": [
366 | {
367 | "name": "plays",
368 | "type": "uint256"
369 | }
370 | ],
371 | "name": "playRandomDistributionAlways",
372 | "outputs": [],
373 | "payable": true,
374 | "stateMutability": "payable",
375 | "type": "function"
376 | },
377 | {
378 | "constant": false,
379 | "inputs": [
380 | {
381 | "name": "plays",
382 | "type": "uint256"
383 | }
384 | ],
385 | "name": "playRandomDistributionWhale",
386 | "outputs": [],
387 | "payable": true,
388 | "stateMutability": "payable",
389 | "type": "function"
390 | },
391 | {
392 | "constant": false,
393 | "inputs": [],
394 | "name": "releaseDrip",
395 | "outputs": [],
396 | "payable": false,
397 | "stateMutability": "nonpayable",
398 | "type": "function"
399 | },
400 | {
401 | "constant": false,
402 | "inputs": [],
403 | "name": "releaseVaultLarge",
404 | "outputs": [],
405 | "payable": false,
406 | "stateMutability": "nonpayable",
407 | "type": "function"
408 | },
409 | {
410 | "constant": false,
411 | "inputs": [],
412 | "name": "releaseVaultMedium",
413 | "outputs": [],
414 | "payable": false,
415 | "stateMutability": "nonpayable",
416 | "type": "function"
417 | },
418 | {
419 | "constant": false,
420 | "inputs": [],
421 | "name": "releaseVaultSmall",
422 | "outputs": [],
423 | "payable": false,
424 | "stateMutability": "nonpayable",
425 | "type": "function"
426 | },
427 | {
428 | "constant": false,
429 | "inputs": [
430 | {
431 | "name": "percentage",
432 | "type": "uint256"
433 | }
434 | ],
435 | "name": "setAuto",
436 | "outputs": [],
437 | "payable": false,
438 | "stateMutability": "nonpayable",
439 | "type": "function"
440 | },
441 | {
442 | "constant": false,
443 | "inputs": [],
444 | "name": "takeArbitrageOpportunity",
445 | "outputs": [],
446 | "payable": true,
447 | "stateMutability": "payable",
448 | "type": "function"
449 | },
450 | {
451 | "constant": false,
452 | "inputs": [],
453 | "name": "takeArbitrageOpportunityRisky",
454 | "outputs": [],
455 | "payable": true,
456 | "stateMutability": "payable",
457 | "type": "function"
458 | },
459 | {
460 | "constant": false,
461 | "inputs": [],
462 | "name": "transferEthToHelper",
463 | "outputs": [],
464 | "payable": false,
465 | "stateMutability": "nonpayable",
466 | "type": "function"
467 | },
468 | {
469 | "constant": false,
470 | "inputs": [
471 | {
472 | "name": "_newOwner",
473 | "type": "address"
474 | }
475 | ],
476 | "name": "transferOwnership",
477 | "outputs": [],
478 | "payable": false,
479 | "stateMutability": "nonpayable",
480 | "type": "function"
481 | },
482 | {
483 | "constant": false,
484 | "inputs": [
485 | {
486 | "name": "toPay",
487 | "type": "address"
488 | }
489 | ],
490 | "name": "vaultToWallet",
491 | "outputs": [],
492 | "payable": false,
493 | "stateMutability": "nonpayable",
494 | "type": "function"
495 | },
496 | {
497 | "inputs": [],
498 | "payable": false,
499 | "stateMutability": "nonpayable",
500 | "type": "constructor"
501 | },
502 | {
503 | "payable": true,
504 | "stateMutability": "payable",
505 | "type": "fallback"
506 | },
507 | {
508 | "anonymous": false,
509 | "inputs": [
510 | {
511 | "indexed": true,
512 | "name": "player",
513 | "type": "address"
514 | },
515 | {
516 | "indexed": true,
517 | "name": "bonds",
518 | "type": "uint256"
519 | }
520 | ],
521 | "name": "bondsBought",
522 | "type": "event"
523 | },
524 | {
525 | "anonymous": false,
526 | "inputs": [
527 | {
528 | "indexed": true,
529 | "name": "player",
530 | "type": "address"
531 | },
532 | {
533 | "indexed": true,
534 | "name": "bonds",
535 | "type": "uint256"
536 | }
537 | ],
538 | "name": "forcedBondsBought",
539 | "type": "event"
540 | },
541 | {
542 | "anonymous": false,
543 | "inputs": [
544 | {
545 | "indexed": true,
546 | "name": "player",
547 | "type": "address"
548 | },
549 | {
550 | "indexed": true,
551 | "name": "bonds",
552 | "type": "uint256"
553 | }
554 | ],
555 | "name": "bondsFilled",
556 | "type": "event"
557 | },
558 | {
559 | "anonymous": false,
560 | "inputs": [
561 | {
562 | "indexed": true,
563 | "name": "player",
564 | "type": "address"
565 | },
566 | {
567 | "indexed": true,
568 | "name": "amount",
569 | "type": "uint256"
570 | },
571 | {
572 | "indexed": true,
573 | "name": "settings",
574 | "type": "uint256"
575 | }
576 | ],
577 | "name": "autoReinvested",
578 | "type": "event"
579 | },
580 | {
581 | "anonymous": false,
582 | "inputs": [
583 | {
584 | "indexed": true,
585 | "name": "player",
586 | "type": "address"
587 | },
588 | {
589 | "indexed": true,
590 | "name": "bonds",
591 | "type": "uint256"
592 | }
593 | ],
594 | "name": "newMaturedBonds",
595 | "type": "event"
596 | },
597 | {
598 | "anonymous": false,
599 | "inputs": [
600 | {
601 | "indexed": true,
602 | "name": "previousOwner",
603 | "type": "address"
604 | },
605 | {
606 | "indexed": true,
607 | "name": "newOwner",
608 | "type": "address"
609 | },
610 | {
611 | "indexed": true,
612 | "name": "price",
613 | "type": "uint256"
614 | }
615 | ],
616 | "name": "CEOsold",
617 | "type": "event"
618 | },
619 | {
620 | "anonymous": false,
621 | "inputs": [
622 | {
623 | "indexed": true,
624 | "name": "previousOwner",
625 | "type": "address"
626 | },
627 | {
628 | "indexed": true,
629 | "name": "newOwner",
630 | "type": "address"
631 | },
632 | {
633 | "indexed": true,
634 | "name": "price",
635 | "type": "uint256"
636 | },
637 | {
638 | "indexed": false,
639 | "name": "spot",
640 | "type": "uint256"
641 | }
642 | ],
643 | "name": "Directorsold",
644 | "type": "event"
645 | },
646 | {
647 | "anonymous": false,
648 | "inputs": [
649 | {
650 | "indexed": true,
651 | "name": "player",
652 | "type": "address"
653 | },
654 | {
655 | "indexed": true,
656 | "name": "ethAmount",
657 | "type": "uint256"
658 | }
659 | ],
660 | "name": "cashout",
661 | "type": "event"
662 | },
663 | {
664 | "anonymous": false,
665 | "inputs": [
666 | {
667 | "indexed": true,
668 | "name": "amount",
669 | "type": "uint256"
670 | }
671 | ],
672 | "name": "bondsMatured",
673 | "type": "event"
674 | },
675 | {
676 | "anonymous": false,
677 | "inputs": [
678 | {
679 | "indexed": true,
680 | "name": "_from",
681 | "type": "address"
682 | },
683 | {
684 | "indexed": true,
685 | "name": "_to",
686 | "type": "address"
687 | }
688 | ],
689 | "name": "OwnershipTransferred",
690 | "type": "event"
691 | }
692 | ]
693 |
--------------------------------------------------------------------------------
/client/src/ethereum/troubleshootingviews.json:
--------------------------------------------------------------------------------
1 | [
2 |
3 | {
4 | "constant": false,
5 | "inputs": [],
6 | "name": "acceptOwnership",
7 | "outputs": [],
8 | "payable": false,
9 | "stateMutability": "nonpayable",
10 | "type": "function"
11 | },
12 | {
13 | "constant": false,
14 | "inputs": [
15 | {
16 | "name": "masternode",
17 | "type": "address"
18 | },
19 | {
20 | "name": "referral",
21 | "type": "address"
22 | }
23 | ],
24 | "name": "buyBonds",
25 | "outputs": [],
26 | "payable": true,
27 | "stateMutability": "payable",
28 | "type": "function"
29 | },
30 | {
31 | "constant": false,
32 | "inputs": [],
33 | "name": "buyCEO",
34 | "outputs": [],
35 | "payable": true,
36 | "stateMutability": "payable",
37 | "type": "function"
38 | },
39 | {
40 | "constant": false,
41 | "inputs": [
42 | {
43 | "name": "spot",
44 | "type": "uint256"
45 | }
46 | ],
47 | "name": "buyDirector",
48 | "outputs": [],
49 | "payable": true,
50 | "stateMutability": "payable",
51 | "type": "function"
52 | },
53 | {
54 | "constant": false,
55 | "inputs": [],
56 | "name": "cheatTheLine",
57 | "outputs": [],
58 | "payable": true,
59 | "stateMutability": "payable",
60 | "type": "function"
61 | },
62 | {
63 | "constant": false,
64 | "inputs": [],
65 | "name": "cheatTheLineWhale",
66 | "outputs": [],
67 | "payable": true,
68 | "stateMutability": "payable",
69 | "type": "function"
70 | },
71 | {
72 | "constant": false,
73 | "inputs": [],
74 | "name": "die",
75 | "outputs": [],
76 | "payable": false,
77 | "stateMutability": "nonpayable",
78 | "type": "function"
79 | },
80 | {
81 | "constant": false,
82 | "inputs": [],
83 | "name": "disableAuto",
84 | "outputs": [],
85 | "payable": false,
86 | "stateMutability": "nonpayable",
87 | "type": "function"
88 | },
89 | {
90 | "constant": false,
91 | "inputs": [],
92 | "name": "ethManagementPropagate",
93 | "outputs": [],
94 | "payable": false,
95 | "stateMutability": "nonpayable",
96 | "type": "function"
97 | },
98 | {
99 | "constant": false,
100 | "inputs": [],
101 | "name": "ethPropagate",
102 | "outputs": [],
103 | "payable": false,
104 | "stateMutability": "nonpayable",
105 | "type": "function"
106 | },
107 | {
108 | "constant": false,
109 | "inputs": [],
110 | "name": "exitScam",
111 | "outputs": [],
112 | "payable": false,
113 | "stateMutability": "nonpayable",
114 | "type": "function"
115 | },
116 | {
117 | "constant": false,
118 | "inputs": [],
119 | "name": "fetchP3Ddivs",
120 | "outputs": [],
121 | "payable": false,
122 | "stateMutability": "nonpayable",
123 | "type": "function"
124 | },
125 | {
126 | "constant": false,
127 | "inputs": [
128 | {
129 | "name": "bondsOwner",
130 | "type": "address"
131 | }
132 | ],
133 | "name": "fillBonds",
134 | "outputs": [],
135 | "payable": false,
136 | "stateMutability": "nonpayable",
137 | "type": "function"
138 | },
139 | {
140 | "constant": false,
141 | "inputs": [
142 | {
143 | "name": "bondsOwner",
144 | "type": "address"
145 | },
146 | {
147 | "name": "masternode",
148 | "type": "address"
149 | }
150 | ],
151 | "name": "forceBonds",
152 | "outputs": [],
153 | "payable": false,
154 | "stateMutability": "nonpayable",
155 | "type": "function"
156 | },
157 | {
158 | "constant": false,
159 | "inputs": [
160 | {
161 | "name": "stackOwner",
162 | "type": "address"
163 | },
164 | {
165 | "name": "masternode",
166 | "type": "address"
167 | }
168 | ],
169 | "name": "freelanceReinvest",
170 | "outputs": [],
171 | "payable": false,
172 | "stateMutability": "nonpayable",
173 | "type": "function"
174 | },
175 | {
176 | "constant": false,
177 | "inputs": [],
178 | "name": "helpUnstuckEth",
179 | "outputs": [],
180 | "payable": true,
181 | "stateMutability": "payable",
182 | "type": "function"
183 | },
184 | {
185 | "constant": false,
186 | "inputs": [
187 | {
188 | "name": "who",
189 | "type": "uint256"
190 | }
191 | ],
192 | "name": "managementWithdraw",
193 | "outputs": [],
194 | "payable": false,
195 | "stateMutability": "nonpayable",
196 | "type": "function"
197 | },
198 | {
199 | "constant": false,
200 | "inputs": [],
201 | "name": "payoutCheatLine",
202 | "outputs": [],
203 | "payable": false,
204 | "stateMutability": "nonpayable",
205 | "type": "function"
206 | },
207 | {
208 | "constant": false,
209 | "inputs": [],
210 | "name": "payoutCheatLineWhale",
211 | "outputs": [],
212 | "payable": false,
213 | "stateMutability": "nonpayable",
214 | "type": "function"
215 | },
216 | {
217 | "constant": false,
218 | "inputs": [],
219 | "name": "payoutRandomDistr",
220 | "outputs": [],
221 | "payable": false,
222 | "stateMutability": "nonpayable",
223 | "type": "function"
224 | },
225 | {
226 | "constant": false,
227 | "inputs": [],
228 | "name": "payoutRandomDistrAlways",
229 | "outputs": [],
230 | "payable": false,
231 | "stateMutability": "nonpayable",
232 | "type": "function"
233 | },
234 | {
235 | "constant": false,
236 | "inputs": [],
237 | "name": "payoutRandomDistrWhale",
238 | "outputs": [],
239 | "payable": false,
240 | "stateMutability": "nonpayable",
241 | "type": "function"
242 | },
243 | {
244 | "constant": false,
245 | "inputs": [],
246 | "name": "PendinglinesToLines",
247 | "outputs": [],
248 | "payable": false,
249 | "stateMutability": "nonpayable",
250 | "type": "function"
251 | },
252 | {
253 | "constant": false,
254 | "inputs": [
255 | {
256 | "name": "plays",
257 | "type": "uint256"
258 | }
259 | ],
260 | "name": "playProofOfDecreasingOddsALL",
261 | "outputs": [],
262 | "payable": true,
263 | "stateMutability": "payable",
264 | "type": "function"
265 | },
266 | {
267 | "constant": false,
268 | "inputs": [
269 | {
270 | "name": "oddsTaken",
271 | "type": "uint256"
272 | }
273 | ],
274 | "name": "playProofOfDiceRolls",
275 | "outputs": [],
276 | "payable": true,
277 | "stateMutability": "payable",
278 | "type": "function"
279 | },
280 | {
281 | "constant": false,
282 | "inputs": [
283 | {
284 | "name": "oddsTaken",
285 | "type": "uint256"
286 | }
287 | ],
288 | "name": "playProofOfEthRolls",
289 | "outputs": [],
290 | "payable": true,
291 | "stateMutability": "payable",
292 | "type": "function"
293 | },
294 | {
295 | "constant": false,
296 | "inputs": [
297 | {
298 | "name": "plays",
299 | "type": "uint256"
300 | }
301 | ],
302 | "name": "playProofOfIncreasingOdds",
303 | "outputs": [],
304 | "payable": true,
305 | "stateMutability": "payable",
306 | "type": "function"
307 | },
308 | {
309 | "constant": false,
310 | "inputs": [
311 | {
312 | "name": "plays",
313 | "type": "uint256"
314 | }
315 | ],
316 | "name": "playProofOfIncreasingOddsALL",
317 | "outputs": [],
318 | "payable": true,
319 | "stateMutability": "payable",
320 | "type": "function"
321 | },
322 | {
323 | "constant": false,
324 | "inputs": [
325 | {
326 | "name": "plays",
327 | "type": "uint256"
328 | }
329 | ],
330 | "name": "playProofOfIncreasingOddsWhale",
331 | "outputs": [],
332 | "payable": true,
333 | "stateMutability": "payable",
334 | "type": "function"
335 | },
336 | {
337 | "constant": false,
338 | "inputs": [
339 | {
340 | "name": "plays",
341 | "type": "uint256"
342 | }
343 | ],
344 | "name": "playProofOfRediculousBadOdds",
345 | "outputs": [],
346 | "payable": true,
347 | "stateMutability": "payable",
348 | "type": "function"
349 | },
350 | {
351 | "constant": false,
352 | "inputs": [
353 | {
354 | "name": "plays",
355 | "type": "uint256"
356 | }
357 | ],
358 | "name": "playRandomDistribution",
359 | "outputs": [],
360 | "payable": true,
361 | "stateMutability": "payable",
362 | "type": "function"
363 | },{
364 | "constant": false,
365 | "inputs": [],
366 | "name": "acceptOwnership",
367 | "outputs": [],
368 | "payable": false,
369 | "stateMutability": "nonpayable",
370 | "type": "function"
371 | },{
372 | "constant": true,
373 | "inputs": [],
374 | "name": "amountofp3d",
375 | "outputs": [
376 | {
377 | "name": "",
378 | "type": "uint256"
379 | }
380 | ],
381 | "payable": false,
382 | "stateMutability": "view",
383 | "type": "function"
384 | },
385 | {
386 | "constant": true,
387 | "inputs": [],
388 | "name": "amountPlayed",
389 | "outputs": [
390 | {
391 | "name": "",
392 | "type": "uint256"
393 | }
394 | ],
395 | "payable": false,
396 | "stateMutability": "view",
397 | "type": "function"
398 | },
399 | {
400 | "constant": true,
401 | "inputs": [],
402 | "name": "arbitrageAmountToSend",
403 | "outputs": [
404 | {
405 | "name": "",
406 | "type": "uint256"
407 | }
408 | ],
409 | "payable": false,
410 | "stateMutability": "view",
411 | "type": "function"
412 | },
413 | {
414 | "constant": true,
415 | "inputs": [],
416 | "name": "arbitragePot",
417 | "outputs": [
418 | {
419 | "name": "",
420 | "type": "uint256"
421 | }
422 | ],
423 | "payable": false,
424 | "stateMutability": "view",
425 | "type": "function"
426 | },
427 | {
428 | "constant": true,
429 | "inputs": [],
430 | "name": "arbitragePotRisky",
431 | "outputs": [
432 | {
433 | "name": "",
434 | "type": "uint256"
435 | }
436 | ],
437 | "payable": false,
438 | "stateMutability": "view",
439 | "type": "function"
440 | },
441 | {
442 | "constant": true,
443 | "inputs": [],
444 | "name": "arbitrageRiskyAmountToSend",
445 | "outputs": [
446 | {
447 | "name": "",
448 | "type": "uint256"
449 | }
450 | ],
451 | "payable": false,
452 | "stateMutability": "view",
453 | "type": "function"
454 | },
455 | {
456 | "constant": true,
457 | "inputs": [],
458 | "name": "badOddsPot",
459 | "outputs": [
460 | {
461 | "name": "",
462 | "type": "uint256"
463 | }
464 | ],
465 | "payable": false,
466 | "stateMutability": "view",
467 | "type": "function"
468 | },
469 | {
470 | "constant": true,
471 | "inputs": [
472 | {
473 | "name": "",
474 | "type": "address"
475 | }
476 | ],
477 | "name": "bondsOutstanding",
478 | "outputs": [
479 | {
480 | "name": "",
481 | "type": "uint256"
482 | }
483 | ],
484 | "payable": false,
485 | "stateMutability": "view",
486 | "type": "function"
487 | },
488 | {
489 | "constant": true,
490 | "inputs": [],
491 | "name": "canGetPaidForHelping",
492 | "outputs": [
493 | {
494 | "name": "",
495 | "type": "bool"
496 | }
497 | ],
498 | "payable": false,
499 | "stateMutability": "view",
500 | "type": "function"
501 | },
502 | {
503 | "constant": true,
504 | "inputs": [
505 | {
506 | "name": "",
507 | "type": "uint256"
508 | }
509 | ],
510 | "name": "cheatLine",
511 | "outputs": [
512 | {
513 | "name": "",
514 | "type": "address"
515 | }
516 | ],
517 | "payable": false,
518 | "stateMutability": "view",
519 | "type": "function"
520 | },
521 | {
522 | "constant": true,
523 | "inputs": [],
524 | "name": "cheatLinePot",
525 | "outputs": [
526 | {
527 | "name": "",
528 | "type": "uint256"
529 | }
530 | ],
531 | "payable": false,
532 | "stateMutability": "view",
533 | "type": "function"
534 | },
535 | {
536 | "constant": true,
537 | "inputs": [],
538 | "name": "cheatLinePotWhale",
539 | "outputs": [
540 | {
541 | "name": "",
542 | "type": "uint256"
543 | }
544 | ],
545 | "payable": false,
546 | "stateMutability": "view",
547 | "type": "function"
548 | },
549 | {
550 | "constant": true,
551 | "inputs": [
552 | {
553 | "name": "",
554 | "type": "uint256"
555 | }
556 | ],
557 | "name": "cheatLineWhale",
558 | "outputs": [
559 | {
560 | "name": "",
561 | "type": "address"
562 | }
563 | ],
564 | "payable": false,
565 | "stateMutability": "view",
566 | "type": "function"
567 | },
568 | {
569 | "constant": true,
570 | "inputs": [],
571 | "name": "currentHelper",
572 | "outputs": [
573 | {
574 | "name": "",
575 | "type": "address"
576 | }
577 | ],
578 | "payable": false,
579 | "stateMutability": "view",
580 | "type": "function"
581 | },
582 | {
583 | "constant": true,
584 | "inputs": [],
585 | "name": "decreasingOddsAll",
586 | "outputs": [
587 | {
588 | "name": "",
589 | "type": "uint256"
590 | }
591 | ],
592 | "payable": false,
593 | "stateMutability": "view",
594 | "type": "function"
595 | },
596 | {
597 | "constant": true,
598 | "inputs": [],
599 | "name": "dicerollpot",
600 | "outputs": [
601 | {
602 | "name": "",
603 | "type": "uint256"
604 | }
605 | ],
606 | "payable": false,
607 | "stateMutability": "view",
608 | "type": "function"
609 | },
610 | {
611 | "constant": true,
612 | "inputs": [
613 | {
614 | "name": "account",
615 | "type": "address"
616 | }
617 | ],
618 | "name": "dividendsOwing",
619 | "outputs": [
620 | {
621 | "name": "",
622 | "type": "uint256"
623 | }
624 | ],
625 | "payable": false,
626 | "stateMutability": "view",
627 | "type": "function"
628 | },
629 | {
630 | "constant": true,
631 | "inputs": [],
632 | "name": "ethPendingManagement",
633 | "outputs": [
634 | {
635 | "name": "",
636 | "type": "uint256"
637 | }
638 | ],
639 | "payable": false,
640 | "stateMutability": "view",
641 | "type": "function"
642 | },
643 | {
644 | "constant": true,
645 | "inputs": [],
646 | "name": "ethRollBank",
647 | "outputs": [
648 | {
649 | "name": "",
650 | "type": "uint256"
651 | }
652 | ],
653 | "payable": false,
654 | "stateMutability": "view",
655 | "type": "function"
656 | },
657 | {
658 | "constant": true,
659 | "inputs": [],
660 | "name": "ethStuckOnPLinc",
661 | "outputs": [
662 | {
663 | "name": "",
664 | "type": "uint256"
665 | }
666 | ],
667 | "payable": false,
668 | "stateMutability": "view",
669 | "type": "function"
670 | },
671 | {
672 | "constant": true,
673 | "inputs": [],
674 | "name": "ethtotalSupply",
675 | "outputs": [
676 | {
677 | "name": "",
678 | "type": "uint256"
679 | }
680 | ],
681 | "payable": false,
682 | "stateMutability": "view",
683 | "type": "function"
684 | },
685 | {
686 | "constant": true,
687 | "inputs": [],
688 | "name": "harvestabledivs",
689 | "outputs": [
690 | {
691 | "name": "",
692 | "type": "uint256"
693 | }
694 | ],
695 | "payable": false,
696 | "stateMutability": "view",
697 | "type": "function"
698 | },
699 | {
700 | "constant": true,
701 | "inputs": [
702 | {
703 | "name": "",
704 | "type": "address"
705 | }
706 | ],
707 | "name": "isInLine",
708 | "outputs": [
709 | {
710 | "name": "",
711 | "type": "bool"
712 | }
713 | ],
714 | "payable": false,
715 | "stateMutability": "view",
716 | "type": "function"
717 | },
718 | {
719 | "constant": true,
720 | "inputs": [
721 | {
722 | "name": "",
723 | "type": "address"
724 | }
725 | ],
726 | "name": "isInLineWhale",
727 | "outputs": [
728 | {
729 | "name": "",
730 | "type": "bool"
731 | }
732 | ],
733 | "payable": false,
734 | "stateMutability": "view",
735 | "type": "function"
736 | },
737 | {
738 | "constant": true,
739 | "inputs": [],
740 | "name": "lastdraw",
741 | "outputs": [
742 | {
743 | "name": "",
744 | "type": "uint256"
745 | }
746 | ],
747 | "payable": false,
748 | "stateMutability": "view",
749 | "type": "function"
750 | },
751 | {
752 | "constant": true,
753 | "inputs": [],
754 | "name": "lastdrawAlways",
755 | "outputs": [
756 | {
757 | "name": "",
758 | "type": "uint256"
759 | }
760 | ],
761 | "payable": false,
762 | "stateMutability": "view",
763 | "type": "function"
764 | },
765 | {
766 | "constant": true,
767 | "inputs": [],
768 | "name": "lastdrawWhale",
769 | "outputs": [
770 | {
771 | "name": "",
772 | "type": "uint256"
773 | }
774 | ],
775 | "payable": false,
776 | "stateMutability": "view",
777 | "type": "function"
778 | },
779 | {
780 | "constant": true,
781 | "inputs": [],
782 | "name": "lastInLine",
783 | "outputs": [
784 | {
785 | "name": "",
786 | "type": "uint256"
787 | }
788 | ],
789 | "payable": false,
790 | "stateMutability": "view",
791 | "type": "function"
792 | },
793 | {
794 | "constant": true,
795 | "inputs": [],
796 | "name": "lastInLineWhale",
797 | "outputs": [
798 | {
799 | "name": "",
800 | "type": "uint256"
801 | }
802 | ],
803 | "payable": false,
804 | "stateMutability": "view",
805 | "type": "function"
806 | },
807 | {
808 | "constant": true,
809 | "inputs": [
810 | {
811 | "name": "",
812 | "type": "address"
813 | }
814 | ],
815 | "name": "lineNumber",
816 | "outputs": [
817 | {
818 | "name": "",
819 | "type": "uint256"
820 | }
821 | ],
822 | "payable": false,
823 | "stateMutability": "view",
824 | "type": "function"
825 | },
826 | {
827 | "constant": true,
828 | "inputs": [
829 | {
830 | "name": "",
831 | "type": "address"
832 | }
833 | ],
834 | "name": "lineNumberWhale",
835 | "outputs": [
836 | {
837 | "name": "",
838 | "type": "uint256"
839 | }
840 | ],
841 | "payable": false,
842 | "stateMutability": "view",
843 | "type": "function"
844 | },
845 | {
846 | "constant": true,
847 | "inputs": [
848 | {
849 | "name": "",
850 | "type": "uint256"
851 | }
852 | ],
853 | "name": "management",
854 | "outputs": [
855 | {
856 | "name": "",
857 | "type": "address"
858 | }
859 | ],
860 | "payable": false,
861 | "stateMutability": "view",
862 | "type": "function"
863 | },
864 | {
865 | "constant": true,
866 | "inputs": [
867 | {
868 | "name": "",
869 | "type": "uint256"
870 | }
871 | ],
872 | "name": "manVault",
873 | "outputs": [
874 | {
875 | "name": "",
876 | "type": "uint256"
877 | }
878 | ],
879 | "payable": false,
880 | "stateMutability": "view",
881 | "type": "function"
882 | },
883 | {
884 | "constant": true,
885 | "inputs": [],
886 | "name": "newOwner",
887 | "outputs": [
888 | {
889 | "name": "",
890 | "type": "address"
891 | }
892 | ],
893 | "payable": false,
894 | "stateMutability": "view",
895 | "type": "function"
896 | },
897 | {
898 | "constant": true,
899 | "inputs": [],
900 | "name": "nextInLine",
901 | "outputs": [
902 | {
903 | "name": "",
904 | "type": "uint256"
905 | }
906 | ],
907 | "payable": false,
908 | "stateMutability": "view",
909 | "type": "function"
910 | },
911 | {
912 | "constant": true,
913 | "inputs": [],
914 | "name": "nextInLineWhale",
915 | "outputs": [
916 | {
917 | "name": "",
918 | "type": "uint256"
919 | }
920 | ],
921 | "payable": false,
922 | "stateMutability": "view",
923 | "type": "function"
924 | },
925 | {
926 | "constant": true,
927 | "inputs": [
928 | {
929 | "name": "",
930 | "type": "address"
931 | }
932 | ],
933 | "name": "odds",
934 | "outputs": [
935 | {
936 | "name": "",
937 | "type": "uint256"
938 | }
939 | ],
940 | "payable": false,
941 | "stateMutability": "view",
942 | "type": "function"
943 | },
944 | {
945 | "constant": true,
946 | "inputs": [],
947 | "name": "oddsAll",
948 | "outputs": [
949 | {
950 | "name": "",
951 | "type": "uint256"
952 | }
953 | ],
954 | "payable": false,
955 | "stateMutability": "view",
956 | "type": "function"
957 | },
958 | {
959 | "constant": true,
960 | "inputs": [
961 | {
962 | "name": "",
963 | "type": "address"
964 | }
965 | ],
966 | "name": "oddsWhale",
967 | "outputs": [
968 | {
969 | "name": "",
970 | "type": "uint256"
971 | }
972 | ],
973 | "payable": false,
974 | "stateMutability": "view",
975 | "type": "function"
976 | },
977 | {
978 | "constant": true,
979 | "inputs": [],
980 | "name": "owner",
981 | "outputs": [
982 | {
983 | "name": "",
984 | "type": "address"
985 | }
986 | ],
987 | "payable": false,
988 | "stateMutability": "view",
989 | "type": "function"
990 | },
991 | {
992 | "constant": true,
993 | "inputs": [
994 | {
995 | "name": "",
996 | "type": "address"
997 | }
998 | ],
999 | "name": "pendingFills",
1000 | "outputs": [
1001 | {
1002 | "name": "",
1003 | "type": "uint256"
1004 | }
1005 | ],
1006 | "payable": false,
1007 | "stateMutability": "view",
1008 | "type": "function"
1009 | },
1010 | {
1011 | "constant": true,
1012 | "inputs": [
1013 | {
1014 | "name": "",
1015 | "type": "address"
1016 | }
1017 | ],
1018 | "name": "playerVault",
1019 | "outputs": [
1020 | {
1021 | "name": "",
1022 | "type": "uint256"
1023 | }
1024 | ],
1025 | "payable": false,
1026 | "stateMutability": "view",
1027 | "type": "function"
1028 | },
1029 | {
1030 | "constant": true,
1031 | "inputs": [],
1032 | "name": "podoPotAll",
1033 | "outputs": [
1034 | {
1035 | "name": "",
1036 | "type": "uint256"
1037 | }
1038 | ],
1039 | "payable": false,
1040 | "stateMutability": "view",
1041 | "type": "function"
1042 | },
1043 | {
1044 | "constant": true,
1045 | "inputs": [],
1046 | "name": "pointMultiplier",
1047 | "outputs": [
1048 | {
1049 | "name": "",
1050 | "type": "uint256"
1051 | }
1052 | ],
1053 | "payable": false,
1054 | "stateMutability": "view",
1055 | "type": "function"
1056 | },
1057 | {
1058 | "constant": true,
1059 | "inputs": [],
1060 | "name": "poioPot",
1061 | "outputs": [
1062 | {
1063 | "name": "",
1064 | "type": "uint256"
1065 | }
1066 | ],
1067 | "payable": false,
1068 | "stateMutability": "view",
1069 | "type": "function"
1070 | },
1071 | {
1072 | "constant": true,
1073 | "inputs": [],
1074 | "name": "poioPotAll",
1075 | "outputs": [
1076 | {
1077 | "name": "",
1078 | "type": "uint256"
1079 | }
1080 | ],
1081 | "payable": false,
1082 | "stateMutability": "view",
1083 | "type": "function"
1084 | },
1085 | {
1086 | "constant": true,
1087 | "inputs": [],
1088 | "name": "poioPotWhale",
1089 | "outputs": [
1090 | {
1091 | "name": "",
1092 | "type": "uint256"
1093 | }
1094 | ],
1095 | "payable": false,
1096 | "stateMutability": "view",
1097 | "type": "function"
1098 | },
1099 | {
1100 | "constant": true,
1101 | "inputs": [
1102 | {
1103 | "name": "",
1104 | "type": "uint256"
1105 | }
1106 | ],
1107 | "name": "price",
1108 | "outputs": [
1109 | {
1110 | "name": "",
1111 | "type": "uint256"
1112 | }
1113 | ],
1114 | "payable": false,
1115 | "stateMutability": "view",
1116 | "type": "function"
1117 | },
1118 | {
1119 | "constant": true,
1120 | "inputs": [
1121 | {
1122 | "name": "",
1123 | "type": "uint256"
1124 | }
1125 | ],
1126 | "name": "randomDistr",
1127 | "outputs": [
1128 | {
1129 | "name": "",
1130 | "type": "address"
1131 | }
1132 | ],
1133 | "payable": false,
1134 | "stateMutability": "view",
1135 | "type": "function"
1136 | },
1137 | {
1138 | "constant": true,
1139 | "inputs": [
1140 | {
1141 | "name": "",
1142 | "type": "uint256"
1143 | }
1144 | ],
1145 | "name": "randomDistrAlways",
1146 | "outputs": [
1147 | {
1148 | "name": "",
1149 | "type": "address"
1150 | }
1151 | ],
1152 | "payable": false,
1153 | "stateMutability": "view",
1154 | "type": "function"
1155 | },
1156 | {
1157 | "constant": true,
1158 | "inputs": [
1159 | {
1160 | "name": "",
1161 | "type": "uint256"
1162 | }
1163 | ],
1164 | "name": "randomDistrWhale",
1165 | "outputs": [
1166 | {
1167 | "name": "",
1168 | "type": "address"
1169 | }
1170 | ],
1171 | "payable": false,
1172 | "stateMutability": "view",
1173 | "type": "function"
1174 | },
1175 | {
1176 | "constant": true,
1177 | "inputs": [],
1178 | "name": "randomNext",
1179 | "outputs": [
1180 | {
1181 | "name": "",
1182 | "type": "uint256"
1183 | }
1184 | ],
1185 | "payable": false,
1186 | "stateMutability": "view",
1187 | "type": "function"
1188 | },
1189 | {
1190 | "constant": true,
1191 | "inputs": [],
1192 | "name": "randomNextAlways",
1193 | "outputs": [
1194 | {
1195 | "name": "",
1196 | "type": "uint256"
1197 | }
1198 | ],
1199 | "payable": false,
1200 | "stateMutability": "view",
1201 | "type": "function"
1202 | },
1203 | {
1204 | "constant": true,
1205 | "inputs": [],
1206 | "name": "randomNextWhale",
1207 | "outputs": [
1208 | {
1209 | "name": "",
1210 | "type": "uint256"
1211 | }
1212 | ],
1213 | "payable": false,
1214 | "stateMutability": "view",
1215 | "type": "function"
1216 | },
1217 | {
1218 | "constant": true,
1219 | "inputs": [],
1220 | "name": "randomPot",
1221 | "outputs": [
1222 | {
1223 | "name": "",
1224 | "type": "uint256"
1225 | }
1226 | ],
1227 | "payable": false,
1228 | "stateMutability": "view",
1229 | "type": "function"
1230 | },
1231 | {
1232 | "constant": true,
1233 | "inputs": [],
1234 | "name": "randomPotAlways",
1235 | "outputs": [
1236 | {
1237 | "name": "",
1238 | "type": "uint256"
1239 | }
1240 | ],
1241 | "payable": false,
1242 | "stateMutability": "view",
1243 | "type": "function"
1244 | },
1245 | {
1246 | "constant": true,
1247 | "inputs": [],
1248 | "name": "randomPotWhale",
1249 | "outputs": [
1250 | {
1251 | "name": "",
1252 | "type": "uint256"
1253 | }
1254 | ],
1255 | "payable": false,
1256 | "stateMutability": "view",
1257 | "type": "function"
1258 | },
1259 | {
1260 | "constant": true,
1261 | "inputs": [],
1262 | "name": "Sac3dPot",
1263 | "outputs": [
1264 | {
1265 | "name": "",
1266 | "type": "uint256"
1267 | }
1268 | ],
1269 | "payable": false,
1270 | "stateMutability": "view",
1271 | "type": "function"
1272 | },
1273 | {
1274 | "constant": true,
1275 | "inputs": [],
1276 | "name": "Slaughter3dPot",
1277 | "outputs": [
1278 | {
1279 | "name": "",
1280 | "type": "uint256"
1281 | }
1282 | ],
1283 | "payable": false,
1284 | "stateMutability": "view",
1285 | "type": "function"
1286 | },
1287 | {
1288 | "constant": true,
1289 | "inputs": [],
1290 | "name": "Snip3dPot",
1291 | "outputs": [
1292 | {
1293 | "name": "",
1294 | "type": "uint256"
1295 | }
1296 | ],
1297 | "payable": false,
1298 | "stateMutability": "view",
1299 | "type": "function"
1300 | },
1301 | {
1302 | "constant": true,
1303 | "inputs": [],
1304 | "name": "totalDividendPoints",
1305 | "outputs": [
1306 | {
1307 | "name": "",
1308 | "type": "uint256"
1309 | }
1310 | ],
1311 | "payable": false,
1312 | "stateMutability": "view",
1313 | "type": "function"
1314 | },
1315 | {
1316 | "constant": true,
1317 | "inputs": [],
1318 | "name": "totalSupplyBonds",
1319 | "outputs": [
1320 | {
1321 | "name": "",
1322 | "type": "uint256"
1323 | }
1324 | ],
1325 | "payable": false,
1326 | "stateMutability": "view",
1327 | "type": "function"
1328 | },
1329 | {
1330 | "constant": true,
1331 | "inputs": [],
1332 | "name": "totalSupplyShares",
1333 | "outputs": [
1334 | {
1335 | "name": "",
1336 | "type": "uint256"
1337 | }
1338 | ],
1339 | "payable": false,
1340 | "stateMutability": "view",
1341 | "type": "function"
1342 | },
1343 | {
1344 | "constant": true,
1345 | "inputs": [],
1346 | "name": "unclaimedDividends",
1347 | "outputs": [
1348 | {
1349 | "name": "",
1350 | "type": "uint256"
1351 | }
1352 | ],
1353 | "payable": false,
1354 | "stateMutability": "view",
1355 | "type": "function"
1356 | },
1357 | {
1358 | "constant": true,
1359 | "inputs": [
1360 | {
1361 | "name": "",
1362 | "type": "address"
1363 | }
1364 | ],
1365 | "name": "Vanity",
1366 | "outputs": [
1367 | {
1368 | "name": "",
1369 | "type": "string"
1370 | }
1371 | ],
1372 | "payable": false,
1373 | "stateMutability": "view",
1374 | "type": "function"
1375 | }
1376 | ]
1377 |
--------------------------------------------------------------------------------
/client/src/ethereum/web3.js:
--------------------------------------------------------------------------------
1 | var Web3 = require("web3");
2 |
3 | //window is global only inside the browser
4 | let web3;
5 |
6 | if (typeof window !== "undefined" && typeof window.web3 !== "undefined") {
7 | web3 = new Web3(window.web3.currentProvider);
8 | console.log("MetaMask is running.");
9 | } else {
10 | // If loaded not in browser, or if metakamask in not running...
11 | const provider = new Web3.providers.HttpProvider(
12 | "https://ropsten.infura.io/UkZfSHYlZUsRnBPYPjTO"
13 | );
14 | web3 = new Web3(provider);
15 | console.log("metamask is not running");
16 | }
17 | //need error handling since web3 would be undefined
18 | export default web3;
19 |
--------------------------------------------------------------------------------
/client/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | padding: 0;
4 | font-family: sans-serif;
5 | }
6 |
7 | .vertical-menu {
8 | text-align: center;
9 | width: 250px;
10 | height: 400px;
11 | overflow-y: auto;
12 | }
13 |
--------------------------------------------------------------------------------
/client/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import './index.css';
4 | import App from './App';
5 |
6 | ReactDOM.render( , document.getElementById('root'));
7 |
--------------------------------------------------------------------------------
/client/src/playground.js:
--------------------------------------------------------------------------------
1 | import contract from './contracts/splitter/splitter';
2 | var solc = require('solc');
3 |
4 | function compile(contract) {
5 | console.log('input is a smart contract');
6 | var output = solc.compile(contract);
7 | console.log(JSON.stringify(output));
8 | output.contracts['splitter'].interface;
9 | }
10 |
11 | compile(contract);
12 |
--------------------------------------------------------------------------------
/client/src/registerServiceWorker.js:
--------------------------------------------------------------------------------
1 | // In production, we register a service worker to serve assets from local cache.
2 |
3 | // This lets the app load faster on subsequent visits in production, and gives
4 | // it offline capabilities. However, it also means that developers (and users)
5 | // will only see deployed updates on the "N+1" visit to a page, since previously
6 | // cached resources are updated in the background.
7 |
8 | // To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
9 | // This link also includes instructions on opting out of this behavior.
10 |
11 | const isLocalhost = Boolean(
12 | window.location.hostname === 'localhost' ||
13 | // [::1] is the IPv6 localhost address.
14 | window.location.hostname === '[::1]' ||
15 | // 127.0.0.1/8 is considered localhost for IPv4.
16 | window.location.hostname.match(
17 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
18 | )
19 | );
20 |
21 | export default function register() {
22 | if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
23 | // The URL constructor is available in all browsers that support SW.
24 | const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
25 | if (publicUrl.origin !== window.location.origin) {
26 | // Our service worker won't work if PUBLIC_URL is on a different origin
27 | // from what our page is served on. This might happen if a CDN is used to
28 | // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
29 | return;
30 | }
31 |
32 | window.addEventListener('load', () => {
33 | const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
34 |
35 | if (isLocalhost) {
36 | // This is running on localhost. Lets check if a service worker still exists or not.
37 | checkValidServiceWorker(swUrl);
38 |
39 | // Add some additional logging to localhost, pointing developers to the
40 | // service worker/PWA documentation.
41 | navigator.serviceWorker.ready.then(() => {
42 | console.log(
43 | 'This web app is being served cache-first by a service ' +
44 | 'worker. To learn more, visit https://goo.gl/SC7cgQ'
45 | );
46 | });
47 | } else {
48 | // Is not local host. Just register service worker
49 | registerValidSW(swUrl);
50 | }
51 | });
52 | }
53 | }
54 |
55 | function registerValidSW(swUrl) {
56 | navigator.serviceWorker
57 | .register(swUrl)
58 | .then(registration => {
59 | registration.onupdatefound = () => {
60 | const installingWorker = registration.installing;
61 | installingWorker.onstatechange = () => {
62 | if (installingWorker.state === 'installed') {
63 | if (navigator.serviceWorker.controller) {
64 | // At this point, the old content will have been purged and
65 | // the fresh content will have been added to the cache.
66 | // It's the perfect time to display a "New content is
67 | // available; please refresh." message in your web app.
68 | console.log('New content is available; please refresh.');
69 | } else {
70 | // At this point, everything has been precached.
71 | // It's the perfect time to display a
72 | // "Content is cached for offline use." message.
73 | console.log('Content is cached for offline use.');
74 | }
75 | }
76 | };
77 | };
78 | })
79 | .catch(error => {
80 | console.error('Error during service worker registration:', error);
81 | });
82 | }
83 |
84 | function checkValidServiceWorker(swUrl) {
85 | // Check if the service worker can be found. If it can't reload the page.
86 | fetch(swUrl)
87 | .then(response => {
88 | // Ensure service worker exists, and that we really are getting a JS file.
89 | if (
90 | response.status === 404 ||
91 | response.headers.get('content-type').indexOf('javascript') === -1
92 | ) {
93 | // No service worker found. Probably a different app. Reload the page.
94 | navigator.serviceWorker.ready.then(registration => {
95 | registration.unregister().then(() => {
96 | window.location.reload();
97 | });
98 | });
99 | } else {
100 | // Service worker found. Proceed as normal.
101 | registerValidSW(swUrl);
102 | }
103 | })
104 | .catch(() => {
105 | console.log(
106 | 'No internet connection found. App is running in offline mode.'
107 | );
108 | });
109 | }
110 |
111 | export function unregister() {
112 | if ('serviceWorker' in navigator) {
113 | navigator.serviceWorker.ready.then(registration => {
114 | registration.unregister();
115 | });
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/client/stop.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | docker stop clevis
3 |
--------------------------------------------------------------------------------
/client/tests/clevis.js:
--------------------------------------------------------------------------------
1 | const clevis = require("clevis")
2 | const colors = require('colors')
3 | const chai = require("chai")
4 | const HDWalletProvider = require("truffle-hdwallet-provider")
5 | const assert = chai.assert
6 | const expect = chai.expect;
7 | const should = chai.should();
8 |
9 | const fs = require('fs')
10 | const Web3 = require('web3')
11 | const clevisConfig = JSON.parse(fs.readFileSync("clevis.json").toString().trim())
12 | const web3 = new Web3(
13 | clevisConfig.USE_INFURA ?
14 | new HDWalletProvider(
15 | process.env.mnemonic,
16 | clevisConfig.provider) :
17 | new Web3.providers.HttpProvider(clevisConfig.provider)
18 | );
19 |
20 | //console.log('clevisConfig.provider', clevisConfig.provider);
21 |
22 | function localContractAddress(contract){
23 | return fs.readFileSync(clevisConfig.CONTRACTS_FOLDER+"/"+contract+ "/" + contract + ".address").toString().trim()
24 | }
25 | function localContractAbi(contract){
26 | return JSON.parse(fs.readFileSync(clevisConfig.CONTRACTS_FOLDER+"/"+contract+ "/"+ contract +".abi").toString().trim())
27 | }
28 | function printTxResult(result){
29 | if(!result||!result.transactionHash){
30 | console.log("ERROR".red,"MISSING TX HASH".yellow)
31 | }else{
32 | console.log(tab,result.transactionHash.gray,(""+result.gasUsed).yellow)
33 | }
34 | }
35 | function bigHeader(str){
36 | return "########### "+str+" "+Array(128-str.length).join("#")
37 | }
38 | function rand(min, max) {
39 | return Math.floor( Math.random() * (max - min) + min );
40 | }
41 | function getPaddedHexFromNumber(num,digits){
42 | let hexIs = web3.utils.numberToHex(num).replace("0x","");
43 | while(hexIs.length{
56 | describe('#reload() ', function() {
57 | it('should force browser to reload', async function() {
58 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/../public/reload.txt",Date.now());
59 | });
60 | });
61 | },
62 | version:()=>{
63 | describe('#version() ', function() {
64 | it('should get version', async function() {
65 | this.timeout(90000)
66 | const result = await clevis("version")
67 | console.log(result)
68 | });
69 | });
70 | },
71 | blockNumber:()=>{
72 | describe('#blockNumber() ', function() {
73 | it('should get blockNumber', async function() {
74 | this.timeout(90000)
75 | const result = await clevis("blockNumber")
76 | console.log(result)
77 | });
78 | });
79 | },
80 | compile:(contract)=>{
81 | describe('#compile() '+contract.magenta, function() {
82 | it('should compile '+contract.magenta+' contract to bytecode', async function() {
83 | this.timeout(90000)
84 | const result = await clevis("compile",contract)
85 | console.log(result)
86 | assert(Object.keys(result.contracts).length>0, "No compiled contacts found.")
87 | let count = 0
88 | for(let c in result.contracts){
89 | console.log("\t\t"+"contract "+c.blue+": ",result.contracts[c].bytecode.length)
90 | if(count++==0){
91 | assert(result.contracts[c].bytecode.length > 1, "No bytecode for contract "+c)
92 | }
93 | }
94 | });
95 | });
96 | },
97 | deploy:(contract,accountindex)=>{
98 | describe('#deploy() '+contract.magenta, function() {
99 | it('should deploy '+contract.magenta+' as account '+accountindex, async function() {
100 | this.timeout(360000)
101 | const result = await clevis("deploy",contract,accountindex)
102 | printTxResult(result)
103 | console.log(tab+"Address: "+result.contractAddress.blue)
104 | assert(result.contractAddress)
105 | });
106 | });
107 | },
108 |
109 | publish:()=>{
110 | describe('#publish() ', function() {
111 | it('should inject contract address and abi into web app', async function() {
112 | this.timeout(120000)
113 | const fs = require("fs")
114 | console.log(tab,"Publishing to CRA folder",clevisConfig.CRA_FOLDER)
115 | if(!fs.existsSync(clevisConfig.CRA_FOLDER)){
116 | fs.mkdirSync(clevisConfig.CRA_FOLDER);
117 | }
118 | if(!fs.existsSync(clevisConfig.CRA_FOLDER + "/contracts")){
119 | fs.mkdirSync(clevisConfig.CRA_FOLDER + "/contracts");
120 | }
121 | for(let c in module.exports.contracts){
122 | let thisContract = module.exports.contracts[c]
123 | console.log(tab,thisContract.magenta)
124 | let address = fs.readFileSync(clevisConfig.CONTRACTS_FOLDER + "/" + thisContract+"/"+thisContract+".address").toString().trim()
125 | console.log(tab,"ADDRESS:",address.blue)
126 | assert(address,"No Address!?")
127 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/contracts/"+thisContract+".address.js","module.exports = \""+address+"\"");
128 | let blockNumber = fs.readFileSync(clevisConfig.CONTRACTS_FOLDER +"/" + thisContract + "/"+thisContract+".blockNumber").toString().trim()
129 | console.log(tab,"blockNumber:",blockNumber.blue)
130 | assert(blockNumber,"No blockNumber!?")
131 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/contracts/" + thisContract+".blocknumber.js","module.exports = \""+blockNumber+"\"");
132 | let abi = fs.readFileSync(clevisConfig.CONTRACTS_FOLDER +"/" + thisContract +"/"+thisContract+".abi").toString().trim()
133 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/contracts/" + thisContract+".abi.js","module.exports = "+abi);
134 | let bytecode = fs.readFileSync(clevisConfig.CONTRACTS_FOLDER + "/" + thisContract +"/"+thisContract+".bytecode").toString().trim()
135 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/contracts/" + thisContract+".bytecode.js","module.exports = \""+bytecode+"\"");
136 | }
137 | fs.writeFileSync(clevisConfig.CRA_FOLDER + "/contracts/contracts.js","module.exports = "+JSON.stringify(module.exports.contracts));
138 | module.exports.reload()
139 | });
140 | });
141 | },
142 | metamask:()=>{
143 | describe('#transfer() ', function() {
144 | it('should give metamask account some ether or tokens to test', async function() {
145 | this.timeout(600000)
146 | let result = await clevis("sendTo","0.1","0","0x2a906694D15Df38F59e76ED3a5735f8AAbccE9cb")///<<<-------- change this to your metamask accounts
147 | printTxResult(result)
148 | result = await clevis("sendTo","0.1","0","0x9319bbb4e2652411be15bb74f339b7f6218b2508")///<<<-------- change this to your metamask accounts
149 | printTxResult(result)
150 | //here is an example of running a funtion from within this object:
151 | //module.exports.mintTo("Greens",0,"0x2a906694d15df38f59e76ed3a5735f8aabcce9cb",20)
152 | //view more examples here: https://github.com/austintgriffith/galleass/blob/master/tests/galleass.js
153 | });
154 | });
155 | },
156 |
157 |
158 | ////----------------------------------------------------------------------------///////////////////
159 |
160 |
161 | //// ADD YOUR TESTS HERE <<<<<<<<--------------------------------
162 |
163 |
164 | ////----------------------------------------------------------------------------///////////////////
165 |
166 |
167 | full:()=>{
168 | describe(bigHeader('COMPILE'), function() {
169 | it('should compile all contracts', async function() {
170 | this.timeout(6000000)
171 | const result = await clevis("test","compile")
172 | console.log('result', result);
173 | assert(result==0,"deploy ERRORS")
174 | });
175 | });
176 | describe(bigHeader('FAST'), function() {
177 | it('should run the fast test (everything after compile)', async function() {
178 | this.timeout(6000000)
179 | const result = await clevis("test","fast")
180 | assert(result==0,"fast ERRORS")
181 | });
182 | });
183 | },
184 |
185 | fast:()=>{
186 | describe(bigHeader('DEPLOY'), function() {
187 | it('should deploy all contracts', async function() {
188 | this.timeout(6000000)
189 | const result = await clevis("test","deploy")
190 | assert(result==0,"deploy ERRORS")
191 | });
192 | });
193 | describe(bigHeader('METAMASK'), function() {
194 | it('should deploy all contracts', async function() {
195 | this.timeout(6000000)
196 | const result = await clevis("test","metamask")
197 | assert(result==0,"metamask ERRORS")
198 | });
199 | });
200 | describe(bigHeader('PUBLISH'), function() {
201 | it('should publish all contracts', async function() {
202 | this.timeout(6000000)
203 | const result = await clevis("test","publish")
204 | assert(result==0,"publish ERRORS")
205 | });
206 | });
207 |
208 | },
209 |
210 | }
211 |
212 | checkContractDeployment = async (contract)=>{
213 | const localAddress = localContractAddress(contract)
214 | const address = await clevis("contract","getContract","Example",web3.utils.fromAscii(contract))
215 | console.log(tab,contract.blue+" contract address is "+(localAddress+"").magenta+" deployed as: "+(address+"").magenta)
216 | assert(localAddress==address,contract.red+" isn't deployed correctly!?")
217 | return address
218 | }
219 |
220 |
221 |
222 | //example helper function
223 | /*
224 | makeSureContractHasTokens = async (contract,contractAddress,token)=>{
225 | const TokenBalance = await clevis("contract","balanceOf",token,contractAddress)
226 | console.log(tab,contract.magenta+" has "+TokenBalance+" "+token)
227 | assert(TokenBalance>0,contract.red+" doesn't have any "+token.red)
228 | }
229 |
230 | view more examples here: https://github.com/austintgriffith/galleass/blob/master/tests/galleass.js
231 |
232 | */
233 |
--------------------------------------------------------------------------------
/client/tests/compile.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | for(let c in clevis.contracts){
3 | clevis.compile(clevis.contracts[c])
4 | }
5 |
--------------------------------------------------------------------------------
/client/tests/deploy.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | for(let c in clevis.contracts){
3 | clevis.deploy(clevis.contracts[c],0)
4 | }
5 |
--------------------------------------------------------------------------------
/client/tests/fast.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | clevis.fast()
3 |
--------------------------------------------------------------------------------
/client/tests/full.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | clevis.full()
3 |
--------------------------------------------------------------------------------
/client/tests/metamask.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | clevis.metamask()
3 |
--------------------------------------------------------------------------------
/client/tests/publish.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | clevis.publish()
3 |
--------------------------------------------------------------------------------
/client/tests/version.js:
--------------------------------------------------------------------------------
1 | const clevis = require("./clevis.js")
2 | clevis.version()
3 |
--------------------------------------------------------------------------------
/db/mongoose.js:
--------------------------------------------------------------------------------
1 | var mongoose = require("mongoose");
2 |
3 | mongoose.promise = global.Promise;
4 |
5 | mongoose.connect(
6 | process.env.MONGODB_URI,
7 | { useNewUrlParser: true }
8 | );
9 |
10 | module.exports = { mongoose };
11 |
--------------------------------------------------------------------------------
/models/contract.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 |
3 | var Contract = mongoose.model('Contract', {
4 | contractName: {
5 | type: String
6 | },
7 | abi: {
8 | type: JSON
9 | },
10 | contractAddress: {
11 | type: String
12 | },
13 | network: {
14 | type: String
15 | },
16 | mnemonic: {
17 | type: String
18 | },
19 | creatorAddress: {
20 | type: String
21 | }
22 | });
23 |
24 | module.exports = { Contract };
25 |
--------------------------------------------------------------------------------
/models/user.js:
--------------------------------------------------------------------------------
1 | var mongoose = require('mongoose');
2 |
3 | var User = mongoose.model('User', {
4 | creatorAddress: {
5 | type: String,
6 | required: true
7 | },
8 | savedDapps: {
9 | type: Array
10 | }
11 | });
12 |
13 | module.exports = { User };
14 |
--------------------------------------------------------------------------------
/notes.md:
--------------------------------------------------------------------------------
1 | Setting ENS to resolve to IPFS hash
2 | "setText" function
3 | node bytes32: 0x7407156505d4facdb6474ccee4aac0c34679f5d6fddb603ab6e8976d8e138c02
4 | key: dnslink
5 | value: /ipfs/QmZQ3GzqXHCRM6uccP6TcZdPGPSyqJXyhwLETD2T2o8m73
6 |
7 | Learn about (ENS)[https://docs.ens.domains/en/latest/introduction.html]
8 |
9 | Tools for making calls (assuming you are running a node)
10 | https://github.com/ethereum/ens/blob/master/ensutils.js
11 | loadScript('/path/to/ensutils.js');
12 |
13 | To transfer ownership of the name use `setOwner`
14 | As the deed owner, your account has the right to reset name ownership back to itself at any time, by using `ethRegistrar.finalizeAuction` again. You can also choose to transfer the deed to another account with `transfer`
15 | See more on ownership [https://docs.ens.domains/en/latest/userguide.html]
16 | The ETH used to win the auction will be transfered along with the deed to the new deed owner.
17 | ENS registry name > resolver contract address > your account address
18 | {use graphic}https://docs.ens.domains/en/latest/implementers.html#resolving
19 |
20 | Using https://www.npmjs.com/package/ethereum-ens
21 | to resolve ETH names within a DApp
22 |
23 | Give your contract the ability to use ENS registry https://github.com/ensdomains/ens/blob/master/contracts/ENS.sol
24 |
25 | deploy ens registry
26 | registrar
27 | ens.setOwner(0, registrar.address, {from: web3.eth.accounts[0]});
28 |
29 | then deploy FIFSRegistrar (maybe need to modify this?)
30 |
31 | Consider using setABI if using a standard ABI
32 |
33 | Is setText used to define IPFS hash?
34 |
35 | domain - the complete, human-readable form of a name; eg, ‘vitalik.wallet.eth’.
36 | label - a single component of a domain; eg, ‘vitalik’, ‘wallet’, or ‘eth’. A label may not contain a
37 | period (‘.’).
38 | label hash - the output of the keccak-256 func�on applied to a label; eg, keccak256(‘eth’) =
39 | 0x4f5b812789fc606be1b3b16908db13fc7a9adf7ca72641f84d75b47069d3d7f0.
40 | node - the output of the namehash func�on, used to uniquely iden�fy a name in ENS.
41 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "one-click-dapp",
3 | "version": "0.0.1",
4 | "description": "A simple Node app with SQLite as a database management system, instantly up and running.",
5 | "main": "server.js",
6 | "scripts": {
7 | "start": "concurrently \"npm run server\" \"npm run client\" ",
8 | "server": "node server.js",
9 | "client": "node start-client.js",
10 | "start-production": "npm run build-client && NODE_ENV=production node server",
11 | "build-client": "cd client && npm run build && cd .."
12 | },
13 | "dependencies": {
14 | "body-parser": "^1.18.3",
15 | "eth-registry": "^1.1.8",
16 | "express": "^4.16.3",
17 | "fs": "0.0.2",
18 | "lodash": "^4.17.10",
19 | "mngen": "^1.1.0",
20 | "mocha": "^5.2.0",
21 | "moment": "^2.22.2",
22 | "mongodb": "^2.2.36",
23 | "mongoose": "^5.2.4",
24 | "s3": "^4.4.0",
25 | "web3": "^1.0.0-beta.36"
26 | },
27 | "devDependencies": {
28 | "concurrently": "3.1.0"
29 | },
30 | "engines": {
31 | "node": "8.x"
32 | },
33 | "repository": {
34 | "url": ""
35 | },
36 | "license": "MIT",
37 | "keywords": [
38 | "node",
39 | "glitch",
40 | "express"
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/playgroundserver.js:
--------------------------------------------------------------------------------
1 | require("./db/config");
2 | var { db } = require("./db/mongoose");
3 | var { Contract } = require("./models/contract");
4 | var { User } = require("./models/user");
5 | const _ = require("lodash");
6 |
7 | var walletAddress = "abc";
8 |
9 | User.findOne({ walletAddress }).then(user => {
10 | mnemonics = user.savedDapps;
11 | console.log(mnemonics);
12 | if (mnemonics !== undefined && mnemonics.length > 0) {
13 | Contract.find({ mnemonic: { $in: mnemonics } })
14 | .sort({ _id: -1 })
15 | .then(dapps => {
16 | // createdAt: dapp._id.getTimestamp();
17 | console.log(dapps);
18 | });
19 | }
20 | });
21 |
--------------------------------------------------------------------------------
/readme-assets/chelsea-hello.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/chelsea-hello.png
--------------------------------------------------------------------------------
/readme-assets/chisel-process.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/chisel-process.png
--------------------------------------------------------------------------------
/readme-assets/create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/create.png
--------------------------------------------------------------------------------
/readme-assets/dapp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/dapp.png
--------------------------------------------------------------------------------
/readme-assets/details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/details.png
--------------------------------------------------------------------------------
/readme-assets/instructions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/instructions.png
--------------------------------------------------------------------------------
/readme-assets/security.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/readme-assets/security.png
--------------------------------------------------------------------------------
/screengrab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oneclickdapp/oneclickdapp-v1/b31f0b39e1d6c198dd5a2aa14d8ca9f760d787e8/screengrab.png
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | const Registry = require('eth-registry');
2 | const Web3 = require('web3');
3 |
4 | // Dependencies
5 | const _ = require('lodash');
6 | const express = require('express');
7 | const fs = require('fs');
8 | // Database toolds
9 | const bodyParser = require('body-parser');
10 |
11 | require('./db/config'); // Database login secrets
12 | var { db } = require('./db/mongoose');
13 | var { Contract } = require('./models/contract');
14 | var { User } = require('./models/user');
15 |
16 | var mnGen = require('mngen'); // Random word generator
17 | // process.env.NODE_ENV === 'production'
18 | var app = express();
19 | app.set('port', process.env.PORT || 3001);
20 | // Express only serves static assets in production
21 | app.use(bodyParser.json());
22 |
23 | app.post('/contracts', (req, res) => {
24 | const contractName = req.body.contractName;
25 | const abi = req.body.abi;
26 | const contractAddress = req.body.contractAddress;
27 | const network = req.body.network;
28 | const creatorAddress = req.body.creatorAddress.toLowerCase();
29 | // Generate the mnemonic word for the URL
30 | const mnemonic = mnGen.word(2);
31 | const currentTime = Date.now();
32 |
33 | console.log(' ');
34 | console.log('################## POST #####################');
35 | console.log(
36 | `Name: ${contractName}, network: ${network}, address: ${contractAddress}`
37 | );
38 | console.log(`Creator address: ${creatorAddress}`);
39 | console.log(`Current time: ${currentTime}`);
40 | console.log(`URL: www.oneclickdapp.com/${mnemonic}`);
41 | var contract = new Contract({
42 | contractName: contractName,
43 | abi: abi,
44 | contractAddress: contractAddress,
45 | network: network,
46 | mnemonic: mnemonic,
47 | createdAt: currentTime,
48 | creatorAddress
49 | });
50 |
51 | User.findOneAndUpdate(
52 | { creatorAddress },
53 | { $push: { savedDapps: mnemonic } },
54 | {
55 | upsert: true,
56 | new: true
57 | },
58 | function() {
59 | console.log('User created/updated successfully!');
60 | }
61 | );
62 |
63 | contract.save().then(
64 | doc => {
65 | res.send(doc);
66 | },
67 | e => {
68 | res.status(400).send(e);
69 | }
70 | );
71 | });
72 |
73 | app.get('/contracts/recentContracts', (req, res) => {
74 | Contract.find()
75 | .sort({ _id: -1 })
76 | .limit(50)
77 | .then(contractArray => {
78 | recentContracts = new Array();
79 | contractArray.forEach(contract => {
80 | var contractData = {
81 | contractName: contract.contractName,
82 | network: contract.network,
83 | mnemonic: contract.mnemonic,
84 | createdAt: contract._id.getTimestamp(),
85 | creatorAddress: contract.creatorAddress
86 | };
87 | recentContracts.push(contractData);
88 | });
89 | res.send({
90 | recentContracts
91 | });
92 | })
93 | .catch(function(err) {
94 | res.status(400).send(`Recent contracts not found...`);
95 | console.log(err.err);
96 | });
97 | });
98 |
99 | app.get('/contracts/externalContracts', (req, res) => {
100 | console.log(' ');
101 | console.log('################## GET #####################');
102 | console.log(`Retrieving external contracts`);
103 | let externalContracts = [];
104 | const path = './externalContracts/myEtherWallet/src/contracts/eth';
105 | fs.readdirSync(path).forEach(file => {
106 | const contract = JSON.parse(fs.readFileSync(`${path}/${file}`, 'utf8'));
107 | contract.source = 'MEW Ethereum-lists';
108 | contract.title = contract.name;
109 | externalContracts.push(contract);
110 | });
111 | res.send({
112 | externalContracts
113 | });
114 | });
115 |
116 | app.get('/contracts/:mnemonic', (req, res) => {
117 | var mnemonic = req.params.mnemonic.toLowerCase();
118 | console.log(' ');
119 | console.log('################## GET #####################');
120 | console.log(`Retrieving contract for mnemonic: ${mnemonic}`);
121 |
122 | Contract.find({ mnemonic: mnemonic })
123 | .then(contractArray => {
124 | if (contractArray.length) {
125 | var myContract = contractArray[0];
126 | const contractName = myContract.contractName;
127 | const abi = myContract.abi;
128 | const contractAddress = myContract.contractAddress;
129 | const network = myContract.network;
130 | const createdAt = myContract._id.getTimestamp();
131 |
132 | const provider = new Web3.providers.HttpProvider(
133 | `https://mainnet.infura.io/`
134 | );
135 | const registry = new Registry(provider);
136 | let metaData = {};
137 | registry
138 | .get(contractAddress)
139 | .then(res => {
140 | metaData = res;
141 | res.send({
142 | contractName,
143 | abi,
144 | contractAddress,
145 | network,
146 | createdAt,
147 | metaData
148 | });
149 | })
150 | .catch(e => {
151 | console.error(e);
152 | res.send({
153 | contractName,
154 | abi,
155 | contractAddress,
156 | network,
157 | createdAt,
158 | metaData
159 | });
160 | });
161 | } else {
162 | res.status(400).send(`Contract not found: ${mnemonic}`);
163 | return;
164 | }
165 | })
166 | .catch(function(err) {
167 | res.status(400).send(`Contract not found: ${mnemonic}`);
168 | console.log(err.err);
169 | });
170 | });
171 |
172 | app.get('/user/:creatorAddress', (req, res) => {
173 | var creatorAddress = req.params.creatorAddress.toLowerCase();
174 | console.log(' ');
175 | console.log('################## GET #####################');
176 | console.log(`Retrieving contracts for user address: ${creatorAddress}`);
177 |
178 | User.findOne({ creatorAddress })
179 | .then(user => {
180 | mnemonics = user.savedDapps;
181 | if (mnemonics !== undefined && mnemonics.length > 0) {
182 | Contract.find({ mnemonic: { $in: mnemonics } })
183 | .sort({ _id: -1 })
184 | .then(dapps => {
185 | // createdAt: dapp._id.getTimestamp();
186 | res.send(dapps);
187 | });
188 | } else {
189 | res.status(400).send(`User not found: ${creatorAddress}`);
190 | }
191 | })
192 | .catch(function(err) {
193 | res.status(400).send(`User not found`);
194 | console.log(err.err);
195 | });
196 | });
197 |
198 | // Return the front-end for all other GET calls
199 | if (process.env.NODE_ENV === 'production') {
200 | app.set('port', 80);
201 | app.use(express.static('client/build'));
202 | app.use('*', express.static('client/build'));
203 | }
204 |
205 | app.listen(app.get('port'), () => {
206 | console.log(
207 | `_______________________________________________________________`
208 | );
209 | console.log(` `);
210 | console.log(`################# oneClickDApp API Server ####################`);
211 | console.log(` `);
212 | console.log(`Started on port ${app.get('port')}`);
213 | console.log(`______________________________________________________________`);
214 | console.log(` `);
215 | });
216 |
217 | //allows export app to server.test.js
218 | module.exports = { app };
219 |
--------------------------------------------------------------------------------
/start-client.js:
--------------------------------------------------------------------------------
1 | const args = ["start"];
2 | const opts = { stdio: "inherit", cwd: "client", shell: true };
3 | require("child_process").spawn("npm", args, opts);
4 |
--------------------------------------------------------------------------------