diff --git a/images/social_facebook.png b/images/social_facebook.png new file mode 100644 index 00000000..648a15cc Binary files /dev/null and b/images/social_facebook.png differ diff --git a/images/social_github.png b/images/social_github.png new file mode 100644 index 00000000..329d602d Binary files /dev/null and b/images/social_github.png differ diff --git a/images/social_medium.png b/images/social_medium.png new file mode 100644 index 00000000..7c040168 Binary files /dev/null and b/images/social_medium.png differ diff --git a/images/social_riot.png b/images/social_riot.png new file mode 100644 index 00000000..7a027dc7 Binary files /dev/null and b/images/social_riot.png differ diff --git a/images/social_slack.png b/images/social_slack.png new file mode 100644 index 00000000..e2e643e1 Binary files /dev/null and b/images/social_slack.png differ diff --git a/images/social_twitter.png b/images/social_twitter.png new file mode 100644 index 00000000..77f5b2d4 Binary files /dev/null and b/images/social_twitter.png differ diff --git a/images/social_youtube.png b/images/social_youtube.png new file mode 100644 index 00000000..5ff42800 Binary files /dev/null and b/images/social_youtube.png differ diff --git a/index.html b/index.html index 67ca555e..7e202f9b 100644 --- a/index.html +++ b/index.html @@ -1,82 +1,92 @@ - - - - Swarm City - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + }); + } + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/data/data-simpledeal.html b/src/data/data-simpledeal.html index 60a23252..599631d8 100644 --- a/src/data/data-simpledeal.html +++ b/src/data/data-simpledeal.html @@ -35,7 +35,7 @@ // generate the itemHash const itemHash = hdWallet.createItem(seeker.privateKey); - // 1. Encode the newItem method to be sent through approveAndCall + // 1. Encode the newItem method to be sent through transferAndCall const simpleDealContract = new _web3.eth.Contract(simpleDeal.abi, hashtag.address); const rawNewItem = simpleDealContract.methods.newItem( itemHash, @@ -43,7 +43,7 @@ metadataHash.bytes32 ).encodeABI(); const tokenContract = new _web3.eth.Contract(kovSwtToken.abi, hashtag.tokenAddress); - const rawApproveAndCall = tokenContract.methods.approveAndCall( + const rawTransferAndCall = tokenContract.methods.transferAndCall( hashtag.address, // spender totalSum, // totalSum rawNewItem, // next call data @@ -59,7 +59,7 @@ gasPrice: 1000000000, gasLimit: 3000000, to: hashtag.tokenAddress, - data: rawApproveAndCall, + data: rawTransferAndCall, chainId: 42, }); tx.sign(new Buffer(seeker.privateKey, 'hex')); @@ -161,7 +161,7 @@ item.hash ).encodeABI(); const tokenContract = new _web3.eth.Contract(kovSwtToken.abi, hashtag.tokenAddress); - const rawApproveAndCall = tokenContract.methods.approveAndCall( + const rawTransferAndCall = tokenContract.methods.transferAndCall( hashtag.address, // spender totalSum, // totalSum rawFundItem, // next call data @@ -177,7 +177,7 @@ gasPrice: 1000000000, gasLimit: 3000000, to: hashtag.tokenContractAddress, - data: rawApproveAndCall, + data: rawTransferAndCall, chainId: 42, }); tx.sign(new Buffer(provider.privateKey, 'hex')); diff --git a/src/data/data-transaction.html b/src/data/data-transaction.html index 6906b006..a215fd21 100644 --- a/src/data/data-transaction.html +++ b/src/data/data-transaction.html @@ -6,7 +6,8 @@ // Import libraries const Tx = webpack.EthereumTx const Buffer = webpack.Buffer.Buffer - const _web3 = window.web3Local + const _web3 = window.web3Kovan + const _web3Mainnet = window.web3Mainnet const sha3 = webpack.sha3 const ipfs = window.ipfs @@ -83,6 +84,73 @@ }) } + + async function tokenMainTxAsync({ + sender, + receiverAddress, + amount, + tokenContractAddress }) { + + let tokens = _web3Mainnet.utils.toWei(amount.toString(), 'ether'); + + const tokenContract = new webpack.Contract( + kovSwtToken.abi, + tokenContractAddress); + let rawTokenTx = tokenContract.methods.transfer( + receiverAddress, + tokens + ).encodeABI(); + + // 2. Get user's nonce + const nonce = await _web3Mainnet.eth.getTransactionCount(sender.address) + + // 3. Generate tx object, sign and serialize + const tx = new Tx({ + nonce: _web3Mainnet.utils.toHex(nonce), + from: sender.address, + gasPrice: 21000000000, + gasLimit: 1500000, + to: tokenContractAddress, + data: rawTokenTx, + chainId: 1, + }); + tx.sign(new Buffer(sender.privateKey, 'hex')); + const serializedTx = tx.serialize(); + + // 4. Send transaction, await receipt. + // Extra line for clarity + const hash = await sendSignedTransactionMain('0x' + serializedTx.toString('hex')) + return hash + } + + function sendSignedTransactionMain(tx) { + return new Promise((resolve, reject) => { + let _hash; + _web3Mainnet.eth.sendSignedTransaction(tx) + .once('transactionHash', (hash) => { + resolve(hash) + _hash = hash + }) + .on('receipt', (receipt) => { + console.log('received receipt for txHash: ' + hash, receipt); + }) + .on('error', (err, receipt) => { + if (err.message && + err.message.startsWith('Failed to check for transaction receipt') + ) { + console.log('Another complaint about the receipt ignored.'); + } else { + if (receipt) { + console.error('We might be out of Gas: %j', receipt); + } else { + console.error(err); + } + reject(new Error('Transaction error: ' + err)); + } + }); + }) + } + class DataTransaction extends Polymer.Element { static get is() { return 'data-transaction'; @@ -90,6 +158,9 @@ tokenTx(args) { return tokenTxAsync(args) } + tokenMainTx(args) { + return tokenMainTxAsync(args) + } } window.customElements.define(DataTransaction.is, DataTransaction); diff --git a/src/displays/display-backup.html b/src/displays/display-backup.html index ea5320ea..4e8632c0 100644 --- a/src/displays/display-backup.html +++ b/src/displays/display-backup.html @@ -302,23 +302,24 @@ * downloads account info, after success routs to download-success */ _download() { - let storage = JSON.parse(localStorage.getItem('SwarmCity')); - const filename = `SwarmCity - UTC KeyStore`; - storage.keyStore.avatar = storage.user.avatar; - storage.keyStore.username = storage.user.username; - const text = JSON.stringify(storage.keyStore); - const element = document.createElement('a'); - element.setAttribute('href', `data:application/json;charset=utf-8,${encodeURIComponent(text)}`); - element.setAttribute('download', filename); - element.style.display = 'none'; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - if (this.route.path == '/make-backup/') { - this.path = 'download-success/'; - } else { - this.path = 'download-success-profile/'; - } + let storage = JSON.parse(localStorage.getItem('SwarmCity')); + const filename = 'SwarmCity - UTC KeyStore'; + storage.keyStore.avatar = storage.user.avatar; + storage.keyStore.username = storage.user.username; + storage.keyStore.avatarHash = storage.user.avatarHash; + const text = JSON.stringify(storage.keyStore); + const element = document.createElement('a'); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + + encodeURIComponent(text)); + element.setAttribute('download', filename); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + if (this.route.path == '/make-backup/') { + this.path = 'download-success/'; + } else { + this.path = 'download-success-profile/'; } /** * check for operating system for enable/disable the download backup file link diff --git a/src/displays/display-complete-transaction.html b/src/displays/display-complete-transaction.html index cb400c0f..4a709b13 100644 --- a/src/displays/display-complete-transaction.html +++ b/src/displays/display-complete-transaction.html @@ -102,7 +102,7 @@ sender, receiverAddress, weiAmount, - tokenAddress: '0x0ADBc89464Cb7fa752ADCf3533514949A2547589', + tokenAddress: '0xf69ca736d959519a79f9075021444a8a0ee384d3', }).then((serializedTx) => { this.dispatch({ type: 'BROADCAST', diff --git a/src/displays/display-error.html b/src/displays/display-error.html index 8e8af7d1..881617b2 100644 --- a/src/displays/display-error.html +++ b/src/displays/display-error.html @@ -26,6 +26,14 @@ .container { background-color: var(--sc-green); @apply --titlepage-closed-container; + top: 0; + left: 0; + bottom: 0; + right: 0; + position: absolute; + min-width: 100vw; + min-height: 100vh; + z-index: 1; } .container .top { diff --git a/src/displays/display-restore-json-file.html b/src/displays/display-restore-json-file.html index fec46714..1ede0722 100644 --- a/src/displays/display-restore-json-file.html +++ b/src/displays/display-restore-json-file.html @@ -180,7 +180,8 @@
{{filename}}
- +
{{error}}
@@ -346,7 +347,7 @@ */ _decrypt() { if (this.wallet.Crypto) { - // check password before dooing any of this + // check password before doing any of this this.$.wallet.decryptUtcKeystore(this.wallet, this.password) .then(() => { let storage = JSON.parse(localStorage.getItem('SwarmCity')); @@ -356,20 +357,32 @@ } else { storage.user.avatar = this.wallet.avatar; } - storage.user.username = this.wallet.username; - delete storage.keyStore.username; - delete storage.keyStore.avatar; - localStorage.setItem('SwarmCity', JSON.stringify(storage)); - this.dispatch({ type: 'PUBLICKEY', publicKey: storage.keyStore.address }); - this.dispatch({ type: 'USERNAME', username: storage.user.username }); - - if (sessionStorage.getItem('origin')) { - this.path = sessionStorage.getItem('origin'); - sessionStorage.removeItem('origin'); - } - else { - this.set('route.path', 'hashtag-list'); - } + const ipfs = window.ipfs + ipfs.add(storage.user.avatar) + .then(hash => { + storage.user.avatarHash = hash.hash; + storage.user.username = this.wallet.username; + delete storage.keyStore.username; + delete storage.keyStore.avatar; + delete storage.keyStore.avatarHash; + localStorage.setItem('SwarmCity', JSON.stringify(storage)); + this.dispatch({ type: 'UPDATE_AVATARHASH', avatarHash: storage.user.avatarHash }); + this.dispatch({ type: 'PUBLICKEY', publicKey: storage.keyStore.address }); + this.dispatch({ type: 'USERNAME', username: storage.user.username }); + + if (sessionStorage.getItem('origin')) { + this.path = sessionStorage.getItem('origin'); + sessionStorage.removeItem('origin'); + } + else { + this.set('route.path', 'hashtag-list'); + } + + + }) + .catch(err => { + console.error('error resolving ipfs hash for avatar', err) + }) }) .catch(() => { this.error = 'wrong password'; @@ -387,7 +400,7 @@ storage.user.username = this.wallet.identity.username; localStorage.setItem('SwarmCity', JSON.stringify(storage)); if (this.wallet.identity.avatarhash) { - this.dispatch({ type: 'REQIPFS', reqipfs: this.wallet.identity.avatarhash }); + this.dispatch({ type: 'UPDATE_AVATARHASH', avatarHash: this.wallet.identity.avatarhash }); } this.dispatch({ type: 'PUBLICKEY', publicKey: storage.keyStore.address }); this.dispatch({ type: 'USERNAME', username: storage.user.username }); diff --git a/src/displays/display-show-keys.html b/src/displays/display-show-keys.html index 12ae0c5b..6599d559 100644 --- a/src/displays/display-show-keys.html +++ b/src/displays/display-show-keys.html @@ -297,7 +297,7 @@ _loadAnimations() { this.anim = { moveUp: { - arr: [{ transform: 'translateY(20px)' }, + arr: [{ transform: 'translateY(15px)' }, { transform: 'translateY(0px)' }], obj: { fill: 'both', diff --git a/src/pages/detail/detail-simpledeal-main.html b/src/pages/detail/detail-simpledeal-main.html index fbdb9fd0..e9012f23 100644 --- a/src/pages/detail/detail-simpledeal-main.html +++ b/src/pages/detail/detail-simpledeal-main.html @@ -75,6 +75,10 @@ @apply --body-detail; color: var(--sc-grey4); margin: 20px 30px 0 30px; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } .container[wide-layout] .description { @@ -174,7 +178,7 @@ @apply --small-bold; color: var(--sc-grey3); height: 0px; - margin-bottom: -5px; + /* margin-bottom: -5px; */ visibility: hidden; background-image: var(--sc-bg); } @@ -194,6 +198,10 @@ @apply --layout-horizontal; } + .showcopied { + visibility: visible; + } + @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) { @@ -244,6 +252,7 @@
@@ -259,8 +268,23 @@ } static get properties() { return { - item: Object, + item: Object, address: String, + anim: { + type: Object, + value: { + moveUp: { + arr: [{ transform: 'translateY(0px)' }, + { transform: 'translateY(-20px)' }], + obj: { + fill: 'both', + duration: 250, + direction: 'normal', + easing: 'cubic-bezier(0.42, 0, 0.177, 0.751)', + }, + } + } + } } } /** @@ -307,6 +331,23 @@ _isSeeker(item) { return (item && item.seekerAddress && this.address && item.seekerAddress == this.address); } + _copyUrl() { + let textArea = document.createElement('textarea'); + textArea.value = window.location.href; + document.body.appendChild(textArea); + textArea.select(); + document.execCommand('copy'); + document.body.removeChild(textArea); + let copied = this.shadowRoot.querySelector('#copied'); + copied.classList.add('showcopied'); + copied.animate( + this.anim.moveUp.arr, + this.anim.moveUp.obj + ); + setTimeout(() => { + copied.classList.remove('showcopied'); + }, 500); + } } window.customElements.define(MyDetailSimpledealMain.is, MyDetailSimpledealMain); diff --git a/src/pages/detail/detail-simpledeal.html b/src/pages/detail/detail-simpledeal.html index 3e186cfb..7dbd512d 100644 --- a/src/pages/detail/detail-simpledeal.html +++ b/src/pages/detail/detail-simpledeal.html @@ -390,7 +390,7 @@ const hashtag = { address: this.hashtag.address, fee: this.hashtag.hashtagFee, - tokenContractAddress: "0x0adbc89464cb7fa752adcf3533514949a2547589" + tokenContractAddress: "0xf69ca736d959519a79f9075021444a8a0ee384d3" }; this.$.simpledeal diff --git a/src/pages/my-wallet/my-wallet-balance.html b/src/pages/my-wallet/my-wallet-balance.html index 8d20a8fd..6af01be5 100644 --- a/src/pages/my-wallet/my-wallet-balance.html +++ b/src/pages/my-wallet/my-wallet-balance.html @@ -49,7 +49,7 @@
[[balance]] SWT
-
[[usd]] USD
+
diff --git a/src/pages/my-wallet/my-wallet-cash-transfer.html b/src/pages/my-wallet/my-wallet-cash-transfer.html index 1a13824c..5e1373fb 100644 --- a/src/pages/my-wallet/my-wallet-cash-transfer.html +++ b/src/pages/my-wallet/my-wallet-cash-transfer.html @@ -153,7 +153,7 @@ privateKey } - const tokenContractAddress = '0x0adbc89464cb7fa752adcf3533514949a2547589'; + const tokenContractAddress = '0xf69ca736d959519a79f9075021444a8a0ee384d3'; this.$.transaction.tokenTx({ sender, receiverAddress: this.receiver.address, amount: this.amount, tokenContractAddress }) .then(receipt => { diff --git a/src/pages/my-wallet/my-wallet-reserves-transfer-add.html b/src/pages/my-wallet/my-wallet-reserves-transfer-add.html new file mode 100644 index 00000000..a66dbd09 --- /dev/null +++ b/src/pages/my-wallet/my-wallet-reserves-transfer-add.html @@ -0,0 +1,203 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/pages/my-wallet/my-wallet-reserves-transfer-send.html b/src/pages/my-wallet/my-wallet-reserves-transfer-send.html index 11474370..6298e826 100644 --- a/src/pages/my-wallet/my-wallet-reserves-transfer-send.html +++ b/src/pages/my-wallet/my-wallet-reserves-transfer-send.html @@ -26,6 +26,11 @@ max-width: 100%; } + .container[wide-layout] { + @apply --layout-start; + width: 100%; + } + .horizontal { @apply --layout-horizontal; @apply --layout-start-justified; @@ -36,7 +41,7 @@ .notification { font-size: 12px; - margin-top: 20px; + color: var(--sc-grey3b) } paper-input { @@ -103,6 +108,13 @@ @apply --button-active; } + .cash { + @apply --body-bold; + box-sizing: border-box; + padding: 5px 0px; + + } + .agree { @apply --next-blue-normal; } @@ -117,13 +129,15 @@ -
+
SWT
+ To +
Cash
{{error}} @@ -188,6 +202,7 @@ } })); } + this._reset(); } } window.customElements.define(MyWalletReservesTransferSend.is, MyWalletReservesTransferSend); diff --git a/src/pages/my-wallet/my-wallet-reserves-transfer.html b/src/pages/my-wallet/my-wallet-reserves-transfer.html index 4fa0d4b8..bf4a7f02 100644 --- a/src/pages/my-wallet/my-wallet-reserves-transfer.html +++ b/src/pages/my-wallet/my-wallet-reserves-transfer.html @@ -10,8 +10,13 @@ --> + + + + + diff --git a/src/redux/app-selectors.html b/src/redux/app-selectors.html index 179b095c..f2a40896 100644 --- a/src/redux/app-selectors.html +++ b/src/redux/app-selectors.html @@ -7,12 +7,12 @@ balance.cash = { wei: state.balance.kovan.swt ? state.balance.kovan.swt : 0, hr: state.balance.kovan.swt ? (state.balance.kovan.swt / 1e18).toFixed(2) : '...', - usd: state.balance.kovan.swt ? (state.balance.kovan.swt / 1e18).toFixed(2) * 0.3 : '...', + usd: state.balance.kovan.swt ? (state.balance.kovan.swt / 1e18).toFixed(2) * 0.1 : '...', } balance.reserves = { wei: state.balance.mainnet.swt ? state.balance.mainnet.swt : 0, hr: state.balance.mainnet.swt ? (state.balance.mainnet.swt / 1e18).toFixed(2) : '...', - usd: state.balance.mainnet.swt ? (state.balance.mainnet.swt / 1e18).toFixed(2) * 0.3 : '...', + usd: state.balance.mainnet.swt ? (state.balance.mainnet.swt / 1e18).toFixed(2) * 0.1 : '...', } return balance; } else { diff --git a/src/redux/contractsData.js b/src/redux/contractsData.js index a787e2e3..74020385 100644 --- a/src/redux/contractsData.js +++ b/src/redux/contractsData.js @@ -273,484 +273,14 @@ window.contractsData = { ] }, kovSwtToken: { - address: "0x0adbc89464cb7fa752adcf3533514949a2547589", - creationBlock: 7288019, - abi: [ - { - constant: true, - inputs: [], - name: "name", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_spender", type: "address" }, - { name: "_amount", type: "uint256" } - ], - name: "approve", - outputs: [{ name: "success", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "creationBlock", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "totalSupply", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_from", type: "address" }, - { name: "_to", type: "address" }, - { name: "_amount", type: "uint256" } - ], - name: "transferFrom", - outputs: [{ name: "success", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "decimals", - outputs: [{ name: "", type: "uint8" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [{ name: "_newController", type: "address" }], - name: "changeController", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [ - { name: "_owner", type: "address" }, - { name: "_blockNumber", type: "uint256" } - ], - name: "balanceOfAt", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "version", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_cloneTokenName", type: "string" }, - { name: "_cloneDecimalUnits", type: "uint8" }, - { name: "_cloneTokenSymbol", type: "string" }, - { name: "_snapshotBlock", type: "uint256" }, - { name: "_transfersEnabled", type: "bool" } - ], - name: "createCloneToken", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [{ name: "_owner", type: "address" }], - name: "balanceOf", - outputs: [{ name: "balance", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "parentToken", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_owner", type: "address" }, - { name: "_amount", type: "uint256" } - ], - name: "generateTokens", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "symbol", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [{ name: "_blockNumber", type: "uint256" }], - name: "totalSupplyAt", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_to", type: "address" }, - { name: "_amount", type: "uint256" } - ], - name: "transfer", - outputs: [{ name: "success", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "transfersEnabled", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "parentSnapShotBlock", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_spender", type: "address" }, - { name: "_amount", type: "uint256" }, - { name: "_extraData", type: "bytes" } - ], - name: "approveAndCall", - outputs: [{ name: "success", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_owner", type: "address" }, - { name: "_amount", type: "uint256" } - ], - name: "destroyTokens", - outputs: [{ name: "", type: "bool" }], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [ - { name: "_owner", type: "address" }, - { name: "_spender", type: "address" } - ], - name: "allowance", - outputs: [{ name: "remaining", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [{ name: "_token", type: "address" }], - name: "claimTokens", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "tokenFactory", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [{ name: "_transfersEnabled", type: "bool" }], - name: "enableTransfers", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "controller", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - inputs: [ - { name: "_tokenFactory", type: "address" }, - { name: "_parentToken", type: "address" }, - { name: "_parentSnapShotBlock", type: "uint256" }, - { name: "_tokenName", type: "string" }, - { name: "_decimalUnits", type: "uint8" }, - { name: "_tokenSymbol", type: "string" }, - { name: "_transfersEnabled", type: "bool" } - ], - payable: false, - stateMutability: "nonpayable", - type: "constructor" - }, - { payable: true, stateMutability: "payable", type: "fallback" }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "_token", type: "address" }, - { indexed: true, name: "_controller", type: "address" }, - { indexed: false, name: "_amount", type: "uint256" } - ], - name: "ClaimedTokens", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "_from", type: "address" }, - { indexed: true, name: "_to", type: "address" }, - { indexed: false, name: "_amount", type: "uint256" } - ], - name: "Transfer", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "_cloneToken", type: "address" }, - { indexed: false, name: "_snapshotBlock", type: "uint256" } - ], - name: "NewCloneToken", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "_owner", type: "address" }, - { indexed: true, name: "_spender", type: "address" }, - { indexed: false, name: "_amount", type: "uint256" } - ], - name: "Approval", - type: "event" - } - ] + address: "0xf69ca736d959519a79f9075021444a8a0ee384d3", + creationBlock: 8420473, + abi: [{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"transferAndCall","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"},{"name":"_to","type":"address"}],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"finishMinting","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getTokenInterfacesVersion","outputs":[{"name":"major","type":"uint64"},{"name":"minor","type":"uint64"},{"name":"patch","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint8"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[],"name":"MintFinished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"burner","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}] }, hashtagDir: { - address: "0xcD4Ebd0E849e648821Db4ECcB3565CA2b58c4457", - creationBlock: 9295750, - abi: [ - { - constant: false, - inputs: [{ name: "_index", type: "uint256" }], - name: "disableHashtag", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_index", type: "uint256" }, - { name: "_hashtagName", type: "string" }, - { name: "_hashtagMetaIPFS", type: "string" }, - { name: "_hashtagAddress", type: "address" } - ], - name: "updateHashtag", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "numberOfHashtags", - outputs: [{ name: "", type: "uint256" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [ - { name: "_hashtagName", type: "string" }, - { name: "_hashtagMetaIPFS", type: "string" }, - { name: "_hashtagAddress", type: "address" } - ], - name: "addHashtag", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: false, - inputs: [], - name: "renounceOwnership", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: false, - inputs: [{ name: "_index", type: "uint256" }], - name: "enableHashtag", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - constant: true, - inputs: [], - name: "owner", - outputs: [{ name: "", type: "address" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "hashtagListIpfs", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [{ name: "_index", type: "uint256" }], - name: "readHashtag", - outputs: [ - { name: "hashtagName", type: "string" }, - { name: "hashtagMetaIPFS", type: "string" }, - { name: "hashtagAddress", type: "address" }, - { name: "hashtagShown", type: "bool" } - ], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: true, - inputs: [], - name: "hashtagListName", - outputs: [{ name: "", type: "string" }], - payable: false, - stateMutability: "view", - type: "function" - }, - { - constant: false, - inputs: [{ name: "newOwner", type: "address" }], - name: "transferOwnership", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function" - }, - { - inputs: [ - { name: "_hashtagListName", type: "string" }, - { name: "_hashtagListIpfs", type: "string" } - ], - payable: false, - stateMutability: "nonpayable", - type: "constructor" - }, - { - anonymous: false, - inputs: [ - { indexed: false, name: "hashtagName", type: "string" }, - { indexed: false, name: "hashtagMetaIPFS", type: "string" }, - { indexed: false, name: "hashtagAddress", type: "address" } - ], - name: "HashtagAdded", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: false, name: "hashtagName", type: "string" }, - { indexed: false, name: "hashtagMetaIPFS", type: "string" }, - { indexed: false, name: "hashtagAddress", type: "address" } - ], - name: "HashtagUpdated", - type: "event" - }, - { - anonymous: false, - inputs: [{ indexed: true, name: "previousOwner", type: "address" }], - name: "OwnershipRenounced", - type: "event" - }, - { - anonymous: false, - inputs: [ - { indexed: true, name: "previousOwner", type: "address" }, - { indexed: true, name: "newOwner", type: "address" } - ], - name: "OwnershipTransferred", - type: "event" - } - ] + address: "0x54423b557a5204f39f4d6fdd170dd27cba8000cb", + creationBlock: 9475942, + abi: [{"constant":false,"inputs":[{"name":"_index","type":"uint256"}],"name":"disableHashtag","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_index","type":"uint256"},{"name":"_hashtagName","type":"string"},{"name":"_hashtagMetaIPFS","type":"string"},{"name":"_hashtagAddress","type":"address"}],"name":"updateHashtag","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfHashtags","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_hashtagName","type":"string"},{"name":"_hashtagMetaIPFS","type":"string"},{"name":"_hashtagAddress","type":"address"}],"name":"addHashtag","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashtagListIpfs","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_index","type":"uint256"}],"name":"readHashtag","outputs":[{"name":"hashtagName","type":"string"},{"name":"hashtagMetaIPFS","type":"string"},{"name":"hashtagAddress","type":"address"},{"name":"hashtagShown","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hashtagListName","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_hashtagListName","type":"string"},{"name":"_hashtagListIpfs","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"hashtagName","type":"string"},{"indexed":false,"name":"hashtagMetaIPFS","type":"string"},{"indexed":false,"name":"hashtagAddress","type":"address"}],"name":"HashtagAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}] }, simpleDeal: { address: null, diff --git a/src/redux/sagas/setup.html b/src/redux/sagas/setup.html index f7ec7a18..a8af1903 100644 --- a/src/redux/sagas/setup.html +++ b/src/redux/sagas/setup.html @@ -24,7 +24,8 @@ kovan: 'ws://my.kovan.dnp.dappnode.eth:8546' }, swarmcity: { - mainnet: 'wss://mainnet.swarm.city', + //mainnet: 'wss://mainnet.infura.io/ws', + mainnet: 'wss://paritymain.swarm.city', kovan: 'wss://kovan.swarm.city' } } @@ -49,14 +50,15 @@ }); window.web3s[chain].setProvider(provider); }); - setInterval(() => { web3s['kovan'].eth.getBlockNumber() }, 30 * 1000); - setInterval(() => { web3s['mainnet'].eth.getBlockNumber() }, 30 * 1000); } window.web3Mainnet = web3s.mainnet window.web3Kovan = web3s.kovan window.web3Local = window.web3Kovan + setInterval(() => { window.web3Kovan.eth.getBlockNumber() }, 30 * 1000); + setInterval(() => { window.web3Mainnet.eth.getBlockNumber().catch(e => console.log('error on mainnet, need to reconnect', e)) }, 30 * 1000); + /** * Contract addresses */ @@ -64,10 +66,10 @@ production: { bridge: { mainnet: { - address: '0x3410349F1e02E3beab54b1513FC2C9D2bAb6D7aC' // FOREIGN_BRIDGE_ADDRESS + address: '0xa90906A394A4Ae934f1A47B04ac64458D56A7273' // FOREIGN_BRIDGE_ADDRESS }, kovan: { - address: '0xFeAf593f51A53efA8523E5baA8f0EBDc6B2deB69' // HOME_BRIDGE_ADDRESS + address: '0x46037e01Dae6D4D85e3160298863Ee5916073ee4' // HOME_BRIDGE_ADDRESS } }, token: { @@ -77,13 +79,13 @@ abi: [...contractAbis.erc20TokenBalance, ...contractAbis.erc20TokenEventTransfer, ...contractAbis.erc20TokenTransfer] }, kovan: { - address: '0x0adbc89464cb7fa752adcf3533514949a2547589',// ERC20_TOKEN_ADDRESS for KOVAN FAKE SWT (unbridged) - deployedBlockNumber: 7288019, - abi: [...contractAbis.erc20TokenBalance, ...contractAbis.erc20TokenEventTransfer, ...contractAbis.erc20TokenTransfer] + address: '0xf69ca736d959519a79f9075021444a8a0ee384d3', // BRIDGEABLE_TOKEN_ADDRESS + deployedBlockNumber: 8420473, + abi: [...contractAbis.erc20TokenBalance, ...contractAbis.erc20TokenEventTransfer, ...contractAbis.erc677TokenTransferAndCall] } }, hashtagDir: { - address: '0xbde0a0218b87f138a4f421d5c75e71e19af9bc50' + address: '0x315e21f889F9a722367c211a0AD636E7b97D087A' } }, development: { @@ -116,10 +118,10 @@ window.contracts = contracts['production'] /* - * Setup IPFS with a simple retry async flow. - * It will attempt each function 3 times before returning the error - * - **/ + * Setup IPFS with a simple retry async flow. + * It will attempt each function 3 times before returning the error + * + **/ // const ipfs = IpfsApi("localhost", "5001", { protocol: "http" }); // const ipfs = IpfsApi("ipfs.infura.io", "5001", { protocol: "https" }); // console.log("Redux-sagas is using ipfs at https://ipfs.infura.io:5001"); diff --git a/src/redux/sagas/user-saga.html b/src/redux/sagas/user-saga.html index 4cad2f83..79a13b74 100644 --- a/src/redux/sagas/user-saga.html +++ b/src/redux/sagas/user-saga.html @@ -151,7 +151,7 @@ tokenData.abi, tokenData.address ); - if (chain == 'kovan') return await token.methods.balanceOf(address).call() + return await token.methods.balanceOf(address).call() } const createNewBlocksChannel = (chain) => eventChannel(emitter => { diff --git a/src/shared-styles.html b/src/shared-styles.html index 51761d85..059a20a9 100644 --- a/src/shared-styles.html +++ b/src/shared-styles.html @@ -479,7 +479,7 @@ --general-divider: { width: 100vw; - background-color: rgba(0, 0, 0, 0.05); + background-color: #dddddd; opacity: 1; height: 1px; }