Disabling EIP1102 changes
This commit is contained in:
parent
fc5398fddf
commit
93de9e7949
|
@ -2,10 +2,10 @@
|
||||||
<head>
|
<head>
|
||||||
<title>#criptolife@status.im</title>
|
<title>#criptolife@status.im</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" href="css/app.css">
|
<link rel="stylesheet" href="css/app.7.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script src="js/dapp.1.js"></script>
|
<script src="js/dapp.7.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -29,34 +29,6 @@ class App extends React.Component {
|
||||||
|
|
||||||
componentDidMount(){
|
componentDidMount(){
|
||||||
EmbarkJS.onReady(async (error) => {
|
EmbarkJS.onReady(async (error) => {
|
||||||
alert(1);
|
|
||||||
// Modern dapp browsers...
|
|
||||||
if (window.ethereum) {
|
|
||||||
alert(2);
|
|
||||||
window.web3 = new Web3(ethereum);
|
|
||||||
try {
|
|
||||||
alert(3);
|
|
||||||
// Request account access if needed
|
|
||||||
await ethereum.enable();
|
|
||||||
alert(4);
|
|
||||||
this.setup();
|
|
||||||
} catch (error) {
|
|
||||||
alert('Access to ETH wallet required to send funds');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Legacy dapp browsers...
|
|
||||||
else if (window.web3) {
|
|
||||||
window.web3 = new Web3(web3.currentProvider);
|
|
||||||
this.setup();
|
|
||||||
}
|
|
||||||
// Non-dapp browsers...
|
|
||||||
else {
|
|
||||||
alert('Non-Ethereum browser detected. You should consider using Status.im!');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
setup(){
|
|
||||||
const accounts = await web3.eth.getAccounts();
|
const accounts = await web3.eth.getAccounts();
|
||||||
|
|
||||||
if(!accounts.length){
|
if(!accounts.length){
|
||||||
|
@ -80,12 +52,11 @@ class App extends React.Component {
|
||||||
} else {
|
} else {
|
||||||
this.setState({error: true, errorMessage: error.message});
|
this.setState({error: true, errorMessage: error.message});
|
||||||
}
|
}
|
||||||
alert(error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async redirectIfProcessed(code, intervalCheck){
|
async redirectIfProcessed(code, intervalCheck){
|
||||||
const sentToAddress = await SNTGiveaway.methods.sentToAddress(web3.eth.defaultAccount).call({from: web3.eth.defaultAccount});
|
const sentToAddress = await SNTGiveaway.methods.sentToAddress(web3.eth.defaultAccount).call({from: web3.eth.defaultAccount});
|
||||||
const usedCode = await SNTGiveaway.methods.codeUsed( '0x' + code,).call({from: web3.eth.defaultAccount});
|
const usedCode = await SNTGiveaway.methods.codeUsed( '0x' + code,).call({from: web3.eth.defaultAccount});
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"contracts": ["contracts/**"],
|
"contracts": ["contracts/**"],
|
||||||
"app": {
|
"app": {
|
||||||
"css/app.css": ["app/css/**"],
|
"css/app.7.css": ["app/css/**"],
|
||||||
"js/dapp.1.js": ["app/js/index.js"],
|
"js/dapp.7.js": ["app/js/index.js"],
|
||||||
"images/": ["app/images/**"],
|
"images/": ["app/images/**"],
|
||||||
"fonts/": ["app/fonts/**"],
|
"fonts/": ["app/fonts/**"],
|
||||||
"index.html": "app/index.html"
|
"index.html": "app/index.html"
|
||||||
|
|
Loading…
Reference in New Issue