Updating project to embark 3.2.3 and maintenance over SNTController
This commit is contained in:
parent
024c2d83f4
commit
8caf440470
|
@ -4127,14 +4127,6 @@
|
||||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"typedarray-to-buffer": {
|
|
||||||
"version": "3.1.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
|
|
||||||
"integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
|
|
||||||
"requires": {
|
|
||||||
"is-typedarray": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ultron": {
|
"ultron": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
||||||
|
@ -4481,8 +4473,19 @@
|
||||||
"integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==",
|
"integrity": "sha512-Cx64NgDStynKaUGDIIOfaCd0fZusL8h5avKTkdTjUu2aHhFJhZoVBGVLhoDtUaqZGWIZGcBJOoVf2JkGUOjDRQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"underscore": "1.8.3",
|
"underscore": "1.8.3",
|
||||||
"web3-core-helpers": "1.0.0-beta.35",
|
"web3-core-helpers": "1.0.0-beta.35"
|
||||||
"websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"websocket": {
|
||||||
|
"version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
|
||||||
|
"from": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
|
||||||
|
"requires": {
|
||||||
|
"debug": "^2.2.0",
|
||||||
|
"nan": "^2.3.3",
|
||||||
|
"typedarray-to-buffer": "^3.1.2",
|
||||||
|
"yaeti": "^0.0.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"web3-shh": {
|
"web3-shh": {
|
||||||
|
@ -4517,16 +4520,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"websocket": {
|
|
||||||
"version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
|
|
||||||
"from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",
|
|
||||||
"requires": {
|
|
||||||
"debug": "^2.2.0",
|
|
||||||
"nan": "^2.3.3",
|
|
||||||
"typedarray-to-buffer": "^3.1.2",
|
|
||||||
"yaeti": "^0.0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"which": {
|
"which": {
|
||||||
"version": "1.3.1",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
|
@ -4637,11 +4630,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
||||||
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
|
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
|
||||||
},
|
},
|
||||||
"yaeti": {
|
|
||||||
"version": "0.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
|
|
||||||
"integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc="
|
|
||||||
},
|
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||||
|
|
|
@ -29,7 +29,7 @@ const events = new EventEmitter();
|
||||||
|
|
||||||
// Web3 Connection
|
// Web3 Connection
|
||||||
const connectionURL = `${config.node.local.protocol}://${config.node.local.host}:${config.node.local.port}`;
|
const connectionURL = `${config.node.local.protocol}://${config.node.local.host}:${config.node.local.port}`;
|
||||||
const wsProvider = new Web3.providers.WebsocketProvider(connectionURL, {headers: {Origin: "gas-relayer"}});
|
const wsProvider = new Web3.providers.WebsocketProvider(connectionURL, {headers: {Origin: "embark"}});
|
||||||
const web3 = new Web3(wsProvider);
|
const web3 = new Web3(wsProvider);
|
||||||
let account;
|
let account;
|
||||||
|
|
||||||
|
|
|
@ -23,21 +23,6 @@ class SNTStrategy extends Strategy {
|
||||||
|
|
||||||
const balance = await this.getBalance(input.address, token);
|
const balance = await this.getBalance(input.address, token);
|
||||||
|
|
||||||
let estimatedGas;
|
|
||||||
try {
|
|
||||||
estimatedGas = await this.web3.eth.estimateGas({
|
|
||||||
data: input.payload,
|
|
||||||
from: this.config.node.blockchain.account.address,
|
|
||||||
to: input.contract
|
|
||||||
});
|
|
||||||
} catch(exc){
|
|
||||||
if(exc.message.indexOf("revert") > -1) return {success: false, message: "Transaction will revert"};
|
|
||||||
else {
|
|
||||||
console.error(exc);
|
|
||||||
return {success: false, message: "Transaction will fail"};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
let tokenRate = await this.getTokenRate(token, cache);
|
let tokenRate = await this.getTokenRate(token, cache);
|
||||||
if(!tokenRate){
|
if(!tokenRate){
|
||||||
return {
|
return {
|
||||||
|
@ -56,6 +41,23 @@ class SNTStrategy extends Strategy {
|
||||||
return {success: false, message: "Gas price is less than the required amount (" + gasPrices.inTokens.toString(10) + ")"};
|
return {success: false, message: "Gas price is less than the required amount (" + gasPrices.inTokens.toString(10) + ")"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let estimatedGas;
|
||||||
|
try {
|
||||||
|
estimatedGas = await this.web3.eth.estimateGas({
|
||||||
|
data: input.payload,
|
||||||
|
from: this.config.node.blockchain.account.address,
|
||||||
|
to: input.contract
|
||||||
|
});
|
||||||
|
} catch(exc){
|
||||||
|
if(exc.message.indexOf("revert") > -1) return {success: false, message: "Transaction will revert"};
|
||||||
|
else {
|
||||||
|
console.error(exc);
|
||||||
|
return {success: false, message: "Transaction will fail"};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(input.functionName == TransferSNT){
|
if(input.functionName == TransferSNT){
|
||||||
const gas = this.web3.utils.toBN(estimatedGas);
|
const gas = this.web3.utils.toBN(estimatedGas);
|
||||||
const value = this.web3.utils.toBN(params('_amount'));
|
const value = this.web3.utils.toBN(params('_amount'));
|
||||||
|
|
|
@ -1,12 +1,24 @@
|
||||||
{
|
{
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"transform-object-rest-spread"
|
"@babel/plugin-proposal-object-rest-spread",
|
||||||
],
|
"@babel/plugin-syntax-dynamic-import",
|
||||||
"presets": [
|
"@babel/plugin-syntax-import-meta",
|
||||||
"stage-2"
|
"@babel/plugin-proposal-class-properties",
|
||||||
],
|
"@babel/plugin-proposal-json-strings",
|
||||||
"ignore": [
|
[
|
||||||
"config/",
|
"@babel/plugin-proposal-decorators",
|
||||||
"node_modules"
|
{
|
||||||
]
|
"legacy": true
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"@babel/plugin-proposal-function-sent",
|
||||||
|
"@babel/plugin-proposal-export-namespace-from",
|
||||||
|
"@babel/plugin-proposal-numeric-separator",
|
||||||
|
"@babel/plugin-proposal-throw-expressions"
|
||||||
|
],
|
||||||
|
"presets": [],
|
||||||
|
"ignore": [
|
||||||
|
"config/",
|
||||||
|
"node_modules"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
.embark/
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
config/production/password
|
||||||
|
config/livenet/password
|
|
@ -60,7 +60,6 @@ class Status extends Component {
|
||||||
'block': 0,
|
'block': 0,
|
||||||
'submitState': {
|
'submitState': {
|
||||||
'etherSend': false,
|
'etherSend': false,
|
||||||
'changeSNTController': false,
|
|
||||||
'generateSTT': false
|
'generateSTT': false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -157,28 +156,6 @@ class Status extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeSNTController = event => {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
let submitState = this.state.submitState;
|
|
||||||
submitState.changeSNTController = true;
|
|
||||||
this.setState({submitState});
|
|
||||||
|
|
||||||
|
|
||||||
const toSend = STT.methods.changeController(SNTController.options.address);
|
|
||||||
|
|
||||||
toSend.estimateGas()
|
|
||||||
.then(estimatedGas => {
|
|
||||||
return toSend.send({gasLimit: estimatedGas + 100000});
|
|
||||||
})
|
|
||||||
.then(receipt => {
|
|
||||||
console.log(receipt);
|
|
||||||
submitState = this.state.submitState;
|
|
||||||
submitState.changeSNTController = false;
|
|
||||||
this.setState({submitState});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
sendEther = (event) => {
|
sendEther = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
@ -220,10 +197,7 @@ class Status extends Component {
|
||||||
<AddIcon className={classes.icon} />
|
<AddIcon className={classes.icon} />
|
||||||
1. Generate 5K STT (only on dev)
|
1. Generate 5K STT (only on dev)
|
||||||
</Button> }
|
</Button> }
|
||||||
{ isDev && <Button className={classes.button} color="primary" aria-label="Generate STT" onClick={this.changeSNTController}>
|
|
||||||
<AddIcon className={classes.icon} />
|
|
||||||
2. Change SNT Controller
|
|
||||||
</Button> }
|
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem className={classes.root}>
|
<ListItem className={classes.root}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import EmbarkJS from 'Embark/EmbarkJS';
|
||||||
|
|
||||||
|
// import your contracts
|
||||||
|
// e.g if you have a contract named SimpleStorage:
|
||||||
|
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||||
|
|
|
@ -1,62 +1,97 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
development: {
|
// applies to all environments
|
||||||
enabled: true,
|
default: {
|
||||||
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
|
enabled: true,
|
||||||
networkId: "1337", // Network id used when networkType is custom
|
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
||||||
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
|
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
||||||
genesisBlock: "config/development/genesis.json", // Genesis block to initiate on first creation of a development node
|
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
|
||||||
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
|
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||||
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
|
wsRPC: true, // Enable the WS-RPC server
|
||||||
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
|
wsOrigins: "auto", // Origins from which to accept websockets requests
|
||||||
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
|
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
||||||
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
|
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
||||||
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
|
wsPort: 8546 // WS-RPC server listening port (default: 8546)
|
||||||
rpcCorsDomain: "*", // 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
|
// default environment, merges with the settings in default
|
||||||
account: {
|
// assumed to be the intended environment by `embark run` and `embark blockchain`
|
||||||
// "address": "", // When specified, uses that address instead of the default one for the network
|
development: {
|
||||||
password: "config/development/password" // Password to unlock the account
|
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
|
||||||
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
|
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
|
||||||
wsRPC: true, // Enable the WS-RPC server
|
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
|
||||||
wsOrigins: "*", // Origins from which to accept websockets requests
|
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
|
||||||
// When set to "auto", Embark will automatically set the cors to the address of the webserver
|
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
|
||||||
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
|
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
|
||||||
wsPort: 8546, // WS-RPC server listening port (default: 8546)
|
proxy: true, // Proxy is used to present meaningful information about transactions
|
||||||
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
|
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
|
||||||
simulatorBlocktime: 0 // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
|
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.
|
||||||
testnet: {
|
account: {
|
||||||
enabled: true,
|
// numAccounts: 3, // When specified, creates accounts for use in the dapp. This option only works in the development environment, and can be used as a quick start option that bypasses the need for MetaMask in development. These accounts are unlocked and funded with the below settings.
|
||||||
networkType: "testnet",
|
// password: "config/development/password", // Password for the created accounts (as specified in the `numAccounts` setting). If `mineWhenNeeded` is enabled (and isDev is not), this password is used to create a development account controlled by the node.
|
||||||
syncMode: "light",
|
// balance: "5 ether" // Balance to be given to the created accounts (as specified in the `numAccounts` setting)
|
||||||
rpcHost: "localhost",
|
}
|
||||||
rpcPort: 8545,
|
},
|
||||||
rpcCorsDomain: "http://localhost:8000",
|
|
||||||
account: {
|
// merges with the settings in default
|
||||||
password: "config/testnet/password"
|
// used with "embark run privatenet" and/or "embark blockchain privatenet"
|
||||||
}
|
privatenet: {
|
||||||
},
|
networkType: "custom",
|
||||||
livenet: {
|
networkId: "1337",
|
||||||
enabled: true,
|
isDev: false,
|
||||||
networkType: "livenet",
|
datadir: ".embark/privatenet/datadir",
|
||||||
syncMode: "light",
|
// -- mineWhenNeeded --
|
||||||
rpcHost: "localhost",
|
// This options is only valid when isDev is false.
|
||||||
rpcPort: 8545,
|
// Enabling this option uses our custom script to mine only when needed.
|
||||||
rpcCorsDomain: "http://localhost:8000",
|
// Embark creates a development account for you (using `geth account new`) and funds the account. This account can be used for
|
||||||
account: {
|
// development (and even imported in to MetaMask). To enable correct usage, a password for this account must be specified
|
||||||
password: "config/livenet/password"
|
// in the `account > password` setting below.
|
||||||
}
|
// NOTE: once `mineWhenNeeded` is enabled, you must run an `embark reset` on your dApp before running
|
||||||
},
|
// `embark blockchain` or `embark run` for the first time.
|
||||||
privatenet: {
|
mineWhenNeeded: true,
|
||||||
enabled: true,
|
// -- genesisBlock --
|
||||||
networkType: "custom",
|
// This option is only valid when mineWhenNeeded is true (which is only valid if isDev is false).
|
||||||
rpcHost: "localhost",
|
// When enabled, geth uses POW to mine transactions as it would normally, instead of using POA as it does in --dev mode.
|
||||||
rpcPort: 8545,
|
// On the first `embark blockchain or embark run` after this option is enabled, geth will create a new chain with a
|
||||||
rpcCorsDomain: "http://localhost:8000",
|
// genesis block, which can be configured using the `genesisBlock` configuration option below.
|
||||||
datadir: "yourdatadir",
|
genesisBlock: "config/privatenet/genesis.json", // Genesis block to initiate on first creation of a development node
|
||||||
networkId: "123",
|
nodiscover: true,
|
||||||
bootnodes: ""
|
maxpeers: 0,
|
||||||
}
|
proxy: true,
|
||||||
};
|
account: {
|
||||||
|
// "address": "", // When specified, uses that address instead of the default one for the network
|
||||||
|
password: "config/privatenet/password" // Password to unlock the account. If `mineWhenNeeded` is enabled (and isDev is not), this password is used to create a development account controlled by the node.
|
||||||
|
},
|
||||||
|
targetGasLimit: 8000000,
|
||||||
|
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
|
||||||
|
simulatorBlocktime: 0
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run testnet" and/or "embark blockchain testnet"
|
||||||
|
testnet: {
|
||||||
|
networkType: "testnet",
|
||||||
|
syncMode: "light",
|
||||||
|
account: {
|
||||||
|
password: "config/testnet/password"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run livenet" and/or "embark blockchain livenet"
|
||||||
|
livenet: {
|
||||||
|
networkType: "livenet",
|
||||||
|
syncMode: "light",
|
||||||
|
rpcCorsDomain: "http://localhost:8000",
|
||||||
|
wsOrigins: "http://localhost:8000",
|
||||||
|
account: {
|
||||||
|
password: "config/livenet/password"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// you can name an environment with specific settings and then specify with
|
||||||
|
// "embark run custom_name" or "embark blockchain custom_name"
|
||||||
|
//custom_name: {
|
||||||
|
//}
|
||||||
|
};
|
||||||
|
|
|
@ -1,13 +1,40 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
default: {
|
// default applies to all environments
|
||||||
enabled: true,
|
default: {
|
||||||
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
|
enabled: true,
|
||||||
available_providers: ["whisper"], // Array of available providers
|
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
|
||||||
connection: {
|
available_providers: ["whisper"], // Array of available providers
|
||||||
host: "localhost", // Host of the blockchain node
|
},
|
||||||
port: 8546, // Port of the blockchain node
|
|
||||||
type: "ws" // Type of connection (ws or rpc)
|
// default environment, merges with the settings in default
|
||||||
}
|
// assumed to be the intended environment by `embark run`
|
||||||
}
|
development: {
|
||||||
};
|
connection: {
|
||||||
|
host: "localhost", // Host of the blockchain node
|
||||||
|
port: 8546, // Port of the blockchain node
|
||||||
|
type: "ws" // Type of connection (ws or rpc)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run privatenet"
|
||||||
|
privatenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run testnet"
|
||||||
|
testnet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run livenet"
|
||||||
|
livenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// you can name an environment with specific settings and then specify with
|
||||||
|
// "embark run custom_name"
|
||||||
|
//custom_name: {
|
||||||
|
//}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,143 +1,112 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// default applies to all environments
|
// default applies to all environments
|
||||||
default: {
|
default: {
|
||||||
// Blockchain node to deploy the contracts
|
// Blockchain node to deploy the contracts
|
||||||
deployment: {
|
deployment: {
|
||||||
host: "localhost", // Host of the blockchain node
|
host: "localhost", // Host of the blockchain node
|
||||||
port: 8545, // Port of the blockchain node
|
port: 8545, // Port of the blockchain node
|
||||||
type: "rpc" // Type of connection (ws or rpc),
|
type: "rpc" // Type of connection (ws or rpc),
|
||||||
|
// Accounts to use instead of the default account to populate your wallet
|
||||||
// Accounts to use instead of the default account to populate your wallet
|
/*,accounts: [
|
||||||
/*,accounts: [
|
{
|
||||||
{
|
privateKey: "your_private_key",
|
||||||
privateKey: "your_private_key",
|
balance: "5 ether" // You can set the balance of the account in the dev environment
|
||||||
balance: "5 ether" // You can set the balance of the account in the dev environment
|
// Balances are in Wei, but you can specify the unit with its name
|
||||||
// Balances are in Wei, but you can specify the unit with its name
|
},
|
||||||
},
|
{
|
||||||
{
|
privateKeyFile: "path/to/file", // Either a keystore or a list of keys, separated by , or ;
|
||||||
privateKeyFile: "path/to/file" // You can put more than one key, separated by , or ;
|
password: "passwordForTheKeystore" // Needed to decrypt the keystore file
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
mnemonic: "12 word mnemonic",
|
mnemonic: "12 word mnemonic",
|
||||||
addressIndex: "0", // Optionnal. The index to start getting the address
|
addressIndex: "0", // Optionnal. The index to start getting the address
|
||||||
numAddresses: "1", // Optionnal. The number of addresses to get
|
numAddresses: "1", // Optionnal. The number of addresses to get
|
||||||
hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path
|
hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path
|
||||||
}
|
}
|
||||||
]*/
|
]*/
|
||||||
},
|
},
|
||||||
// order of connections the dapp should connect to
|
// order of connections the dapp should connect to
|
||||||
dappConnection: [
|
dappConnection: [
|
||||||
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
|
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
|
||||||
"ws://localhost:8546",
|
"ws://localhost:8546",
|
||||||
"http://localhost:8545"
|
"http://localhost:8545"
|
||||||
],
|
],
|
||||||
gas: "auto",
|
gas: "auto",
|
||||||
contracts: {
|
contracts: {
|
||||||
"Identity": {"deploy": false},
|
"Identity": {"deploy": false},
|
||||||
"ERC20Receiver": {"deploy": false},
|
"ERC20Receiver": {"deploy": false},
|
||||||
"TestToken": {"deploy": false},
|
"TestToken": {"deploy": false},
|
||||||
"SafeMath": {"deploy": false},
|
"SafeMath": {"deploy": false},
|
||||||
"DelayedUpdatableInstance": {"deploy": false},
|
"DelayedUpdatableInstance": {"deploy": false},
|
||||||
"DelayedUpdatableInstanceStorage": {"deploy": false},
|
"DelayedUpdatableInstanceStorage": {"deploy": false},
|
||||||
"Factory": {"deploy": false},
|
"Factory": {"deploy": false},
|
||||||
"Instance": {"deploy": false},
|
"Instance": {"deploy": false},
|
||||||
"InstanceStorage": {"deploy": false},
|
"InstanceStorage": {"deploy": false},
|
||||||
"MiniMeTokenFactory": {"args":[]},
|
"MiniMeTokenFactory": {"args":[]},
|
||||||
"MiniMeToken": {"deploy": false},
|
"MiniMeToken": {"deploy": false},
|
||||||
"TestMiniMeToken": {"deploy": false},
|
"TestMiniMeToken": {"deploy": false},
|
||||||
"UpdatedIdentityKernel": {"deploy": false},
|
"UpdatedIdentityKernel": {"deploy": false},
|
||||||
"UpdatableInstance": {"deploy": false},
|
"UpdatableInstance": {"deploy": false},
|
||||||
"Controlled": {"deploy": false},
|
"Controlled": {"deploy": false},
|
||||||
"Owned": {"deploy": false},
|
"Owned": {"deploy": false},
|
||||||
"IdentityKernel": {"deploy": false},
|
"IdentityKernel": {"deploy": false},
|
||||||
"STT": {
|
"STT": {
|
||||||
"instanceOf": "TestMiniMeToken",
|
"instanceOf": "TestMiniMeToken",
|
||||||
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "STT", true],
|
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "STT", true],
|
||||||
"gasLimit": 4000000
|
"gasLimit": 4000000
|
||||||
},
|
},
|
||||||
"SNTController": {
|
"SNTController": {
|
||||||
"args": ["0x5f803F54679577fC974813E48abF012A243dD439", "$STT"]
|
"args": ["$accounts[0]", "$STT"],
|
||||||
},
|
|
||||||
"IdentityGasRelay": {
|
},
|
||||||
"deploy": true,
|
"IdentityGasRelay": {
|
||||||
"args": [[], [], [], 1, 1, "0x0000000000000000000000000000000000000000"]
|
"deploy": true,
|
||||||
},
|
"args": [[], [], [], 1, 1, "0x0000000000000000000000000000000000000000"]
|
||||||
"IdentityFactory": {
|
},
|
||||||
"args":[],
|
"IdentityFactory": {
|
||||||
"gasLimit": 5000000
|
"args":[],
|
||||||
},
|
"gasLimit": 5000000
|
||||||
"TestContract": {
|
},
|
||||||
"args": ["$STT"]
|
"TestContract": {
|
||||||
}
|
"args": ["$STT"]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
development: {
|
},
|
||||||
deployment: {
|
"afterDeploy": [
|
||||||
accounts: [
|
"STT.methods.changeController(SNTController.options.address).send()",
|
||||||
{
|
"SNTController.methods.enablePublicExecution(TestContract.options.address, true).send()"
|
||||||
privateKey: "b2ab40d549e67ba67f278781fec03b3a90515ad4d0c898a6326dd958de1e46fa",
|
]
|
||||||
balance: "5 ether" // You can set the balance of the account in the dev environment
|
|
||||||
// Balances are in Wei, but you can specify the unit with its name
|
},
|
||||||
}
|
|
||||||
]
|
// default environment, merges with the settings in default
|
||||||
}
|
// assumed to be the intended environment by `embark run`
|
||||||
},
|
development: {
|
||||||
|
dappConnection: [
|
||||||
testnet: {
|
"ws://localhost:8546",
|
||||||
contracts: {
|
"http://localhost:8545",
|
||||||
"MiniMeTokenFactory": {
|
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
|
||||||
"address": "0xb59E2Dc49a5F03CC25606F24934eA2CEE04f70dE"
|
]
|
||||||
},
|
},
|
||||||
"STT": {
|
|
||||||
"instanceOf": "TestMiniMeToken",
|
// merges with the settings in default
|
||||||
"address": "0x91a3473a3e1e3D61C29fa2fAcDf17fa0Db922a08"
|
// used with "embark run privatenet"
|
||||||
},
|
privatenet: {
|
||||||
"SNTController": {
|
},
|
||||||
"address": "0x39bFD424c2A83ca56FD557b373C01A27475bB314"
|
|
||||||
},
|
// merges with the settings in default
|
||||||
"IdentityGasRelay": {
|
// used with "embark run testnet"
|
||||||
"address": "0x8FB13e0f38038C446d6d253C57BEb518512dB56E"
|
testnet: {
|
||||||
},
|
},
|
||||||
"IdentityFactory": {
|
|
||||||
"address": "0xC83a746c3B73457FF51eCE216bfBFb524aa4fDD0"
|
// merges with the settings in default
|
||||||
},
|
// used with "embark run livenet"
|
||||||
"TestContract": {
|
livenet: {
|
||||||
"address": "0xf5F9B20b48C13FDb77ceB6bDa52D9664c27c84dd"
|
},
|
||||||
}
|
|
||||||
|
// you can name an environment with specific settings and then specify with
|
||||||
// If needed to deploy contracts again, uncomment the following lines
|
// "embark run custom_name" or "embark blockchain custom_name"
|
||||||
/*
|
//custom_name: {
|
||||||
"MiniMeTokenFactory": {
|
//}
|
||||||
"args":[],
|
};
|
||||||
"gasPrice": 20000000000
|
|
||||||
},
|
|
||||||
"STT": {
|
|
||||||
"instanceOf": "TestMiniMeToken",
|
|
||||||
"args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "STT", true],
|
|
||||||
"gasLimit": 4000000,
|
|
||||||
"gasPrice": 20000000000
|
|
||||||
},
|
|
||||||
"SNTController": {
|
|
||||||
"args": ["0x26C3f244D0CfD5Bde38fC9A4eb212fA1556eDfA2", "$STT"],
|
|
||||||
"gasPrice": 20000000000
|
|
||||||
},
|
|
||||||
"IdentityGasRelay": {
|
|
||||||
"deploy": true,
|
|
||||||
"args": [[], [], [], 1, 1, "0x0000000000000000000000000000000000000000"] ,
|
|
||||||
"gasPrice": 20000000000
|
|
||||||
},
|
|
||||||
"IdentityFactory": {
|
|
||||||
"args":[],
|
|
||||||
"gasLimit": 5000000,
|
|
||||||
"onDeploy": ["IdentityFactory.methods.setKernel('$IdentityGasRelay').send({gasLimit: 6000000})"],
|
|
||||||
"gasPrice": 20000000000
|
|
||||||
},
|
|
||||||
"TestContract": {
|
|
||||||
"args": ["$STT"],
|
|
||||||
"gasPrice": 20000000000
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
|
@ -1,6 +1,39 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
default: {
|
// default applies to all environments
|
||||||
available_providers: ["ens"],
|
default: {
|
||||||
provider: "ens"
|
enabled: false,
|
||||||
}
|
available_providers: ["ens"],
|
||||||
};
|
provider: "ens"
|
||||||
|
},
|
||||||
|
|
||||||
|
// default environment, merges with the settings in default
|
||||||
|
// assumed to be the intended environment by `embark run`
|
||||||
|
development: {
|
||||||
|
register: {
|
||||||
|
rootDomain: "embark.eth",
|
||||||
|
subdomains: {
|
||||||
|
'status': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run privatenet"
|
||||||
|
privatenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run testnet"
|
||||||
|
testnet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run livenet"
|
||||||
|
livenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// you can name an environment with specific settings and then specify with
|
||||||
|
// "embark run custom_name" or "embark blockchain custom_name"
|
||||||
|
//custom_name: {
|
||||||
|
//}
|
||||||
|
};
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
{
|
{
|
||||||
"config": {
|
"config": {
|
||||||
"homesteadBlock": 1,
|
"homesteadBlock": 0,
|
||||||
"byzantiumBlock": 1,
|
"byzantiumBlock": 0,
|
||||||
"daoForkSupport": true
|
"daoForkSupport": true
|
||||||
},
|
},
|
||||||
"nonce": "0x0000000000000042",
|
"nonce": "0x0000000000000042",
|
||||||
"difficulty": "0x0",
|
"difficulty": "0x0",
|
||||||
"alloc": {
|
"alloc": {
|
||||||
"0x3333333333333333333333333333333333333333": {"balance": "15000000000000000000"}
|
"0x3333333333333333333333333333333333333333": {"balance": "15000000000000000000"}
|
||||||
},
|
},
|
||||||
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"coinbase": "0x3333333333333333333333333333333333333333",
|
"coinbase": "0x3333333333333333333333333333333333333333",
|
||||||
"timestamp": "0x00",
|
"timestamp": "0x00",
|
||||||
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
"extraData": "0x",
|
"extraData": "0x",
|
||||||
"gasLimit": "0x7a1200"
|
"gasLimit": "0x7a1200"
|
||||||
}
|
}
|
|
@ -1 +1 @@
|
||||||
dev_password
|
dev_password
|
|
@ -1,35 +1,59 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
default: {
|
// default applies to all environments
|
||||||
enabled: true,
|
default: {
|
||||||
ipfs_bin: "ipfs",
|
enabled: false,
|
||||||
provider: "ipfs",
|
ipfs_bin: "ipfs",
|
||||||
available_providers: ["ipfs"],
|
provider: "ipfs",
|
||||||
upload: {
|
available_providers: ["ipfs"],
|
||||||
host: "localhost",
|
upload: {
|
||||||
port: 5001
|
host: "localhost",
|
||||||
},
|
port: 5001
|
||||||
dappConnection: [
|
},
|
||||||
{
|
dappConnection: [
|
||||||
provider: "ipfs",
|
{
|
||||||
host: "localhost",
|
provider: "ipfs",
|
||||||
port: 5001,
|
host: "localhost",
|
||||||
getUrl: "http://localhost:8080/ipfs/"
|
port: 5001,
|
||||||
}
|
getUrl: "http://localhost:8080/ipfs/"
|
||||||
]
|
}
|
||||||
// Configuration to start Swarm in the same terminal as `embark run`
|
]
|
||||||
/*,account: {
|
// Configuration to start Swarm in the same terminal as `embark run`
|
||||||
address: "YOUR_ACCOUNT_ADDRESS", // Address of account accessing Swarm
|
/*,account: {
|
||||||
password: "PATH/TO/PASSWORD/FILE" // File containing the password of the account
|
address: "YOUR_ACCOUNT_ADDRESS", // Address of account accessing Swarm
|
||||||
},
|
password: "PATH/TO/PASSWORD/FILE" // File containing the password of the account
|
||||||
swarmPath: "PATH/TO/SWARM/EXECUTABLE" // Path to swarm executable (default: swarm)*/
|
},
|
||||||
},
|
swarmPath: "PATH/TO/SWARM/EXECUTABLE" // Path to swarm executable (default: swarm)*/
|
||||||
development: {
|
},
|
||||||
enabled: true,
|
|
||||||
provider: "ipfs",
|
// default environment, merges with the settings in default
|
||||||
upload: {
|
// assumed to be the intended environment by `embark run`
|
||||||
host: "localhost",
|
development: {
|
||||||
port: 5001,
|
enabled: false,
|
||||||
getUrl: "http://localhost:8080/ipfs/"
|
provider: "ipfs",
|
||||||
}
|
upload: {
|
||||||
}
|
host: "localhost",
|
||||||
};
|
port: 5001,
|
||||||
|
getUrl: "http://localhost:8080/ipfs/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run privatenet"
|
||||||
|
privatenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run testnet"
|
||||||
|
testnet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// merges with the settings in default
|
||||||
|
// used with "embark run livenet"
|
||||||
|
livenet: {
|
||||||
|
},
|
||||||
|
|
||||||
|
// you can name an environment with specific settings and then specify with
|
||||||
|
// "embark run custom_name"
|
||||||
|
//custom_name: {
|
||||||
|
//}
|
||||||
|
};
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
test_password
|
test_password
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
host: "localhost",
|
host: "localhost",
|
||||||
port: 8000
|
openBrowser: true,
|
||||||
};
|
port: 8000
|
||||||
|
};
|
||||||
|
|
|
@ -1,21 +1,28 @@
|
||||||
{
|
{
|
||||||
"contracts": ["contracts/**"],
|
"contracts": ["contracts/**"],
|
||||||
"app": {
|
"app": {
|
||||||
"index.html": "app/index.html",
|
"index.html": "app/index.html",
|
||||||
"js/identity.js": ["app/identity.js"],
|
"js/identity.js": ["app/identity.js"],
|
||||||
"identity.html": "app/identity.html",
|
"identity.html": "app/identity.html",
|
||||||
"js/sntcontroller.js": ["app/sntcontroller.js"],
|
"js/sntcontroller.js": ["app/sntcontroller.js"],
|
||||||
"sntcontroller.html": "app/sntcontroller.html",
|
"sntcontroller.html": "app/sntcontroller.html",
|
||||||
"css/dapp.css": ["app/css/**"],
|
"css/dapp.css": ["app/css/**"],
|
||||||
"images/": ["app/images/**"]
|
"images/": ["app/images/**"]
|
||||||
},
|
},
|
||||||
"buildDir": "dist/",
|
"buildDir": "dist/",
|
||||||
"config": "config/",
|
"config": "config/",
|
||||||
"versions": {
|
"versions": {
|
||||||
"web3": "1.0.0-beta",
|
"web3": "1.0.0-beta",
|
||||||
"solc": "0.4.24",
|
"solc": "0.4.25",
|
||||||
"ipfs-api": "17.2.4",
|
"ipfs-api": "17.2.4"
|
||||||
"p-iteration": "1.1.7"
|
},
|
||||||
},
|
"plugins": {
|
||||||
"plugins": {}
|
},
|
||||||
}
|
"options": {
|
||||||
|
"solc": {
|
||||||
|
"optimize": true,
|
||||||
|
"optimize-runs": 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,40 +1,40 @@
|
||||||
{
|
{
|
||||||
"name": "status-contracts",
|
"name": "snt-gas-relay",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "embark test"
|
"test": "embark test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/status-im/contracts.git"
|
"url": "git+https://github.com/status-im/contracts.git"
|
||||||
},
|
},
|
||||||
"author": "Status Research & Development GMBH",
|
"author": "Status Research & Development GMBH",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/status-im/contracts/issues"
|
"url": "https://github.com/status-im/contracts/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/status-im/contracts#readme",
|
"homepage": "https://github.com/status-im/contracts#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^8.2.6",
|
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"@babel/plugin-proposal-decorators": "^7.0.0",
|
||||||
"babel-preset-stage-2": "^6.24.1",
|
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
|
||||||
"eslint": "^4.19.1",
|
"@babel/plugin-proposal-function-sent": "^7.0.0",
|
||||||
"eslint-config-standard": "^11.0.0",
|
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||||
"eslint-plugin-import": "^2.13.0",
|
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
|
||||||
"eslint-plugin-node": "^7.0.1",
|
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
|
||||||
"eslint-plugin-promise": "^3.8.0",
|
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
|
||||||
"eslint-plugin-react": "^7.10.0",
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||||
"eslint-plugin-standard": "^3.1.0"
|
"@babel/plugin-syntax-import-meta": "^7.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "^1.4.3",
|
"@material-ui/core": "^3.0.0",
|
||||||
"@material-ui/icons": "^2.0.1",
|
"@material-ui/icons": "^3.0.0",
|
||||||
"@material-ui/lab": "^1.0.0-alpha.9",
|
"@material-ui/lab": "^1.0.0-alpha.12",
|
||||||
"react": "^16.4.2",
|
"react": "^16.4.2",
|
||||||
"react-blockies": "^1.3.0",
|
"react-blockies": "^1.3.0",
|
||||||
"react-bootstrap": "^0.32.1",
|
"react-bootstrap": "^0.32.1",
|
||||||
"react-dom": "^16.4.2",
|
"react-dom": "^16.4.2",
|
||||||
"web3": "^1.0.0-beta.35"
|
"web3": "^1.0.0-beta.35"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
// /*global contract, config, it, assert*/
|
||||||
|
/*
|
||||||
|
const SimpleStorage = require('Embark/contracts/SimpleStorage');
|
||||||
|
|
||||||
|
let accounts;
|
||||||
|
|
||||||
|
// For documentation please see https://embark.status.im/docs/contracts_testing.html
|
||||||
|
config({
|
||||||
|
//deployment: {
|
||||||
|
// accounts: [
|
||||||
|
// // you can configure custom accounts with a custom balance
|
||||||
|
// // see https://embark.status.im/docs/contracts_testing.html#Configuring-accounts
|
||||||
|
// ]
|
||||||
|
//},
|
||||||
|
contracts: {
|
||||||
|
"SimpleStorage": {
|
||||||
|
args: [100]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, (_err, web3_accounts) => {
|
||||||
|
accounts = web3_accounts
|
||||||
|
});
|
||||||
|
|
||||||
|
contract("SimpleStorage", function () {
|
||||||
|
this.timeout(0);
|
||||||
|
|
||||||
|
it("should set constructor value", async function () {
|
||||||
|
let result = await SimpleStorage.methods.storedData().call();
|
||||||
|
assert.strictEqual(parseInt(result, 10), 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("set storage value", async function () {
|
||||||
|
await SimpleStorage.methods.set(150).send();
|
||||||
|
let result = await SimpleStorage.methods.get().call();
|
||||||
|
assert.strictEqual(parseInt(result, 10), 150);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should have account with balance", async function() {
|
||||||
|
let balance = await web3.eth.getBalance(accounts[0]);
|
||||||
|
assert.ok(parseInt(balance, 10) > 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
*/
|
Loading…
Reference in New Issue