Skip to content

Commit

Permalink
Update to use embark 6.0.0 (#99)
Browse files Browse the repository at this point in the history
* trim trailing spaces

* update to embark 4.0.2

* bump to solc 0.5.4

* use .selector

* use solidity function selector

* update to embark 6.0.0

* use mocks instead of "instanceOf" tool+tests fix

* update to solidity 0.5.11

* update to solidity 0.5.11

* add spdx license identifiers

* update ENS contracts

* natspec fix return values
  • Loading branch information
3esmit authored Jul 24, 2020
1 parent 77d9394 commit 3d37a0a
Show file tree
Hide file tree
Showing 54 changed files with 27,269 additions and 731 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ __pycache__/
chains.json
config/production/password
config/livenet/password
embarkArtifacts/
embark_demo/

# egg-related
viper.egg-info/
Expand Down Expand Up @@ -36,7 +38,6 @@ coverage.json
# node
node_modules/
npm-debug.log
package-lock.json

# other
.vs/
Expand Down
6 changes: 3 additions & 3 deletions app/actions/accounts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ERC20Token from 'Embark/contracts/ERC20Token'
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar'
import TestToken from 'Embark/contracts/TestToken'
import ERC20Token from '../../embarkArtifacts/contracts/ERC20Token'
import UsernameRegistrar from '../../embarkArtifacts/contracts/UsernameRegistrar'
import TestToken from '../../embarkArtifacts/contracts/TestToken'

import { getDefaultAccount } from '../utils/web3Helpers'
import { actions as accountActions } from '../reducers/accounts'
Expand Down
1 change: 0 additions & 1 deletion app/components/accountList.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import web3 from 'Embark/web3'
import React from 'react';
import { connect } from 'react-redux';
import { Nav, MenuItem, NavDropdown } from 'react-bootstrap';
Expand Down
6 changes: 3 additions & 3 deletions app/components/ens/addDomain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lang from 'i18n-js';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import web3 from 'web3';
import ENSRegistry from 'Embark/contracts/ENSRegistry';
import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';

import ENSRegistry from '../../../embarkArtifacts/contracts/ENSRegistry';
import React from 'react';
import { Button } from 'react-bootstrap';
import FieldGroup from '../standard/FieldGroup';
Expand Down
4 changes: 2 additions & 2 deletions app/components/ens/moveDomain.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lang from 'i18n-js';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import web3 from 'web3';
import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';

import React from 'react';
import { Button } from 'react-bootstrap';
import FieldGroup from '../standard/FieldGroup';
Expand Down
8 changes: 4 additions & 4 deletions app/components/ens/nameLookup.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import lang from 'i18n-js';
import React, { Fragment, PureComponent } from 'react';
import web3 from 'web3';

import EmbarkJS from 'Embark/EmbarkJS';
import { connect } from 'react-redux';
import { actions as accountActions, getDefaultAccount } from '../../reducers/accounts';
import { hash } from 'eth-ens-namehash';
import { isNil } from 'lodash';
import Hidden from '@material-ui/core/Hidden';
import Typography from '@material-ui/core/Typography';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import ENSRegistry from 'Embark/contracts/ENSRegistry';
import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';
import ENSRegistry from '../../../embarkArtifacts/contracts/ENSRegistry';
import { Button, Field, TextInput, MobileSearch, MobileButton, Card, Info, Text } from '../../ui/components'
import { IconCheck } from '../../ui/icons'
import { keyFromXY } from '../../utils/ecdsa';
import EditOptions from './EditOptions';
import ReleaseDomainAlert from './ReleaseDomain';
import theme from '../../ui/theme'
import { withFormik } from 'formik';
import PublicResolver from 'Embark/contracts/PublicResolver';
import PublicResolver from '../../../embarkArtifacts/contracts/PublicResolver';
import { CopyToClipboard } from 'react-copy-to-clipboard';
import RegisterSubDomain from '../ens/registerSubDomain';
import StatusLogo from '../../ui/icons/components/StatusLogo'
Expand Down
6 changes: 3 additions & 3 deletions app/components/ens/registerSubDomain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lang from 'i18n-js';
import web3 from "Embark/web3"
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import TestToken from 'Embark/contracts/TestToken';

import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';
import TestToken from '../../../embarkArtifacts/contracts/TestToken';
import React, { Fragment } from 'react';
import {connect} from 'react-redux';
import Hidden from '@material-ui/core/Hidden';
Expand Down
2 changes: 1 addition & 1 deletion app/components/ens/setupENS.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lang from 'i18n-js';
import React, { Fragment } from 'react';
import { Button } from 'react-bootstrap';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';
import web3Utils from 'web3-utils'
import { hash } from 'eth-ens-namehash'

Expand Down
4 changes: 2 additions & 2 deletions app/components/ens/updateController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lang from 'i18n-js';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import web3 from 'web3';
import UsernameRegistrar from '../../../embarkArtifacts/contracts/UsernameRegistrar';

import React from 'react';
import { Button } from 'react-bootstrap';
import FieldGroup from '../standard/FieldGroup';
Expand Down
6 changes: 3 additions & 3 deletions app/components/ens/utils/domain.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import EmbarkJS from 'Embark/EmbarkJS';
import web3 from "Embark/web3";
import ENSRegistry from 'Embark/contracts/ENSRegistry';
import PublicResolver from 'Embark/contracts/PublicResolver';
;
import ENSRegistry from '../../../../embarkArtifacts/contracts/ENSRegistry';
import PublicResolver from '../../../../embarkArtifacts/contracts/PublicResolver';

const { methods: { owner, resolver } } = ENSRegistry;

Expand Down
6 changes: 3 additions & 3 deletions app/components/ensSubManagement.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lang from 'i18n-js';
import ENSRegistry from 'Embark/contracts/ENSRegistry';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import TestToken from 'Embark/contracts/TestToken';
import ENSRegistry from '../../embarkArtifacts/contracts/ENSRegistry';
import UsernameRegistrar from '../../embarkArtifacts/contracts/UsernameRegistrar';
import TestToken from '../../embarkArtifacts/contracts/TestToken';
import React, { Fragment } from 'react';
import AddDomain from './ens/addDomain';
import MoveDomain from './ens/moveDomain';
Expand Down
2 changes: 1 addition & 1 deletion app/components/erc20token.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import lang from 'i18n-js';
import EmbarkJS from 'Embark/EmbarkJS';
import ERC20Token from 'Embark/contracts/ERC20Token';
import ERC20Token from '../../embarkArtifacts/contracts/ERC20Token';
import React from 'react';
import { connect } from 'react-redux';
import { Form, FormGroup, FormControl, HelpBlock, Button } from 'react-bootstrap';
Expand Down
2 changes: 1 addition & 1 deletion app/components/standard/TokenPermission.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Fragment, PureComponent } from 'react';
import { connect } from 'react-redux';
import web3 from "Embark/web3"

import Toggle from 'react-toggle';
import { BigNumber } from './utils'
import "react-toggle/style.css";
Expand Down
4 changes: 2 additions & 2 deletions app/components/testtoken.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import lang from 'i18n-js';
import EmbarkJS from 'Embark/EmbarkJS';
import TestToken from 'Embark/contracts/TestToken';
import TestToken from '../../embarkArtifacts/contracts/TestToken';
import React from 'react';
import { Form, FormGroup, FormControl, Button } from 'react-bootstrap';
import { connect } from 'react-redux';
import web3 from 'web3';


import ERC20TokenUI from './erc20token';
import { actions as accountActions } from '../reducers/accounts';
Expand Down
9 changes: 5 additions & 4 deletions app/dapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import React from 'react';
import 'typeface-roboto'
import Toggle from 'react-toggle';
import EmbarkJS from 'Embark/EmbarkJS';
import TestToken from 'Embark/contracts/TestToken';
import TestToken from '../embarkArtifacts/contracts/TestToken';
import { startCase } from 'lodash';
import UsernameRegistrar from 'Embark/contracts/UsernameRegistrar';
import UsernameRegistrar from '../embarkArtifacts/contracts/UsernameRegistrar';
import NameLookup from './components/ens/nameLookup';
import AdminMode from './components/AdminMode';
import TokenPermissions from './components/standard/TokenPermissionConnect';
import web3 from "Embark/web3";
import Welcome from './components/ens/welcome';
import Hidden from '@material-ui/core/Hidden';
import Web3Render from './components/standard/Web3Render';
Expand All @@ -30,6 +29,8 @@ const isReady = (network, environment) => {
if (environment === 'livenet') return true
} else if(formattedNetwork.includes('ropsten')) {
if (environment === 'testnet') return true
}else if(formattedNetwork.includes('private')) {
if (environment === 'private') return true
}
return formattedNetwork.includes(environment.toLowerCase());
}
Expand Down Expand Up @@ -70,7 +71,7 @@ class App extends React.Component {
componentDidMount(){
EmbarkJS.onReady((err) => {
getNetworkType().then(network => {
const { environment } = EmbarkJS
const environment = network;
this.setState({ network, environment })
});
});
Expand Down
2 changes: 1 addition & 1 deletion app/store/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import web3 from "Embark/web3"

import EmbarkJS from 'Embark/EmbarkJS'
import store from './configureStore'
import { fetchAndDispatchSNTAllowance, fetchAndDispatchAccountsWithBalances } from '../actions/accounts'
Expand Down
2 changes: 1 addition & 1 deletion app/utils/web3Helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import web3 from "Embark/web3"

import BigNumber from 'bignumber.js';

// By default BigNumber's `toString` method converts to exponential notation if the value has
Expand Down
82 changes: 33 additions & 49 deletions config/blockchain.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,46 @@
module.exports = {
development: {
default: {
enabled: true,
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
networkId: "1337", // Network id used when networkType is custom
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
genesisBlock: "config/development/genesis.json", // Genesis block to initiate on first creation of a development node
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
// When set to "auto", Embark will automatically set the cors to the address of the webserver
proxy: true, // Proxy is used to present meaningful information about transactions
account: {
// "address": "", // When specified, uses that address instead of the default one for the network
password: "config/development/password" // Password to unlock the account
},
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
wsRPC: true, // Enable the WS-RPC server
wsOrigins: "auto", // Origins from which to accept websockets requests
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
wsPort: 8546, // WS-RPC server listening port (default: 8546)
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
simulatorBlocktime: 0 // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
client: "geth"
},

development: {
client: 'ganache-cli',
clientConfig: {
miningMode: 'dev'
}
},

testnet: {
enabled: true,
networkType: "testnet",
syncMode: "light",
rpcHost: "localhost",
rpcPort: 8545,
rpcCorsDomain: "http://localhost:8000",
account: {
password: "config/testnet/password"
}
accounts: [
{
nodeAccounts: true,
password: "config/testnet/password"
}
]
},

livenet: {
enabled: true,
networkType: "livenet",
syncMode: "light",
rpcHost: "localhost",
rpcPort: 8545,
rpcCorsDomain: "http://localhost:8000",
account: {
password: "config/livenet/password"
}
accounts: [
{
nodeAccounts: true,
password: "config/livenet/password"
}
]
},
privatenet: {
enabled: true,
networkType: "custom",
rpcHost: "localhost",
rpcPort: 8545,
rpcCorsDomain: "http://localhost:8000",
datadir: "yourdatadir",
networkId: "123",
bootnodes: ""

rinkeby: {
networkType: "rinkeby",
syncMode: "light",
accounts: [
{
nodeAccounts: true,
password: "config/rinkeby/password"
}
]
}
};
12 changes: 4 additions & 8 deletions config/communication.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
module.exports = {
default: {
enabled: true,
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
available_providers: ["whisper"], // Array of available providers
connection: {
host: "localhost", // Host of the blockchain node
port: 8546, // Port of the blockchain node
type: "ws" // Type of connection (ws or rpc)
}
enabled: false,
provider: "whisper",
available_providers: ["whisper"],
client: "geth"
}
};
Loading

0 comments on commit 3d37a0a

Please sign in to comment.