Base infrastructure/contracts deployment dapp (#4726)

* Add deploy dapp

* Filter by dapp id

* WIP

* Contract deployment operational

* Additional contracts

* unicode icons

* Column layout

* app deployment

* DRY up lists

* Remove unused function

* Add basiccoin deployment & tokenreg

* Externalise code

* Check for code versions

* Gavcoin, Email & SMS contracts

* Update to latest email contract

* Deploy & register badges

* Add jg external apps

* Check owner for deleted registry entries

* DRY estimate/post

* Add wallet library to deployment
This commit is contained in:
Jaco Greeff 2017-03-13 12:49:26 +01:00 committed by Gav Wood
parent 2924d0a20f
commit 90a5c9e489
64 changed files with 2804 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,29 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import ReactDOM from 'react-dom';
import React from 'react';
import Application from './chaindeploy/Application';
import '../../assets/fonts/Roboto/font.css';
import '../../assets/fonts/RobotoMono/font.css';
import './style.css';
ReactDOM.render(
<Application />,
document.querySelector('#container')
);

View File

@ -0,0 +1,78 @@
/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
/* This file is part of Parity.
/*
/* Parity is free software: you can redistribute it and/or modify
/* it under the terms of the GNU General Public License as published by
/* the Free Software Foundation, either version 3 of the License, or
/* (at your option) any later version.
/*
/* Parity is distributed in the hope that it will be useful,
/* but WITHOUT ANY WARRANTY; without even the implied warranty of
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/* GNU General Public License for more details.
/*
/* You should have received a copy of the GNU General Public License
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/
.body {
font-size: 0.8em;
.buttons {
position: fixed;
right: 0.5em;
top: 0.5em;
z-index: 100;
button {
background: rgb(0, 200, 255);
border: 2px solid rgba(0, 200, 255, 0.5);
border-radius: 0.25em;
color: white;
cursor: pointer;
font-size: 1em;
margin: 0 0 0 0.5em;
outline: none;
padding: 0.75em 1.5em;
white-space: nowrap;
&:disabled {
background: rgb(230, 230, 230);
border: 2px solid rgba(230, 230, 230, 0.5);
cursor: default;
}
.icon {
fill: white !important;
margin-right: 0.5em;
}
.text {
display: inline-block;
line-height: 24px;
vertical-align: top;
}
}
}
.section {
margin: 0 1em 3em 1em;
h3 {
background: rgba(0, 0, 0, 0.025);
border-radius: 0.25em;
padding: 0.75em 1em;
margin-bottom: 0.5em;
small {
vertical-align: middle;
}
}
.list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
}
}

View File

@ -0,0 +1,178 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import Contract from '../Contract';
import Dapp from '../Dapp';
import Store from '../store';
import styles from './application.css';
@observer
export default class Application extends Component {
store = new Store();
render () {
return (
<div className={ styles.body }>
{ this.renderContracts(false) }
{ this.renderContracts(true) }
{ this.renderApps() }
{ this.renderContracts(false, true) }
{ this.renderApps(true) }
{ this.renderButtons() }
</div>
);
}
renderButton (text, clickHandler, disabled) {
const onClick = (event) => {
if (!disabled) {
clickHandler(event);
}
};
return (
<button
disabled={ disabled }
onClick={ onClick }
>
<div className={ styles.text }>
{ text }
</div>
</button>
);
}
renderButtons () {
const { contractBadgereg, contractDappreg, isBadgeDeploying, isContractDeploying, isDappDeploying, haveAllBadges, haveAllContracts, haveAllDapps, registry } = this.store;
const disableRegistry = registry.address || registry.isDeploying;
const disableContracts = !registry.address || isContractDeploying || haveAllContracts;
const disableDapps = !contractDappreg.address || isDappDeploying || haveAllDapps;
const disableBadges = !registry.address || !contractBadgereg.address || isBadgeDeploying || haveAllBadges;
return (
<div className={ styles.buttons }>
{ this.renderButton('registry', this.deployRegistry, disableRegistry) }
{ this.renderButton('contracts', this.deployContracts, disableContracts) }
{ this.renderButton('badges', this.deployBadges, disableBadges) }
{ this.renderButton('apps', this.deployApps, disableDapps) }
</div>
);
}
renderContracts (isBadges, isExternal) {
const { badges, contracts, contractBadgereg, registry } = this.store;
const regaddress = isBadges
? contractBadgereg.address
: registry.address;
return (
<div className={ styles.section }>
<h3>
{
isExternal
? 'External '
: ''
}{
isBadges
? 'Badges '
: 'Contracts '
}<small>(registry { regaddress || 'unknown' })</small>
</h3>
<div className={ styles.list }>
{
isExternal || isBadges
? null
: (
<Contract
contract={ registry }
key='registry'
/>
)
}
{
(isBadges ? badges : contracts)
.filter((contract) => contract.isExternal === isExternal)
.map((contract) => {
return (
<Contract
contract={ contract }
disabled={ !registry.address }
key={ contract.id }
/>
);
})
}
</div>
</div>
);
}
renderApps (isExternal) {
const { apps, contractDappreg, contractGithubhint } = this.store;
const isDisabled = !contractDappreg.isOnChain || !contractGithubhint.isOnChain;
return (
<div className={ styles.section }>
<h3>
{
isExternal
? 'External '
: ''
}Applications <small>(registry {
contractDappreg.address
? contractDappreg.address
: 'unknown'
})</small>
</h3>
<div className={ styles.list }>
{
apps
.filter((app) => app.isExternal === isExternal)
.map((app) => {
return (
<Dapp
dapp={ app }
disabled={ isDisabled }
key={ app.id }
/>
);
})
}
</div>
</div>
);
}
deployApps = () => {
return this.store.deployApps();
}
deployBadges = () => {
return this.store.deployBadges();
}
deployContracts = () => {
return this.store.deployContracts();
}
deployRegistry = () => {
return this.store.deployRegistry();
}
}

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './application';

View File

@ -0,0 +1,132 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import ListItem, { Header, Row } from '../ListItem';
export default class Contract extends Component {
static propTypes = {
contract: PropTypes.object.isRequired,
disabled: PropTypes.bool
}
render () {
const { contract, disabled } = this.props;
const location = contract.id === 'registry'
? 'chain'
: 'registry';
return (
<ListItem
disabled={ disabled }
status={ contract.status }
>
<Header
isBusy={ contract.isDeploying }
isOk={ !!contract.instance && contract.isOnChain && contract.hasLatestCode }
>
{ contract.id } was {
contract.address
? 'deployed'
: 'not found'
}
</Header>
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ !!contract.address }
>
{
contract.address
? contract.address
: 'no address'
}
</Row>
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ contract.hasLatestCode }
>
{
contract.hasLatestCode
? 'has latest available code'
: 'does not have latest code'
}
</Row>
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ !!contract.isOnChain }
>
{
contract.isOnChain
? `registered on ${location}`
: `not registered on ${location}`
}
</Row>
{ this.renderBadgeInfo() }
</ListItem>
);
}
renderBadgeInfo () {
const { contract } = this.props;
if (!contract.isBadge) {
return null;
}
return [
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ contract.isBadgeRegistered }
key='isBadgeRegistered'
>
{
contract.isBadgeRegistered
? 'found in badgereg'
: 'not found in badgereg'
}
</Row>,
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ !!contract.badgeImageHash }
key='imageHash'
>
{
contract.badgeImageHash
? `badge imageHash ${contract.badgeImageHash}`
: 'has not registered a badge imageHash'
}
</Row>,
<Row
disabled={ !contract.instance }
isBusy={ contract.isDeploying }
isOk={ contract.badgeImageMatch }
key='imageMatch'
>
{
contract.badgeImageMatch
? 'has latest badge imageHash'
: 'does not have latest badge imageHash'
}
</Row>
];
}
}

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './contract';

View File

@ -0,0 +1,98 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import ListItem, { Header, Row } from '../ListItem';
export default class Dapp extends Component {
static propTypes = {
dapp: PropTypes.object.isRequired,
disabled: PropTypes.bool
}
render () {
const { dapp, disabled } = this.props;
return (
<ListItem
disabled={ disabled }
status={ dapp.status }
>
<Header
isBusy={ dapp.isDeploying }
isOk={
dapp.isOnChain &&
!!dapp.imageHash && !!dapp.imageMatch &&
(!dapp.source.contentHash || !!dapp.contentMatch) &&
(!dapp.source.manifestHash || !!dapp.manifestMatch)
}
>
{ dapp.name }
</Header>
<Row
isBusy={ dapp.isDeploying }
isOk={ dapp.isOnChain }
>
{
dapp.isOnChain
? 'found in dappreg'
: 'not found in dappreg'
}
</Row>
{ this.renderHash(dapp, 'image') }
{ this.renderHash(dapp, 'manifest') }
{ this.renderHash(dapp, 'content') }
</ListItem>
);
}
renderHash (dapp, type) {
if (!dapp.source[`${type}Hash`]) {
return null;
}
const isMatch = dapp[`${type}Match`];
const hash = dapp[`${type}Hash`];
return [
<Row
disabled={ !dapp.isOnChain }
isBusy={ dapp.isDeploying }
isOk={ !!hash }
key={ `${type}Hash` }
>
{
hash
? `${type}Hash ${hash}`
: `has not registered an ${type}Hash`
}
</Row>,
<Row
disabled={ !dapp.isOnChain }
isBusy={ dapp.isDeploying }
isOk={ isMatch }
key={ `${type}Match` }
>
{
isMatch
? `has latest ${type}Hash`
: `does not have latest ${type}Hash`
}
</Row>
];
}
}

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './dapp';

View File

@ -0,0 +1,45 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import Icon from '../Icon';
import styles from '../listItem.css';
export default class Header extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
isBusy: PropTypes.bool,
isOk: PropTypes.bool
}
render () {
const { children, isBusy, isOk } = this.props;
return (
<div className={ styles.header }>
<Icon
isBusy={ isBusy }
isOk={ isOk }
/>
<div className={ styles.title }>
{ children }
</div>
</div>
);
}
}

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './header';

View File

@ -0,0 +1,53 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import styles from '../listItem.css';
export default class Icon extends Component {
static propTypes = {
isBusy: PropTypes.bool,
isOk: PropTypes.bool
}
render () {
const { isBusy, isOk } = this.props;
return (
<div
className={
[
styles.icon,
isOk
? styles.ok
: styles.error
].join(' ')
}
>
{
isOk
? '\u2714'
: (
isBusy
? '\u29d6'
: '\u2716'
)
}
</div>
);
}
}

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './icon';

View File

@ -0,0 +1,17 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export default from './row';

View File

@ -0,0 +1,54 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import Icon from '../Icon';
import styles from '../listItem.css';
export default class Row extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
disabled: PropTypes.bool,
isBusy: PropTypes.bool,
isOk: PropTypes.bool
}
render () {
const { children, disabled, isBusy, isOk } = this.props;
return (
<div
className={
[
styles.details,
disabled
? styles.muted
: ''
].join(' ') }
>
<Icon
isBusy={ isBusy }
isOk={ isOk }
/>
<div className={ styles.title }>
{ children }
</div>
</div>
);
}
}

View File

@ -0,0 +1,20 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
export Header from './Header';
export Row from './Row';
export default from './listItem';

View File

@ -0,0 +1,94 @@
/* Copyright 2015-2017 Parity Technologies (UK) Ltd.
/* This file is part of Parity.
/*
/* Parity is free software: you can redistribute it and/or modify
/* it under the terms of the GNU General Public License as published by
/* the Free Software Foundation, either version 3 of the License, or
/* (at your option) any later version.
/*
/* Parity is distributed in the hope that it will be useful,
/* but WITHOUT ANY WARRANTY; without even the implied warranty of
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/* GNU General Public License for more details.
/*
/* You should have received a copy of the GNU General Public License
/* along with Parity. If not, see <http://www.gnu.org/licenses/>.
*/
.listItem {
box-sizing: border-box;
flex: 0 1 33.33%;
max-width: 33.33%;
padding: 0.5em;
position: relative;
.body {
background: rgba(0, 0, 0, 0.025);
border-radius: 0.25em;
box-sizing: border-box;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
overflow: hidden;
padding: 0.75em;
}
.status {
background: #f80;
border-radius: 0.25em;
color: white;
font-size: 0.75em;
line-height: 1em;
opacity: 0.9;
padding: 0.5em;
position: absolute;
right: 1em;
top: 1em;
}
}
.header,
.details {
display: flex;
line-height: 1.5em;
padding: 0.125em 0;
position: relative;
white-space: nowrap;
.title {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: top;
}
}
.details {
margin-left: 2em;
}
.icon {
border-radius: 0.25em;
display: inline-block;
flex: 0 0 1.5em;
height: 1.5em;
margin-right: 0.5em;
opacity: 0.75;
text-align: center;
vertical-align: middle;
width: 1.5em;
&.error {
box-shadow: inset 0 0 0 2px rgb(200, 0, 0);
color: rgb(200, 0, 0);
}
&.ok {
box-shadow: inset 0 0 0 2px rgb(0, 200, 0);
color: rgb(0, 200, 0);
}
}
.muted {
opacity: 0.25;
}

View File

@ -0,0 +1,63 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import React, { Component, PropTypes } from 'react';
import styles from './listItem.css';
export default class ListItem extends Component {
static propTypes = {
children: PropTypes.node.isRequired,
disabled: PropTypes.bool,
status: PropTypes.string
}
render () {
const { children, disabled } = this.props;
return (
<div
className={
[
styles.listItem,
disabled
? styles.muted
: ''
].join(' ')
}
>
<div className={ styles.body }>
{ children }
</div>
{ this.renderStatus() }
</div>
);
}
renderStatus () {
const { status } = this.props;
if (!status) {
return null;
}
return (
<div className={ styles.status }>
{ status }
</div>
);
}
}

View File

@ -0,0 +1,43 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtinsJson from '~/views/Dapps/builtin.json';
const REGISTER_URLS = {
console: 'https://raw.githubusercontent.com/ethcore/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg',
dappreg: 'https://raw.githubusercontent.com/ethcore/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png',
githubhint: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg',
localtx: 'https://raw.githubusercontent.com/ethcore/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png',
registry: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg',
signaturereg: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg',
tokendeploy: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png',
tokenreg: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg',
web: 'https://raw.githubusercontent.com/ethcore/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg'
};
const builtins = builtinsJson
.filter((app) => app.id)
.map((app) => {
app.source = {
imageUrl: REGISTER_URLS[app.id]
};
return app;
});
export {
builtins
};

View File

@ -0,0 +1 @@
[{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalVotes","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"hasSenderVoted","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"},{"name":"_answer","type":"uint256"}],"name":"newAnswer","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setQuestionFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"questionFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"get","outputs":[{"name":"closed","type":"bool"},{"name":"owner","type":"address"},{"name":"question","type":"string"},{"name":"balanceNo","type":"uint256"},{"name":"balanceYes","type":"uint256"},{"name":"balanceMaybe","type":"uint256"},{"name":"votesNo","type":"uint256"},{"name":"votesYes","type":"uint256"},{"name":"votesMaybe","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"drain","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_question","type":"string"}],"name":"newQuestion","outputs":[{"name":"","type":"bool"}],"payable":true,"type":"function"},{"constant":true,"inputs":[],"name":"totalBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"answerFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"}],"name":"closeQuestion","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setAnswerFee","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"index","type":"uint256"},{"indexed":false,"name":"question","type":"string"}],"name":"NewQuestion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"index","type":"uint256"},{"indexed":true,"name":"answer","type":"uint256"},{"indexed":false,"name":"value","type":"uint256"}],"name":"NewAnswer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"old","type":"address"},{"indexed":true,"name":"current","type":"address"}],"name":"NewOwner","type":"event"}]

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/badgereg';
import { compiler, source as sourceUrl, output as byteCode } from './code/badgereg';
const id = 'badgereg';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
{
"compiler": "v0.4.9+commit.364da425",
"source": "https://github.com/ethcore/contracts/blob/225bf022ddd967af2b9ea188e8f611489ca5d7fe/DappReg.sol",
"output": "0x606060405260008054600160a060020a03191633600160a060020a0316179055670de0b6b3a7640000600355341561003357fe5b5b6106ee806100436000396000f300606060405236156100a95763ffffffff60e060020a6000350416630257c48c81146100ab57806306661abd146100d357806313af4035146100f55780631a0919dc1461011357806369fe0e2d146101285780638da5cb5b1461013d5780638eaa6ac01461016957806391cd242d1461019d5780639890220b146101b8578063c52bd836146101ca578063ddca3f43146101eb578063e0886f901461020d578063e1fa8e8414610241575bfe5b34156100b357fe5b6100c160043560243561024e565b60408051918252519081900360200190f35b34156100db57fe5b6100c1610272565b60408051918252519081900360200190f35b34156100fd57fe5b610111600160a060020a0360043516610279565b005b341561011b57fe5b6101116004356102ed565b005b341561013057fe5b610111600435610388565b005b341561014557fe5b61014d6103ad565b60408051600160a060020a039092168252519081900360200190f35b341561017157fe5b61017c6004356103bc565b60408051928352600160a060020a0390911660208301528051918290030190f35b34156101a557fe5b6101116004356024356044356103e4565b005b34156101c057fe5b61011161046d565b005b34156101d257fe5b610111600435600160a060020a03602435166104c0565b005b34156101f357fe5b6100c161054e565b60408051918252519081900360200190f35b341561021557fe5b61017c600435610554565b60408051928352600160a060020a0390911660208301528051918290030190f35b6101116004356105ab565b005b60008281526001602090815260408083208484526002019091529020545b92915050565b6002545b90565b60005433600160a060020a0390811691161461029457610000565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a360008054600160a060020a031916600160a060020a0383161790555b5b50565b60008181526001602081905260409091200154819033600160a060020a0390811691161480159061032d575060005433600160a060020a03908116911614155b1561033757610000565b60008281526001602081905260408083208381559091018054600160a060020a03191690555183917fe17fec26316aebe957e188549d659a89f359c49766bcc0ae2fb7ded274ffe14691a25b5b5050565b60005433600160a060020a039081169116146103a357610000565b60038190555b5b50565b600054600160a060020a031681565b6000818152600160208190526040909120805491810154600160a060020a0316905b50915091565b60008381526001602081905260409091200154839033600160a060020a0390811691161461041157610000565b600084815260016020908152604080832086845260020182529182902084905581518481529151859287927f4dcd4fb147bb133a0da8fbf4e5fc3ddd64f04d4b3f6cbee584374b889d28c78d92918290030190a35b5b50505050565b60005433600160a060020a0390811691161461048857610000565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156104bc57610000565b5b5b565b60008281526001602081905260409091200154829033600160a060020a039081169116146104ed57610000565b60008381526001602081905260408083209091018054600160a060020a031916600160a060020a0386169081179091559051909185917fd3d10d874a10020c2bce719499d1fd8756d880b128eb2945dd01b3830854e7169190a35b5b505050565b60035481565b6000600060006001600060028681548110151561056d57fe5b906000526020600020900160005b50548152602081019190915260400160002080546001820154909450600160a060020a0316925090505b50915091565b6003543410156105ba57610000565b6000818152600160205260409020548190156105d557610000565b60028054600181016105e78382610677565b916000526020600020900160005b508390555060408051808201825283815233600160a060020a0390811660208084018281526000888152600192839052868120955186559051949091018054600160a060020a0319169490931693909317909155915184917f7d917fcbc9a29a9705ff9936ffa599500e4fd902e4486bae317414fe967b307c91a35b5b505b50565b815481835581811511610548576000838152602090206105489181019083016106a1565b5b505050565b61027691905b808211156106bb57600081556001016106a7565b5090565b905600a165627a7a7230582011d8a45e381635e9de17e14cc4de97a1e17758cfac1fd25e8a5bc1d5f4d1da9d0029"
}

View File

@ -0,0 +1,5 @@
{
"compiler": "v0.4.9+commit.364da425",
"source": "https://github.com/ethcore/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GavCoin.sol",
"output": "0x606060405266038d7ea4c680006002556305f5e100600355341561001f57fe5b5b6108008061002f6000396000f300606060405236156100885763ffffffff60e060020a600035041663095ea7b3811461009f57806318160ddd146100d257806323b872dd146100f457806329cbdc861461012d57806355234ec0146101465780635af36e3e1461016857806370a0823114610192578063a035b1fe146101c0578063a9059cbb146101e2578063dd62ed3e14610215575b61009d5b61009a3360ff60020a610249565b5b565b005b34156100a757fe5b6100be600160a060020a0360043516602435610390565b604080519115158252519081900360200190f35b34156100da57fe5b6100e2610416565b60408051918252519081900360200190f35b34156100fc57fe5b6100be600160a060020a036004358116906024351660443561041c565b604080519115158252519081900360200190f35b61009d600160a060020a036004351660243561052a565b005b341561014e57fe5b6100e2610539565b60408051918252519081900360200190f35b341561017057fe5b6100be60043560243561053f565b604080519115158252519081900360200190f35b341561019a57fe5b6100e2600160a060020a03600435166106d0565b60408051918252519081900360200190f35b34156101c857fe5b6100e26106ef565b60408051918252519081900360200190f35b34156101ea57fe5b6100be600160a060020a03600435166024356106f5565b604080519115158252519081900360200190f35b341561021d57fe5b6100e2600160a060020a03600435811690602435166107a3565b60408051918252519081900360200190f35b34600080805b60008411801561026157508460025411155b1561038757600354600254620f424091025b0492508284116102835783610285565b825b9150600254620f4240830281151561029957fe5b33600160a060020a03166000818152600160208181526040808420805497909604968701865560028054855295830190915280832080548701905584548352808320909101805463ffffffff191662093a80420163ffffffff161790558154850182559254925193945084937f689dcb02b6a65e0e2f1d23ef47c1ec86604ffbed0bcb65f20150cfc7d5e5a9489190a4600380548290039081905593829003931515610382576002805466038d7ea4c6800001908190556305f5e1006003556040517f23c3dae768238f239632b5c4acb89485b440e0fa72481c4aad9f9b4f9b5a0a5f90600090a25b61024f565b5b505050505050565b600082600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a350600160a060020a0333811660009081526001602081815260408084209487168452600290940190529190208054830190555b92915050565b60005481565b600160a060020a038316600090815260016020526040812054849083908190101561044657610521565b600160a060020a0380871660009081526001602090815260408083203394851684526002019091529020548791908690819010156104835761051c565b87600160a060020a031689600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3600160a060020a03808a166000908152600160208181526040808420338616855260028101835281852080548e900390559183905281548c9003909155928b16825291902080548901905595505b5b5050505b50509392505050565b6105348282610249565b5b5050565b60035481565b600160a060020a0333166000908152600160208181526040808420868552909201905281205483908390819010806105a35750600160a060020a03331660009081526001602081815260408084208685528301909152909120015463ffffffff1642105b156105ad576106c8565b33600160a060020a0381166000908152600160205260409020548590819010156105d6576106c4565b60405186908890600160a060020a033316907f73f04af9dcc582a923ec15d3eea990fe34adabfff2879e28d44572e01a54abb690600090a433600160a060020a0316600090815260016020818152604080842080548b9003815584548b0185558b855290920190529020805487900390819055151561068457600160a060020a03331660009081526001602081815260408084208b85528301909152822091825501805463ffffffff191690555b600160a060020a0333166108fc620f4240888a025b604051919004801590920291906000818181858888f1935050505015156106bf57610000565b600194505b5b50505b505092915050565b600160a060020a0381166000908152600160205260409020545b919050565b60025481565b33600160a060020a038116600090815260016020526040812054909190839081901015610721576106c8565b84600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600160a060020a03338116600090815260016020526040808220805488900390559187168152208054850190555b5b505092915050565b600160a060020a03808316600090815260016020908152604080832093851683526002909301905220545b929150505600a165627a7a72305820ca533a37c92e41888bda66ae0e66415d21a61c60027b269bca633d85b727875c0029"
}

View File

@ -0,0 +1,5 @@
{
"compiler": "v0.4.9+commit.364da425",
"source": "https://github.com/ethcore/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/GithubHint.sol",
"output": "0x6060604052341561000c57fe5b5b6105868061001c6000396000f300606060405263ffffffff60e060020a60003504166302f2008d81146100425780632196ae0d1461009b578063267b6922146101055780637c8c6643146101c9575bfe5b341561004a57fe5b60408051602060046024803582810135601f810185900485028601850190965285855261009995833595939460449493929092019181908401838280828437509496506101de95505050505050565b005b34156100a357fe5b60408051602060046024803582810135601f81018590048502860185019096528585526100999583359593946044949392909201918190840183828082843750949650505092356bffffffffffffffffffffffff191692506102be915050565b005b341561010d57fe5b6101186004356103b1565b604080516bffffffffffffffffffffffff1984166020820152600160a060020a03831691810191909152606080825284546002600019610100600184161502019091160490820181905281906080820190869080156101b85780601f1061018d576101008083540402835291602001916101b8565b820191906000526020600020905b81548152906001019060200180831161019b57829003601f168201915b505094505050505060405180910390f35b34156101d157fe5b6100996004356103de565b005b6000828152602081905260409020600201548290600160a060020a031615801590610227575060008181526020819052604090206002015433600160a060020a03908116911614155b15610231576102b8565b6040805160608101825283815260006020808301829052600160a060020a0333168385015286825281815292902081518051929391926102749284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b505050565b6000838152602081905260409020600201548390600160a060020a031615801590610307575060008181526020819052604090206002015433600160a060020a03908116911614155b15610311576103aa565b604080516060810182528481526bffffffffffffffffffffffff198416602080830191909152600160a060020a0333168284015260008781528082529290922081518051929391926103669284920190610472565b506020820151600182018054606060020a909204600160a060020a031992831617905560409092015160029091018054600160a060020a0392909216919092161790555b5b50505050565b600060208190529081526040902060018101546002820154606060020a90910290600160a060020a031683565b6000818152602081905260409020600201548190600160a060020a031615801590610427575060008181526020819052604090206002015433600160a060020a03908116911614155b156104315761046d565b60008281526020819052604081209061044a82826104f1565b50600181018054600160a060020a03199081169091556002909101805490911690555b5b5050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104b357805160ff19168380011785556104e0565b828001600101855582156104e0579182015b828111156104e05782518255916020019190600101906104c5565b5b506104ed929150610539565b5090565b50805460018160011615610100020316600290046000825580601f106105175750610535565b601f0160209004906000526020600020908101906105359190610539565b5b50565b61055791905b808211156104ed576000815560010161053f565b5090565b905600a165627a7a72305820a83571409e7b0cc4fe48edd09087f315930ab4e017c62b6d100462285a8f4ae70029"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
{
"compiler": "v0.4.9+commit.364da425",
"source": "https://github.com/ethcore/contracts/blob/58842b92c00e3c45a84b6d0ac9b842f016dde50a/SignatureReg.sol",
"output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600255341561002a57fe5b5b60408051808201909152601081527f726567697374657228737472696e67290000000000000000000000000000000060208201526100759064010000000061036661007c82021704565b505b61031c565b60006100f7826040518082805190602001908083835b602083106100b15780518252601f199092019160209182019101610092565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836100ff640100000000026103d6176401000000009004565b90505b919050565b7fffffffff000000000000000000000000000000000000000000000000000000008216600090815260016020819052604082205484916002908216156101000260001901909116041561015157610274565b7fffffffff000000000000000000000000000000000000000000000000000000008416600090815260016020908152604090912084516101939286019061027c565b5060028054600101905560408051602080825285518183015285517fffffffff00000000000000000000000000000000000000000000000000000000881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b293899391928392908301918501908083838215610236575b80518252602083111561023657601f199092019160209182019101610216565b505050905090810190601f1680156102625780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106102bd57805160ff19168380011785556102ea565b828001600101855582156102ea579182015b828111156102ea5782518255916020019190600101906102cf565b5b506102f79291506102fb565b5090565b61031991905b808211156102f75760008155600101610301565b5090565b90565b6105d78061032b6000396000f3006060604052361561005c5763ffffffff60e060020a60003504166313af4035811461005e5780633015a5211461007c5780638da5cb5b1461009e5780639890220b146100ca578063b46bcdaa146100dc578063f2c298be14610179575bfe5b341561006657fe5b61007a600160a060020a03600435166101e3565b005b341561008457fe5b61008c610264565b60408051918252519081900360200190f35b34156100a657fe5b6100ae61026a565b60408051600160a060020a039092168252519081900360200190f35b34156100d257fe5b61007a610279565b005b34156100e457fe5b6100f9600160e060020a0319600435166102cc565b60408051602080825283518183015283519192839290830191850190808383821561013f575b80518252602083111561013f57601f19909201916020918201910161011f565b505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018157fe5b6101cf600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284375094965061036695505050505050565b604080519115158252519081900360200190f35b60005433600160a060020a039081169116146101fe57610260565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b60025481565b600054600160a060020a031681565b60005433600160a060020a03908116911614610294576102c8565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156102c857610000565b5b5b565b60016020818152600092835260409283902080548451600294821615610100026000190190911693909304601f810183900483028401830190945283835291929083018282801561035e5780601f106103335761010080835404028352916020019161035e565b820191906000526020600020905b81548152906001019060200180831161034157829003601f168201915b505050505081565b60006103ce826040518082805190602001908083835b6020831061039b5780518252601f19909201916020918201910161037c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020836103d6565b90505b919050565b600160e060020a03198216600090815260016020819052604082205484916002908216156101000260001901909116041561041057610503565b600160e060020a031984166000908152600160209081526040909120845161043a9286019061050b565b506002805460010190556040805160208082528551818301528551600160e060020a0319881693600160a060020a033316937f50e01e16719d6c699e516c57f4c514e77f6bc21a978d33f23980acdddbcbd0b2938993919283929083019185019080838382156104c5575b8051825260208311156104c557601f1990920191602091820191016104a5565b505050905090810190601f1680156104f15780820380516001836020036101000a031916815260200191505b509250505060405180910390a3600191505b5b5092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061054c57805160ff1916838001178555610579565b82800160010185558215610579579182015b8281111561057957825182559160200191906001019061055e565b5b5061058692915061058a565b5090565b6105a891905b808211156105865760008155600101610590565b5090565b905600a165627a7a723058206830357dde798fafa19dd78a4460c047f76cc132713db13442c5da7485fc0ff40029"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,5 @@
{
"compiler": "v0.4.9+commit.364da425",
"source": "https://github.com/ethcore/contracts/blob/e5afdacc716ca743ceddf80978d4e6b2b465dbe9/ProofOfEmail.sol",
"output": "0x606060405260008054600160a060020a03191633600160a060020a0316178155600355341561002a57fe5b5b6108a48061003a6000396000f300606060405236156100ca5763ffffffff60e060020a60003504166306b2ff4781146100cc57806313af4035146100fc5780632650b9881461011a5780634b59e8801461018c57806359c87d70146101b05780636795dbcd146101bd57806369fe0e2d1461023057806370c4d5f214610245578063797af627146103255780638da5cb5b1461034c5780639890220b14610378578063ac72c1201461038a578063cc1d4c02146103b1578063ddca3f43146103e1578063df57b74214610403578063e30bd74014610432575bfe5b34156100d457fe5b6100e8600160a060020a03600435166104ce565b604080519115158252519081900360200190f35b341561010457fe5b610118600160a060020a03600435166104d6565b005b341561012257fe5b60408051602060046024803582810135601f810185900485028601850190965285855261017a958335600160a060020a0316959394604494939290920191819084018382808284375094965061055795505050505050565b60408051918252519081900360200190f35b341561019457fe5b610118600160a060020a0360043516602435604435610577565b005b6101186004356105eb565b005b34156101c557fe5b60408051602060046024803582810135601f8101859004850286018501909652858552610214958335959394604494939290920191819084018382808284375094965061063595505050505050565b60408051600160a060020a039092168252519081900360200190f35b341561023857fe5b610118600435610654565b005b341561024d57fe5b60408051602060046024803582810135601f81018590048502860185019096528585526102a5958335600160a060020a0316959394604494939290920191819084018382808284375094965061067995505050505050565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561032d57fe5b6100e8600435610688565b604080519115158252519081900360200190f35b341561035457fe5b610214610791565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101186107a0565b005b341561039257fe5b6100e86004356107f3565b604080519115158252519081900360200190f35b34156103b957fe5b6100e8600160a060020a0360043516610813565b604080519115158252519081900360200190f35b34156103e957fe5b61017a610834565b60408051918252519081900360200190f35b341561040b57fe5b61021460043561083a565b60408051600160a060020a039092168252519081900360200190f35b341561043a57fe5b6102a5600160a060020a0360043516610858565b6040805160208082528351818301528351919283929083019185019080838382156102eb575b8051825260208311156102eb57601f1990920191602091820191016102cb565b505050905090810190601f1680156103175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60005b919050565b60005433600160a060020a039081169116146104f157610553565b60008054604051600160a060020a03808516939216917f70aea8d848e8a90fb7661b227dc522eb6395c3dac71b63cb59edd5c9899b236491a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a0382166000908152600260205260409020545b92915050565b60005433600160a060020a03908116911614610592576105e5565b600082815260046020908152604091829020839055815184815291518392600160a060020a038716927f76babef7e9f1065118be3f9d7094016a1cc06dd12811501c7712deb22144f37b92918290030190a35b5b505050565b6003543410156105fa57610553565b6040518190600160a060020a033316907f070669e6be82aa9b077a096b0f9617893a4dc5cb05897e27fd7a6112c8e6629e90600090a35b5b50565b600082815260016020526040902054600160a060020a03165b92915050565b60005433600160a060020a0390811691161461066f57610553565b60038190555b5b50565b610571610866565b5b92915050565b6040805182815281516020918190038201902060009081526004909152908120548015156106b55761078b565b6040805184815281516020918190038201902060009081526004825282812081905583815260019091522054600160a060020a031615158061070e5750600160a060020a03331660009081526002602052604090205415155b156107185761078b565b6000818152600160209081526040808320805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a031690811790915580845260029092528083208490555190917fd415b905d4dd806bfba99a7a0e6351bd0c9db3a9912add21c0e6bef4479f673f91a2600191505b50919050565b600054600160a060020a031681565b60005433600160a060020a039081169116146107bb576107ef565b604051600160a060020a0333811691309091163180156108fc02916000818181858888f1935050505015156107ef57610000565b5b5b565b600081815260016020526040902054600160a060020a031615155b919050565b600160a060020a03811660009081526002602052604090205415155b919050565b60035481565b600081815260016020526040902054600160a060020a03165b919050565b6104d1610866565b5b919050565b604080516020810190915260008152905600a165627a7a7230582081d03388dd06c78ee4098c4f1e23cd3c25e38d249d5da59962c6b28ec6e20ea70029"
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/dappreg';
import { compiler, source as sourceUrl, output as byteCode } from './code/dappreg';
const id = 'dappreg'; // 7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,32 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/gavcoin';
import { compiler, source as sourceUrl, output as byteCode } from './code/gavcoin';
const isExternal = true;
const id = 'gavcoin';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
isExternal,
sourceUrl
};

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/githubhint';
import { compiler, source as sourceUrl, output as byteCode } from './code/githubhint';
const id = 'githubhint';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,52 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import * as badgereg from './badgereg';
import * as dappreg from './dappreg';
import * as gavcoin from './gavcoin';
import * as githubhint from './githubhint';
import * as jgvoting from './jg-voting';
import * as registry from './registry';
import * as signaturereg from './signaturereg';
import * as tokendeployMgr from './tokendeployMgr';
import * as tokendeployReg from './tokendeployReg';
import * as tokenreg from './tokenreg';
import * as verifyEmail from './verifyEmail';
import * as verifySms from './verifySms';
import * as wallet from './wallet';
const contracts = [
// builtin
githubhint,
badgereg,
dappreg,
signaturereg,
tokenreg,
tokendeployReg,
tokendeployMgr,
verifyEmail,
verifySms,
wallet,
// external
gavcoin,
jgvoting
];
export {
contracts,
registry
};

View File

@ -0,0 +1,32 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from './abi/jg-voting';
import { compiler, source as sourceUrl, output as byteCode } from './code/jg-voting';
const isExternal = true;
const id = 'jg-voting';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
isExternal,
sourceUrl
};

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/registry2';
import { compiler, source as sourceUrl, output as byteCode } from './code/registry';
const id = 'registry';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/signaturereg';
import { compiler, source as sourceUrl, output as byteCode } from './code/signaturereg';
const id = 'signaturereg';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/basiccoinmanager';
import { compiler, source as sourceUrl, output as byteCode } from './code/tokendeploy';
const id = 'basiccoinmgr';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,28 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { abi, sourceUrl, deployParams, compiler, byteCode } from './tokenreg';
const id = 'basiccoinreg';
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,30 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/tokenreg';
import { compiler, source as sourceUrl, output as byteCode } from './code/tokenreg';
const id = 'tokenreg';
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,37 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/email-verification';
import { compiler, source as sourceUrl, output as byteCode } from './code/verifyEmail';
const isBadge = true;
const id = 'emailverification';
const deployParams = [];
const badgeSource = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/c4721a87cb95375da91f8699438d8d7907b3f5e9/certifications/email-verification.svg',
imageHash: '0x5617a14da2a0c210939da6eafb734e60906f64a504c3e107812668860a752dc6'
};
export {
abi,
badgeSource,
byteCode,
compiler,
deployParams,
id,
isBadge,
sourceUrl
};

View File

@ -0,0 +1,37 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import abi from '~/contracts/abi/sms-verification';
import { compiler, source as sourceUrl, output as byteCode } from './code/verifySms';
const isBadge = true;
const id = 'smsverification';
const deployParams = [];
const badgeSource = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/1b1beb57ab1f4d3a93a12711b233b5cded791a2f/certifications/sms-verification.svg',
imageHash: '0x49fa653c35c0a9ce128579883babd673ad4cfc94bf9f1cfe96a2bbc30a7552c6'
};
export {
abi,
badgeSource,
byteCode,
compiler,
deployParams,
id,
isBadge,
sourceUrl
};

View File

@ -0,0 +1,29 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { walletCompiler as compiler, walletLibrary as byteCode, walletLibraryABI as abiJson, walletLibraryRegKey as id, walletSource as sourceUrl } from '~/contracts/code/wallet';
const abi = JSON.parse(abiJson);
const deployParams = [];
export {
abi,
byteCode,
compiler,
deployParams,
id,
sourceUrl
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'console';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg',
imageHash: '0xc3962e2eab7afaeb9cd11522381723afbafdc41dc7ba31bee472e187c4459e81'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'dappreg';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/legos-64x64.png',
imageHash: '0xa8feea35c761cc6c2fe862fe336419f11ca5421f578757720a899b89fc1df154'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,41 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { api } from '../parity';
const isExternal = true;
const id = 'gavcoin';
const hashId = api.util.sha3(id);
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/9e135f76fe9ba61e2d8ccbd72ed144c26c450780/tokens/gavcoin-64x64.png',
imageHash: '0xd40679a3a234d8421c678d64f4df3308859e8ad07ac95ce4a228aceb96955287',
manifestUrl: 'https://raw.githubusercontent.com/gavofyork/gavcoin/eb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba/manifest.json',
manifestHash: '0xd582c572fbef8015837f2c1a8798f2c3149a1d9d655b4020edb1bbece725371d',
contentUrl: {
repo: 'gavofyork/gavcoin',
commit: '0xeb2f8dc4d3ad4dd5f4562690525b7cfedc9681ba'
},
contentHash: '0x0b6c7b3fc8dad3edb39fd1465904ce9a11938ef18f08f8115f275047ba249530'
};
const name = 'GavCoin';
export {
hashId,
id,
isExternal,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'githubhint';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/link-64x64.jpg',
imageHash: '0x6568901e711886e2c61eef1bbc7e2d8d37a27b9eb3e9e270eda8548f2ec796e8'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,50 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import * as consolejs from './console';
import * as dappreg from './dappreg';
import * as gavcoin from './gavcoin';
import * as githubhint from './githubhint';
import * as jgvoting from './jg-voting';
import * as jgwhenblock from './jg-whenblock';
import * as localtx from './localtx';
import * as registry from './registry';
import * as signaturereg from './signaturereg';
import * as tokendeploy from './tokendeploy';
import * as tokenreg from './tokenreg';
import * as web from './web';
const apps = [
// builtin
consolejs,
dappreg,
githubhint,
localtx,
registry,
signaturereg,
tokendeploy,
tokenreg,
web,
// external
gavcoin,
jgvoting,
jgwhenblock
];
export {
apps
};

View File

@ -0,0 +1,41 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { api } from '../parity';
const isExternal = true;
const id = 'jg-voting';
const hashId = api.util.sha3(id);
const source = {
imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/038ff4074544f2babc7aed9c4ac3dc070b85b804/assets/images/vote.jpg',
imageHash: '0x3620828e1a745d2714e9f37dc2d47cdab5ef9982190a845b5e7665b7a7767661',
manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-voting/682f0fe4b86508a1a2487de6c7c61f7b100ba5b2/manifest.json',
manifestHash: '0x9b83e01f87d225e7bfdd305c51319504ff9b4cf8d517ca4b64f606762e72f59e',
contentUrl: {
repo: 'jacogr/dapp-voting',
commit: '0x7d941597e862a600a60b9d6ecd3a6f606d96cd7b'
},
contentHash: '0x9fcc0910f6a8c4e45715d41aea2d287da31bf1d7321003fc66df6a012ce2d753'
};
const name = 'Yes, No, Maybe';
export {
hashId,
id,
isExternal,
name,
source
};

View File

@ -0,0 +1,39 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
const isExternal = true;
const id = 'whenarewethere';
const hashId = '0xfef3bfded03695e38a9ff476a0999e1fa421e72d1fb3b55a87d6c2bdb6fc18ef';
const source = {
imageUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/167aa4d904c5aa6246d0d6d6f41c4ed8a56889cd/assets/images/clock.jpg',
imageHash: '0x2534b44f685b6399bf63f86679128216c43e9a58be1dfb58533923f0bcffeba7',
manifestUrl: 'https://raw.githubusercontent.com/jacogr/dapp-when-are-we-there/bf72dc3033711a3ab41bec3c1249638f70bae768/manifest.json',
manifestHash: '0xfe26f6a19ea9393d69bc5d8c73c5072ccf126f51c10c135b42d6bf162d774fd9',
contentUrl: {
repo: 'jacogr/dapp-when-are-we-there',
commit: '0xbf72dc3033711a3ab41bec3c1249638f70bae768'
},
contentHash: '0x3505cbbef5c2243eedba07d340d4abccfaa3cfb799f51827e33c9721a5254d13'
};
const name = 'When are we there';
export {
hashId,
id,
isExternal,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'localtx';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/cdd6ac4f1e2f11619bed72a53ae71217dffe19ad/dapps/stack-64x64.png',
imageHash: '0x22b924801e1971659a51956dcdfc5a2d592d8bdd03780dd72d5bc4c84b595b4c'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'registry';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/register-64x64.jpg',
imageHash: '0xf7100024052cd78b5e043287c05392b5db0bfce5caedd6d39555d40283ef0a1c'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'signaturereg';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/hex-64x64.jpg',
imageHash: '0x26f7f2415cd5cbbffa58e8119fdbdd7181cac79119dd7f6ba6ee99d7f4445640'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'tokendeploy';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/interlock-64x64.png',
imageHash: '0xde104baf02aec783e0bffc624514ee267dbcb455382375e3ffa715790c1c939f'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'tokenreg';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/b88e983abaa1a6a6345b8d9448c15b117ddb540e/dapps/coins-64x64.jpg',
imageHash: '0xe23d429d15de98c7878d92bc90b79c7afabe1b04c2ad5e3e2c89adc8f439edc9'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,33 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import builtins from '~/views/Dapps/builtin.json';
const id = 'web';
const app = builtins.find((app) => app.url === id);
const hashId = app.id;
const source = {
imageUrl: 'https://raw.githubusercontent.com/ethcore/dapp-assets/ec6138115d0e1f45258969cd90b3b274e0ff2258/dapps/earth-64x64.jpg',
imageHash: '0x0b9b62a9262f75461191d4e8bf686c56528cbc0fe885c1f5878052ca8b2f65bf'
};
const name = app.name;
export {
hashId,
id,
name,
source
};

View File

@ -0,0 +1,21 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
const api = window.parity.api;
export {
api
};

View File

@ -0,0 +1,714 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { action, computed, observable } from 'mobx';
import { contracts as contractsInfo, registry as registryInfo } from './contracts';
import { apps } from './dapps';
import { api } from './parity';
import { executeContract, isValidNumber, validateCode } from './utils';
export default class ContractsStore {
@observable apps = null;
@observable badges = null;
@observable contracts = null;
@observable error = null;
@observable registry = null;
constructor () {
this.apps = apps;
this.badges = contractsInfo.filter((contract) => contract.isBadge);
this.contracts = contractsInfo.filter((contract) => !contract.isBadge);
this.registry = registryInfo;
api.subscribe('eth_blockNumber', this.onNewBlockNumber);
}
@computed get contractBadgereg () {
return this.contracts.find((contract) => contract.id === 'badgereg');
}
@computed get contractDappreg () {
return this.contracts.find((contract) => contract.id === 'dappreg');
}
@computed get contractGithubhint () {
return this.contracts.find((contract) => contract.id === 'githubhint');
}
@computed get contractTokenreg () {
return this.contracts.find((contract) => contract.id === 'tokenreg');
}
@computed get isBadgeDeploying () {
return this.badges
.filter((contract) => contract.isDeploying)
.length !== 0;
}
@computed get isContractDeploying () {
return this.contracts
.filter((contract) => contract.isDeploying)
.length !== 0;
}
@computed get isDappDeploying () {
return this.apps
.filter((app) => app.isDeploying)
.length !== 0;
}
@computed get haveAllBadges () {
return this.badges
.filter((contract) => !contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered)
.length === 0;
}
@computed get haveAllContracts () {
return this.contracts
.filter((contract) => !contract.instance || !contract.hasLatestCode)
.length === 0;
}
@computed get haveAllDapps () {
return this.apps
.filter((app) => {
return !app.isOnChain ||
!app.imageHash || !app.imageMatch ||
(app.source.contentHash && !app.contentMatch) ||
(app.source.manifestHash && !app.manifestMatch);
})
.length === 0;
}
@action refreshApps = () => {
this.apps = [].concat(this.apps.peek());
}
@action refreshContracts = () => {
this.badges = [].concat(this.badges.peek());
this.contracts = [].concat(this.contracts.peek());
}
@action setError = (error) => {
console.error(error);
this.error = error.message
? error.message
: error;
}
@action setRegistryAddress = (address, isOnChain = false) => {
if (this.registry.address !== address || !this.registry.instance) {
console.log(`registry found at ${address}`);
this.registry = Object.assign({}, this.registry, {
address,
instance: api.newContract(this.registry.abi, address).instance,
isOnChain
});
}
}
@action setRegistryCode (byteCode) {
this.registry.hasLatestCode = validateCode(this.registry.byteCode, byteCode);
}
@action setRegistryDeploying = (isDeploying = false) => {
this.registry = Object.assign({}, this.registry, {
isDeploying,
status: isDeploying
? 'Deploying contract'
: null
});
}
@action setBadgeId = (badge, badgeId) => {
badge.badgeId = badgeId;
badge.isBadgeRegistered = true;
this.refreshContracts();
}
@action setBadgeImageHash = (badge, imageHash) => {
badge.badgeImageHash = imageHash;
badge.badgeImageMatch = badge.badgeSource.imageHash === imageHash;
this.refreshContracts();
}
@action setContractAddress = (contract, address, isOnChain = false) => {
if (contract.address !== address || !contract.instance || contract.isOnChain !== isOnChain) {
console.log(`${contract.id} found at ${address}`);
contract.address = address;
contract.instance = api.newContract(contract.abi, address).instance;
contract.isOnChain = isOnChain;
this.refreshContracts();
}
}
@action setContractCode (contract, byteCode) {
contract.hasLatestCode = validateCode(contract.byteCode, byteCode);
this.refreshContracts();
}
@action setContractDeploying = (contract, isDeploying = false) => {
contract.isDeploying = isDeploying;
contract.status = isDeploying
? 'Deploying contract'
: null;
this.refreshContracts();
}
@action setContractStatus = (contract, status) => {
contract.status = status;
this.refreshContracts();
}
@action setAppDeploying = (app, isDeploying = false) => {
app.isDeploying = isDeploying;
app.status = isDeploying
? 'Registering app'
: null;
this.refreshApps();
}
@action setAppFound = (app, isOnChain = false) => {
if (app.isOnChain !== isOnChain) {
console.log(`${app.name} found on dappreg`);
app.isOnChain = isOnChain;
this.refreshApps();
}
}
@action setAppContentHash = (app, contentHash) => {
if (app.contentHash !== contentHash) {
console.log(`${app.name} has contentHash ${contentHash}`);
app.contentHash = contentHash;
app.contentMatch = contentHash === app.source.contentHash;
this.refreshApps();
}
}
@action setAppImageHash = (app, imageHash) => {
if (app.imageHash !== imageHash) {
console.log(`${app.name} has imageHash ${imageHash}`);
app.imageHash = imageHash;
app.imageMatch = imageHash === app.source.imageHash;
this.refreshApps();
}
}
@action setAppManifestHash = (app, manifestHash) => {
if (app.manifestHash !== manifestHash) {
console.log(`${app.name} has manifestHash ${manifestHash}`);
app.manifestHash = manifestHash;
app.manifestMatch = manifestHash === app.source.manifestHash;
this.refreshApps();
}
}
@action setAppStatus = (app, status) => {
console.log(app.id, status);
app.status = status;
this.refreshApps();
}
deployApp = (app) => {
console.log(`Registering application ${app.id}`);
this.setAppDeploying(app, true);
const options = {};
const values = [app.hashId];
return api.parity
.defaultAccount()
.then((defaultAccount) => {
options.from = defaultAccount;
if (app.isOnChain) {
return true;
}
return this.contractDappreg.instance
.fee.call({}, [])
.then((fee) => {
options.value = fee;
return executeContract(app.id, this.contractDappreg, 'register', options, values);
});
})
.then(() => {
if (app.imageHash && app.imageMatch) {
return true;
}
this.setAppStatus(app, 'Registering image url');
return this
.registerHash(app.source.imageHash, app.source.imageUrl, options.from)
.then(() => this.setAppMeta(app, 'IMG', app.source.imageHash, options.from));
})
.then(() => {
if (!app.source.manifestHash || app.manifestMatch) {
return true;
}
this.setAppStatus(app, 'Registering manifest url');
return this
.registerHash(app.source.manifestHash, app.source.manifestUrl, options.from)
.then(() => this.setAppMeta(app, 'MANIFEST', app.source.manifestHash, options.from));
})
.then(() => {
if (!app.source.contentHash || app.contentMatch) {
return true;
}
this.setAppStatus(app, 'Registering content url');
return this
.registerRepo(app.source.contentHash, app.source.contentUrl, options.from)
.then(() => this.setAppMeta(app, 'CONTENT', app.source.contentHash, options.from));
})
.catch(() => {
return null;
})
.then(() => {
this.setAppDeploying(app, false);
});
}
deployApps = () => {
this.apps
.filter((app) => {
return !app.isDeploying &&
(
!app.isOnChain ||
(!app.imageHash || !app.imageMatch) ||
(app.source.contentHash && !app.contentMatch) ||
(app.source.manifestHash && !app.manifestMatch)
);
})
.forEach(this.deployApp);
}
_deployContract = (contract) => {
console.log(`Deploying contract ${contract.id}`);
const options = {
data: contract.byteCode
};
return api.parity
.defaultAccount()
.then((defaultAccount) => {
options.from = defaultAccount;
return api
.newContract(contract.abi)
.deploy(options, contract.deployParams, (error, data) => {
if (error) {
console.error(contract.id, error);
} else {
console.log(contract.id, data);
}
})
.then((contractAddress) => {
return [contractAddress, defaultAccount];
});
});
}
deployContract = (contract) => {
if (contract.hasLatestCode) {
return Promise.resolve(false);
}
let defaultAccount = '0x0';
this.setContractDeploying(contract, true);
return this
._deployContract(contract)
.then(([address, _defaultAccount]) => {
const isOnChain = contract.isOnChain;
defaultAccount = _defaultAccount;
this.setContractAddress(contract, address);
return isOnChain
? true
: this.reserveAddress(contract, defaultAccount);
})
.then(() => {
return this.registerAddress(contract, defaultAccount);
})
.catch(() => {
return null;
})
.then(() => {
this.setContractDeploying(contract, false);
});
}
deployBadge = (badge) => {
let defaultAccount;
return this
.deployContract(badge)
.then(() => {
this.setContractDeploying(badge, true);
return api.parity.defaultAccount();
})
.then((_defaultAccount) => {
defaultAccount = _defaultAccount;
if (badge.isBadgeRegistered) {
return true;
}
this.setContractStatus(badge, 'Registering with badgereg');
return this.registerBadge(badge, defaultAccount);
})
.then(() => {
if (badge.badgeImageMatch) {
return true;
}
this.setContractStatus(badge, 'Registering image url');
return this
.registerHash(badge.badgeSource.imageHash, badge.badgeSource.imageUrl, defaultAccount)
.then(() => this.registerBadgeImage(badge, badge.badgeSource.imageHash, defaultAccount));
})
.then(() => {
this.setContractDeploying(badge, false);
});
}
deployContracts = () => {
this.contracts
.filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode))
.forEach(this.deployContract);
}
deployBadges = () => {
this.badges
.filter((contract) => !contract.isDeploying && (!contract.instance || !contract.hasLatestCode || !contract.badgeImageHash || !contract.badgeImageMatch || !contract.isBadgeRegistered))
.forEach(this.deployBadge);
}
deployRegistry = () => {
this.setRegistryDeploying(true);
return this
._deployContract(this.registry)
.then(([address]) => {
this.setRegistryDeploying(false);
this.setRegistryAddress(address);
});
}
registerBadge = (badge, fromAddress) => {
const options = {
from: fromAddress
};
const values = [badge.address, api.util.sha3.text(badge.id.toLowerCase())];
return this.contractBadgereg.instance
.fee.call({}, [])
.then((fee) => {
options.value = fee;
return executeContract(badge.id, this.contractBadgereg, 'register', options, values);
});
}
registerBadgeImage = (badge, hash, fromAddress) => {
const options = {
from: fromAddress
};
const values = [badge.badgeId, 'IMG', hash];
this.setContractStatus(badge, 'Setting meta IMG');
return executeContract(badge.id, this.contractBadgereg, 'setMeta', options, values);
}
setAppMeta = (app, key, meta, fromAddress) => {
const options = {
from: fromAddress
};
const values = [app.hashId, key, meta];
this.setAppStatus(app, `Setting meta ${key}`);
return executeContract(app.id, this.contractDappreg, 'setMeta', options, values);
}
reserveAddress = (contract, fromAddress) => {
const options = { from: fromAddress };
const values = [api.util.sha3.text(contract.id.toLowerCase())];
this.setContractStatus(contract, 'Reserving name');
return this.registry.instance
.fee.call({}, [])
.then((value) => {
options.value = value;
return executeContract(contract.id, this.registry, 'reserve', options, values);
});
}
registerAddress = (contract, fromAddress) => {
const options = { from: fromAddress };
const values = [api.util.sha3.text(contract.id.toLowerCase()), 'A', contract.address];
this.setContractStatus(contract, 'Setting lookup address');
return executeContract(contract.id, this.registry, 'setAddress', options, values);
}
registerRepo = (hash, content, fromAddress) => {
const options = {
from: fromAddress
};
const values = [hash, content.repo || content, content.commit || 0];
return this.contractGithubhint.instance
.entries.call({}, [hash])
.then(([imageUrl, commit, owner]) => {
if (isValidNumber(owner)) {
return true;
}
return executeContract(hash, this.contractGithubhint, 'hint', options, values);
})
.catch(() => false);
}
registerHash = (hash, url, fromAddress) => {
const options = {
from: fromAddress
};
const values = [hash, url];
return this.contractGithubhint.instance
.entries.call({}, [hash])
.then(([imageUrl, commit, owner]) => {
if (isValidNumber(owner)) {
return true;
}
return executeContract(hash, this.contractGithubhint, 'hintURL', options, values);
})
.catch(() => false);
}
findRegistry = () => {
if (this.registry.address && this.registry.hasLatestCode) {
return Promise.resolve(this.registry);
}
return api.parity
.registryAddress()
.then((address) => {
if (isValidNumber(address)) {
this.setRegistryAddress(address, true);
}
return api.eth.getCode(address);
})
.then((byteCode) => {
this.setRegistryCode(byteCode);
});
}
findApps = () => {
if (!this.contractDappreg.instance) {
return Promise.resolve(false);
}
return Promise
.all(
this.apps.map((app) => {
return app.isOnChain
? Promise.resolve([[0]])
: this.contractDappreg.instance.get.call({}, [app.hashId]);
})
)
.then((apps) => {
apps.forEach(([_id, owner], index) => {
const id = api.util.bytesToHex(_id);
if (isValidNumber(id)) {
this.setAppFound(this.apps[index], true);
}
});
return Promise.all(
this.apps.map((app) => {
return !app.isOnChain || (app.imageHash && app.imageMatch)
? Promise.resolve([[0], [0], [0]])
: Promise.all([
this.contractDappreg.instance.meta.call({}, [app.hashId, 'CONTENT']),
this.contractDappreg.instance.meta.call({}, [app.hashId, 'IMG']),
this.contractDappreg.instance.meta.call({}, [app.hashId, 'MANIFEST'])
]);
})
);
})
.then((hashes) => {
hashes.forEach(([content, image, manifest], index) => {
const contentHash = api.util.bytesToHex(content);
const imageHash = api.util.bytesToHex(image);
const manifestHash = api.util.bytesToHex(manifest);
if (isValidNumber(contentHash)) {
this.setAppContentHash(this.apps[index], contentHash);
}
if (isValidNumber(imageHash)) {
this.setAppImageHash(this.apps[index], imageHash);
}
if (isValidNumber(manifestHash)) {
this.setAppManifestHash(this.apps[index], manifestHash);
}
});
});
}
findBadges = () => {
if (!this.contractBadgereg.instance) {
return Promise.resolve(false);
}
return this
.findContracts(this.badges)
.then(() => {
return Promise.all(
this.badges.map((badge) => {
return badge.isBadgeRegistered
? Promise.resolve([0, 0, 0])
: this.contractBadgereg.instance.fromAddress.call({}, [badge.address]);
})
);
})
.then((badgeInfos) => {
badgeInfos.forEach(([id, name, owner], index) => {
if (isValidNumber(owner)) {
this.setBadgeId(this.badges[index], id);
}
});
return Promise
.all(
this.badges.map((badge) => {
return !badge.isBadgeRegistered
? Promise.resolve([0])
: this.contractBadgereg.instance.meta.call({}, [badge.badgeId, 'IMG']);
})
);
})
.then((images) => {
images.forEach((imageBytes, index) => {
const imageHash = api.util.bytesToHex(imageBytes);
if (isValidNumber(imageHash)) {
this.setBadgeImageHash(this.badges[index], imageHash);
}
});
});
}
findContracts = (contracts = this.contracts) => {
if (!this.registry.instance) {
return Promise.resolve(false);
}
return Promise
.all(
contracts.map((contract) => {
const hashId = api.util.sha3.text(contract.id.toLowerCase());
return contract.isOnChain
? Promise.resolve([0, 0])
: Promise.all([
this.registry.instance.getAddress.call({}, [hashId, 'A']),
this.registry.instance.getOwner.call({}, [hashId])
]);
})
)
.then((addresses) => {
addresses.forEach(([address, owner], index) => {
if (isValidNumber(owner) && isValidNumber(address)) {
this.setContractAddress(contracts[index], address, true);
}
});
return Promise.all(
contracts.map((contract) => {
return !contract.address || contract.hasLatestCode
? Promise.resolve(null)
: api.eth.getCode(contract.address);
})
);
})
.then((codes) => {
codes.forEach((byteCode, index) => {
if (byteCode) {
this.setContractCode(contracts[index], byteCode);
}
});
});
}
onNewBlockNumber = (error, blockNumber) => {
if (error) {
return;
}
return this
.findRegistry()
.then(this.findContracts)
.then(this.findApps)
.then(this.findBadges)
.catch(this.setError);
}
}

View File

@ -0,0 +1,82 @@
// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import BigNumber from 'bignumber.js';
import { api } from './parity';
export function validateCode (source, retrieved) {
const original = source.substr(12);
const bytecode = retrieved.substr(12);
const knownHash = api.util.sha3(original.slice(-1 * bytecode.length));
const codeHash = api.util.sha3(bytecode);
return knownHash === codeHash;
}
export function isValidNumber (number) {
return number && !(new BigNumber(number)).isZero();
}
export function executeContract (logId, contract, funcName, options, values) {
const func = contract.instance[funcName];
return func
.estimateGas(options, values)
.then((gasEst) => {
options.gas = gasEst.mul(1.2);
return trackRequest(
func.postTransaction(options, values),
(error, data) => {
if (error) {
console.error(logId, error);
} else {
console.log(logId, data);
}
}
);
});
}
export function trackRequest (promise, callback) {
return promise
.then((requestId) => {
callback(null, { state: 'checkRequest', requestId });
return api.pollMethod('parity_checkRequest', requestId);
})
.then((txHash) => {
callback(null, { state: 'getTransactionReceipt', txHash });
return api.pollMethod('eth_getTransactionReceipt', txHash, (receipt) => {
if (!receipt || !receipt.blockNumber || receipt.blockNumber.eq(0)) {
return false;
}
return true;
});
})
.then((receipt) => {
callback(null, { state: 'hasReceipt', receipt });
})
.catch((error) => {
callback(error);
throw error;
});
}

View File

@ -20,12 +20,15 @@ import { flatten } from 'lodash';
import * as abis from '~/contracts/abi';
import Contracts from '~/contracts';
import builtins from '~/views/Dapps/builtin.json';
import builtinJson from '~/views/Dapps/builtin.json';
import Dapp from './dappStore.js';
import { deleteDapp, registerDapp, updateDapp } from './utils';
import { api, trackRequest } from './parity';
const builtins = builtinJson.filter((app) => app.id);
let instance = null;
export default class DappsStore {

View File

@ -21,7 +21,9 @@ import Contracts from '~/contracts';
import { hashToImageUrl } from '~/redux/util';
import { bytesToHex } from '~/api/util/format';
import builtinApps from '~/views/Dapps/builtin.json';
import builtinJson from '~/views/Dapps/builtin.json';
const builtinApps = builtinJson.filter((app) => app.id);
function getHost (api) {
const host = process.env.DAPPS_URL ||

View File

@ -1,4 +1,12 @@
[
{
"url": "chaindeploy",
"name": "Chain Deployment",
"description": "Deploy all basic contracts, names & applications to the network",
"author": "Parity Team <admin@ethcore.io>",
"version": "1.0.0",
"visible": false
},
{
"id": "0xf9f2d620c2e08f83e45555247146c62185e4ab7cf82a4b9002a265a0d020348f",
"url": "tokendeploy",