diff --git a/src/index.css b/src/index.css index d8b41341..bb3562bf 100644 --- a/src/index.css +++ b/src/index.css @@ -43,7 +43,7 @@ input[type='radio'] { margin: 0 5px 0 5px; } -#libraryLabel { +.libraryLabel { font-size: large; } diff --git a/src/index.html b/src/index.html index 29f2cbca..ad11fe52 100644 --- a/src/index.html +++ b/src/index.html @@ -30,13 +30,13 @@

-
+
- + - +
diff --git a/src/index.js b/src/index.js index e63f978a..ad641b8f 100644 --- a/src/index.js +++ b/src/index.js @@ -192,22 +192,14 @@ function initializeLibrarySwitches() { function handleLibraryChange(event) { libraryInUse = event.target.value; if (libraryInUse === 'web3') { - // Deployed piggy bank smart contract with web3 library piggyBankContract = web3PiggyBankContract; - // Deployed hst smart contract with web3 library hstContract = web3HstContract; - // Deployed collectibles smart contract with web3 library collectiblesContract = web3CollectiblesContract; - // Deployed failing smart contract with web3 library failingContract = web3FailingContract; } else { - // Deployed piggy bank smart contract with ethers library piggyBankContract = ethersPiggyBankContract; - // Deployed hst smart contract with ethers library hstContract = ethersHstContract; - // Deployed collectibles smart contract with ethers library collectiblesContract = ethersCollectiblesContract; - // Deployed failing smart contract with ethers library failingContract = ethersFailingContract; } @@ -217,7 +209,7 @@ function handleLibraryChange(event) { depositButton.disabled = false; withdrawButton.disabled = false; } else { - contractStatus.innerHTML = 'Not clicked'; + contractStatus.innerHTML = 'Not deployed'; depositButton.disabled = true; withdrawButton.disabled = true; } @@ -258,11 +250,9 @@ function handleLibraryChange(event) { failingContractStatus.innerHTML = 'Deployed'; sendFailingButton.disabled = false; } else { - failingContractStatus.innerHTML = 'Not clicked'; + failingContractStatus.innerHTML = 'Not deployed'; sendFailingButton.disabled = true; } - - console.log(libraryInUse); } const initialize = async () => { @@ -497,8 +487,12 @@ const initialize = async () => { }) .then((receipt) => { console.log(receipt); + contractStatus.innerHTML = 'Deposit completed'; + }) + .catch((error) => { + console.log(error); + contractStatus.innerHTML = 'Contract call error'; }); - contractStatus.innerHTML = 'Deposit completed'; }; } @@ -520,12 +514,14 @@ const initialize = async () => { }) .then((receipt) => { console.log(receipt); + contractStatus.innerHTML = 'Withdrawn'; + }) + .catch((error) => { + console.log(error); + contractStatus.innerHTML = 'Contract call error'; }); - contractStatus.innerHTML = 'Withdrawn'; }; } - - console.log(piggyBankContract); }; deployFailingButton.disabled = false; @@ -602,9 +598,7 @@ const initialize = async () => { .send({ from: accounts[0], }) - .then((receipt) => { - console.log(receipt); - }); + .then((receipt) => console.log(receipt)); collectiblesStatus.innerHTML = 'Mint completed'; }; } @@ -712,9 +706,7 @@ const initialize = async () => { gas: 60000, gasPrice: '20000000000', }) - .then((receipt) => { - console.log(receipt); - }); + .then((receipt) => console.log(receipt)); }; } @@ -741,9 +733,7 @@ const initialize = async () => { gas: 60000, gasPrice: '20000000000', }) - .then((receipt) => { - console.log(receipt); - }); + .then((receipt) => console.log(receipt)); }; } @@ -767,9 +757,7 @@ const initialize = async () => { from: accounts[0], gasPrice: '20000000000', }) - .then((receipt) => { - console.log(receipt); - }); + .then((receipt) => console.log(receipt)); }; } @@ -793,9 +781,7 @@ const initialize = async () => { from: accounts[0], gasPrice: '20000000000', }) - .then((receipt) => { - console.log(receipt); - }); + .then((receipt) => console.log(receipt)); }; } };