improvements to ux, toggle for prod

enumerate
lza_menace 2 years ago
parent 8f058ead66
commit ab9b4adc7f

@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "DEV=1 vite",
"build": "vite build",
"preview": "vite preview"
},

@ -17,15 +17,17 @@
<br />
Use it to vault your NFTs en masse or to distribute tokens to a large audience for some major gas savings.
<br />
The higher the network gas price, the more savings you will see.
<br />
<br />
Made by <a href="https://twitter.com/lza_menace" target="_blank" rel="noreferrer">lza_menace</a> of the <a href="https://art101.io" target="_blank" rel="noreferrer">Art101</a> team.
<br />
<a href="https://etherscan.io/address/0x76Ae5B6E75F6e05BcaD1028F78A83f974fc96A8B/" target="_blank" rel="noreferrer">
Contract.
Etherscan.
</a>
<a href="https://github.com/lalanza808/shipit-app" rel="noreferrer" target="_blank">
App.
Github (app).
</a>
<a href="https://github.com/lalanza808/shipit" rel="noreferrer" target="_blank">
Github (contract).
</a>
</p>
<Providers />

@ -1,5 +1,5 @@
<script>
import { writable } from 'svelte/store';
// import { CONTRACT } from '$env/dynamic/private';
import { tweened } from 'svelte/motion';
import { cubicOut } from 'svelte/easing';
import { defaultEvmStores as evm, selectedAccount, contracts, web3 } from 'svelte-web3';
@ -11,7 +11,12 @@
duration: 800,
easing: cubicOut
});
const shipit = '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0';
let shipit = '';
if (import.meta.env.DEV) {
shipit = '0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0';
} else {
shipit = '0x76Ae5B6E75F6e05BcaD1028F78A83f974fc96A8B';
}
let errorMessage = '';
let successMessage = '';
let contractAddress = '';
@ -52,6 +57,8 @@
await $contracts.nft.methods.setApprovalForAll(shipit, true).send({from: $selectedAccount});
contractApproved = true;
approvalRequired = false;
approvalPending = false;
clearMessages();
} catch(e) {
errorMessage = `Failed to approve contract: ${e.message}`;
approvalPending = false;
@ -66,6 +73,7 @@
contractApproved = false;
approvalRequired = false;
revokeRequired = false;
revokePending = false;
clearMessages();
} catch(e) {
errorMessage = `Failed to revoke contract: ${e.message}`;
@ -239,6 +247,7 @@
if (res.status) {
document.getElementById('recipientInfo').value = '';
clearMessages();
transferPending = false;
successMessage = `Success! tx ${res.transactionHash}`;
window.scrollTo(0, document.body.scrollHeight);
} else {

Loading…
Cancel
Save