Skip to content

Commit bf01f37

Browse files
author
Ruslan Molchanov
committed
Merge branch 'fix-update' into 'master'
Upgrade working with Metamask See merge request open-platform/api!220
2 parents 27e32d7 + e20b616 commit bf01f37

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

frontend/src/actions/deploy-contract.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import web3 from '../utils/web3';
22
import Eth from 'ethjs';
3-
import ethUtil from 'ethjs-util';
43
import { CONVERT_CURRENCIES, SHOW_MODAL } from './types';
54
import { getScaffoldsPath, getScaffoldDoCompile, getScaffoldDoDeploy } from '../utils/apiPathes';
65
import { apiPost, apiPatch, apiGet } from './apiRequest';
@@ -27,9 +26,9 @@ export const processDeploy = async (contract, bin, platformAddress, formValues)
2726
arguments: [
2827
formValues.developerAddress,
2928
platformAddress,
30-
ethUtil.fromAscii(formValues.fiatAmount),
31-
ethUtil.fromAscii(formValues.currency),
32-
Eth.toWei(formValues.conversionAmount.toString(), 'ether')
29+
web3.utils.fromAscii(formValues.fiatAmount),
30+
web3.utils.fromAscii(formValues.currency),
31+
Eth.toWei(formValues.conversionAmount.toString(), 'ether').toNumber()
3332
]
3433
})
3534
.send({ from: formValues.developerAddress });

frontend/src/utils/web3.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Web3 from 'web3';
33
let web3;
44

55
if (typeof window !== 'undefined' && typeof window.web3 !== 'undefined' && window.web3.currentProvider.isMetaMask) {
6+
window.ethereum && window.ethereum.enable()
67
web3 = new Web3(window.web3.currentProvider);
78
} else {
89
web3 = null;

0 commit comments

Comments
 (0)