Skip to content
Permalink
Browse files

add link details, fix package vulnerability

  • Loading branch information...
thanhson1085 committed Dec 20, 2017
1 parent 24d0d5d commit 5bd3b1956dbca94d30a363be171136c47fec5538
Showing with 69 additions and 25 deletions.
  1. +20 −2 app/App.vue
  2. +28 −1 models/blockchain/index.js
  3. +0 −5 package-lock.json
  4. +21 −17 sockets/index.js
@@ -67,13 +67,30 @@
<p>Tomocoin Smart Contract: <a target='_blank' :href="'https://rinkeby.etherscan.io/token/' + mainchainInformation.tmcAddress">{{ mainchainInformation.tmcAddress }}</a></p>
<p>CashOut Smart Contract: <a target='_blank' :href="'https://rinkeby.etherscan.io/address/' + mainchainInformation.cashOutAddress">{{ mainchainInformation.cashOutAddress }}</a></p>
<p>CashIn Smart Contract: <a target='_blank' :href="'https://rinkeby.etherscan.io/address/' + mainchainInformation.cashInAddress">{{ mainchainInformation.cashInAddress }}</a></p>
<p>Github: <a target="_blank" href="https://github.com/TOMOAPP/Tomo-CashFlows-PoC">https://github.com/TOMOAPP/Tomo-CashFlows-PoC</a></p>
<p>Do not send ethers nor tokens to any of the addresses above. They are for test only and we are not likely to have control of them in mainnet.</p>
</md-content>
<md-dialog-actions>
<md-button class="md-primary" @click="showMainchainInformation = false">Close</md-button>
</md-dialog-actions>
</md-dialog>

<md-dialog :md-active.sync="showSidechainInformation">
<md-dialog-title>Tomochain</md-dialog-title>
<md-content>
<p>Reward Engine Smart Contract: {{ sidechainInformation.rewardEngineAddress }}</p>
<p>Tomocoin Smart Contract: {{ sidechainInformation.tmcAddress }}</p>
<p>CashOut Smart Contract: {{ sidechainInformation.cashOutAddress }}</p>
<p>CashIn Smart Contract: {{ sidechainInformation.cashInAddress }}</a></p>
<p>Github: <a target="_blank" href="https://github.com/TOMOAPP/Tomo-CashFlows-PoC">https://github.com/TOMOAPP/Tomo-CashFlows-PoC</a></p>
<p>Do not send ethers nor tokens to any of the addresses above. They are for test only and we are not likely to have control of them in mainnet.</p>
</md-content>
<md-dialog-actions>
<md-button class="md-primary" @click="showSidechainInformation = false">Close</md-button>
</md-dialog-actions>
</md-dialog>


<div class="sumaryCoin">
<h3>You have total:</h3>
<h1>
@@ -114,7 +131,7 @@
</md-card-header-text>
</md-card-header>
<md-card-content>
The coins you have in <strong class="side-chain">tomochain</strong>. You can transfer the coins to <strong class="main-chain">ethereum</strong> by clicking <strong>cash out</strong> button.
The coins you have in <strong class="side-chain">tomochain</strong>. You can transfer the coins to <strong class="main-chain">ethereum</strong> by clicking <strong>cash out</strong> button. <a @click="showSidechainInformation = true" href="#">View more ></a>
</md-card-content>
</md-card>
</div>
@@ -265,13 +282,15 @@ export default {
showPrivateKey: false,
showBackupKey: false,
showMainchainInformation: false,
showSidechainInformation: false,
msgAlert: '',
expandSumaryCoin: false,
state: localStorage.wallet ? 'mainScreen' : 'getStart',
walletAddress: walletAddress,
walletPrivateKey: walletPrivateKey,
walletMnemonic: walletMnemonic,
mainchainInformation: '',
sidechainInformation: '',
tmcSidechain: 0,
tmcMainchain: 0,
cashOutValue: '',
@@ -309,7 +328,6 @@ export default {
this.$socket.emit('user', {address: this.walletAddress})
},
user: function(user){
console.log(user);
this.logs = user.logs;
this.mainchainInformation = user.mainchainInformation;
this.sidechainInformation = user.sidechainInformation;
@@ -45,6 +45,32 @@ const getMainchainAddresses = () => {
return CashOutMainchain.deployed().then(com => {
ret.cashOutAddress = com.address;
return ret;
}).then(() => {
return CashInMainchain.deployed().then(cim => {
ret.cashInAddress = cim.address;
return ret;
});
});
});
};

const getSidechainAddresses = () => {
const ret = {};
return TomoCoinSidechain.deployed().then(tc => {
ret.tmcAddress = tc.address;
return CashOutSidechain.deployed().then(com => {
ret.cashOutAddress = com.address;
return ret;
}).then(() => {
return CashInSidechain.deployed().then(cim => {
ret.cashInAddress = cim.address;
return ret;
});
}).then(() => {
return RewardEngine.deployed().then(re => {
ret.rewardEngineAddress = re.address;
return ret;
});
});
});
};
@@ -59,5 +85,6 @@ module.exports = {
CashInMainchain,
rootAddressSidechain,
rootAddressMainchain,
getMainchainAddresses
getMainchainAddresses,
getSidechainAddresses
};

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -11,7 +11,8 @@ const {RewardEngine,
CashInMainchain,
TomoCoinSidechain,
TomoCoinMainchain,
getMainchainAddresses
getMainchainAddresses,
getSidechainAddresses
} = require('../models/blockchain');

const q = require('../queues');
@@ -123,22 +124,25 @@ const sockets = (io) => {
db.Wallet.findOne({
walletAddress: data.address
}).then(w => {
getMainchainAddresses().then(addresses => {
socket.emit('user', {
mainchainInformation: addresses,
tmcSidechain: parseFloat((w || {}).tmcSidechain || 0),
tmcMainchain: parseFloat((w || {}).tmcMainchain || 0),
logs: ((w || {}).logs || []).map(l => {
return {
msg: l.message,
type: l.type,
change: l.change,
time: l.time,
tmcSidechain: parseFloat(l.tmcSidechain),
tmcMainchain: parseFloat(l.tmcMainchain),
total: parseFloat(l.tmcSidechain) + parseFloat(l.tmcMainchain)
}
})
getMainchainAddresses().then(mc => {
getSidechainAddresses().then(sc => {
socket.emit('user', {
mainchainInformation: mc,
sidechainInformation: sc,
tmcSidechain: parseFloat((w || {}).tmcSidechain || 0),
tmcMainchain: parseFloat((w || {}).tmcMainchain || 0),
logs: ((w || {}).logs || []).map(l => {
return {
msg: l.message,
type: l.type,
change: l.change,
time: l.time,
tmcSidechain: parseFloat(l.tmcSidechain),
tmcMainchain: parseFloat(l.tmcMainchain),
total: parseFloat(l.tmcSidechain) + parseFloat(l.tmcMainchain)
}
})
});
});
});
});

0 comments on commit 5bd3b19

Please sign in to comment.
You can’t perform that action at this time.