Search
Search

Transaction: 54qBezV...bZLa

Signed by
Receiver
Status
Succeeded
Transaction Fee
0.00061 
Deposit Value
0 
Gas Used
6 Tgas
Attached Gas
100 Tgas
Created
June 14, 2024 at 8:38:01pm
Hash
54qBezVMUjt9Kr8CXGFTywwJLtExNfFdjkY2gXuMbZLa

Actions

Called method: 'set' in contract: social.near
Arguments:
{ "data": { "marior.near": { "widget": { "ShitzuMigrate": { "": "if (\n state.chainId === undefined &&\n ethers !== undefined &&\n Ethers.send(\"eth_requestAccounts\", [])[0]\n) {\n Ethers.provider()\n .getNetwork()\n .then((chainIdData) => {\n if (chainIdData?.chainId) {\n State.update({ chainId: chainIdData.chainId });\n }\n });\n}\nif (state.chainId !== undefined && state.chainId !== 1313161554) {\n return <p>Switch to Aurora Mainnet</p>;\n}\n\nconst shitzuNearAddress = \"token.0xshitzu.near\";\nconst shitzuDaoAddress = \"shitzu.sputnik-dao.near\";\nconst shitzuContractAddress = \"0x68e401B61eA53889505cc1366710f733A60C2d41\";\nconst migrateContractAddress = \"0xA6f40A8Ca2CE1A5D570A52BD34897aBDF75438FF\";\nconst tokenDecimals = 18;\nconst migrationEndTime = new Date(\"2024-06-15T00:00:00.000Z\");\n\nconst migrateAbi = fetch(\n \"https://raw.githubusercontent.com/Shitzu-Apes/token/main/abi/ShitzuMigrate.abi\"\n);\nif (!migrateAbi.ok) {\n return \"Loading\";\n}\n\nconst shitzuRes = fetch(\n \"https://old.explorer.aurora.dev/api/v2/smart-contracts/0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79\"\n);\nif (!shitzuRes.ok) {\n return \"Loading\";\n}\nconst shitzuAbi = shitzuRes.body.abi;\n\nconst setAllowance = (amount) => {\n if (!state.receiverId || amount === undefined || amount === 0) {\n return;\n }\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n const migrateAmount = ethers.utils\n .parseUnits(amount, tokenDecimals)\n .toString();\n shitzuContract\n .approve(migrateContractAddress, migrateAmount)\n .then((txHash) => {\n console.log(\"txHash\", txHash);\n })\n .finally(() => {\n State.update({\n loading: false,\n });\n });\n State.update({\n loading: true,\n });\n};\n\nconst migrate = (amount) => {\n if (!state.receiverId || amount === undefined || amount === 0) {\n return;\n }\n\n asyncFetch(\"https://beta.rpc.mainnet.near.org\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: \"dontcare\",\n method: \"query\",\n params: {\n request_type: \"view_account\",\n finality: \"final\",\n account_id: state.receiverId,\n },\n }),\n }).then((res) => {\n if (!res.ok || res.body.error) {\n State.update({\n receiverError: `Account ${state.receiverId} does not exist!`,\n });\n return;\n }\n if (state.receiverId === shitzuNearAddress) {\n State.update({\n receiverError:\n \"You must not send to the Shitzu token contract. Otherwise your tokens will be locked!\",\n });\n return;\n }\n\n const migrateContract = new ethers.Contract(\n migrateContractAddress,\n migrateAbi.body,\n Ethers.provider().getSigner()\n );\n\n const migrateAmount = ethers.utils\n .parseUnits(amount, tokenDecimals)\n .toString();\n\n migrateContract\n .migrate(state.receiverId, migrateAmount)\n .then((txHash) => {\n console.log(\"txHash\", txHash);\n })\n .finally(() => {\n State.update({\n loading: false,\n });\n });\n State.update({\n loading: true,\n });\n });\n};\n\nif (state.sender === undefined) {\n const accounts = Ethers.send(\"eth_requestAccounts\", []);\n if (accounts.length) {\n State.update({ sender: accounts[0] });\n }\n} else {\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n shitzuContract\n .allowance(state.sender, migrateContractAddress)\n .then((allowance) => {\n State.update({ allowance });\n });\n}\n\nconst getSender = () => {\n return !state.sender\n ? \"\"\n : state.sender.substring(0, 6) +\n \"...\" +\n state.sender.substring(state.sender.length - 4, state.sender.length);\n};\n\nconst updateShitzuBalance = (receiver) => {\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n shitzuContract.balanceOf(receiver).then((shitzuBalance) => {\n State.update({ shitzuBalance });\n });\n};\n\nif (state.shitzuBalance === undefined && state.sender) {\n updateShitzuBalance(state.sender);\n}\n\nlet notEnoughAllowance;\nif (\n state.allowance !== undefined &&\n state.amount !== undefined &&\n !!state.amount\n) {\n notEnoughAllowance =\n state.allowance.toBigInt() <\n ethers.utils.parseUnits(state.amount, tokenDecimals).toBigInt();\n}\nconst disabled =\n state.loading || state.amount === undefined || state.receiverId === undefined;\nlet shitzuBalance;\nif (!!state.shitzuBalance) {\n shitzuBalance = Big(state.shitzuBalance.toString())\n .div(Big(10).pow(tokenDecimals))\n .toFixed(2)\n .replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}\n\nconst totalSupply = Near.view(shitzuNearAddress, \"ft_total_supply\");\nif (!totalSupply) return \"\";\nconst progress = Big(totalSupply)\n .mul(100)\n .div(Big(\"576167000\").mul(Big(10).pow(tokenDecimals)))\n .toFixed(3);\nconst price = JSON.parse(\n fetch(\"https://api.ref.finance/get-token-price?token_id=token.0xshitzu.near\")\n .body\n).price;\nconst marketCap = Big(price)\n .mul(totalSupply)\n .div(Big(10).pow(tokenDecimals))\n .toFixed(2);\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: 1rem;\n max-width: 30rem;\n margin: 0 auto;\n\n label {\n font-size: 1.2rem;\n margin-bottom: 0.1rem;\n }\n`;\nconst Error = styled.span`\n color: #c00;\n`;\nconst Text = styled.div`\n font-size: 1.1rem;\n font-style: italic;\n`;\nconst Progress = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 0.8rem;\n height: 1.6rem;\n width: 100%;\n background: ${({ progress }) =>\n `linear-gradient(to right, lightblue 0% ${progress}%, lightgrey ${progress}% 100%)`};\n`;\nconst Countdown = styled.div`\n border: 1px solid #f00;\n border-radius: 0.6rem;\n background: #fcc;\n padding: 0.6rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 1.8rem;\n font-weight: bold;\n`;\n\nif (state.migrationEndDiff === undefined) {\n State.update({\n migrationEndDiff: Math.trunc(\n (migrationEndTime.valueOf() - Date.now()) / 1_000\n ),\n });\n return \"\";\n}\nsetTimeout(() => {\n State.update({\n migrationEndDiff: Math.trunc(\n (migrationEndTime.valueOf() - Date.now()) / 1_000\n ),\n });\n}, 1_000);\n\nconst seconds = String(state.migrationEndDiff.valueOf() % 60).padStart(2, \"00\");\nconst minutes = String(\n Math.trunc((state.migrationEndDiff.valueOf() / 60) % 60)\n).padStart(2, \"00\");\nconst hours = String(\n Math.trunc((state.migrationEndDiff.valueOf() / (60 * 60)) % 24)\n).padStart(2, \"00\");\nconst days = String(\n Math.trunc(state.migrationEndDiff.valueOf() / (60 * 60 * 24))\n);\n\nreturn (\n <Wrapper>\n <h2 style={{ alignSelf: \"center\" }}>SHITZU Migration</h2>\n\n <Countdown>\n {state.migrationEndDiff > 0 ? (\n <>\n <h3>Migration will close indefinitely in:</h3>\n {days}:{hours}:{minutes}:{seconds}\n </>\n ) : (\n <>\n Migration is closed indefinitely:\n <a\n href=\"https://dev.near.org/astraplusplus.ndctools.near/widget/home?page=dao&tab=proposals&daoId=shitzu.sputnik-dao.near&proposalId=106\"\n target=\"_blank\"\n >\n Proposal\n </a>\n <a href=\"https://shitzuapes.xyz\" target=\"_blank\">\n Website\n </a>\n <a href=\"https://app.shitzuapes.xyz\" target=\"_blank\">\n App\n </a>\n </>\n )}\n </Countdown>\n\n <Progress progress={progress}>{progress}% migrated</Progress>\n\n <h5>Market Cap: {marketCap}$</h5>\n\n <a\n style={{ alignSelf: \"center\" }}\n href={`https://app.ref.finance/#near|${shitzuNearAddress}`}\n target=\"_blank\"\n >\n <button>Buy SHITZU on Ref Finance</button>\n </a>\n\n {state.migrationEndDiff > 0 && (\n <>\n <Text>\n This BOS component lets you migrate SHITZU from Aurora to the new\n contract on Near. The migration will close on June 15th 0:00am UTC.\n Until then you can migrate SHITZU 1:1 for the new token. The old\n SHITZU has address 0x68e401B61eA53889505cc1366710f733A60C2d41 and can\n be bought at{\" \"}\n <a href=\"https://www.trisolaris.io/\" target=\"_blank\">\n Trisolaris\n </a>\n . The new SHITZU has address {shitzuNearAddress}\n </Text>\n\n <div>Logged in as: {getSender()}</div>\n\n <label for=\"receiver\">\n Receiver (Near address)\n <input\n id=\"receiver\"\n disabled={!state.sender}\n value={state.receiverId}\n onChange={(e) =>\n State.update({\n receiverId: e.target.value,\n receiverError: undefined,\n })\n }\n placeholder=\"Receiver (Near address)\"\n />\n <button\n onClick={() => {\n State.update({\n receiverId: shitzuDaoAddress,\n });\n }}\n >\n Donate to DAO\n </button>\n {state.receiverError && <Error>{state.receiverError}</Error>}\n </label>\n\n <label for=\"amount\">\n Amount (SHITZUv1)\n <input\n id=\"amount\"\n disabled={!state.sender}\n value={state.amount}\n onChange={(e) => {\n const amount = e.target.value;\n State.update({ amount: amount.replace(/[^0-9.]/g, \"\") });\n }}\n placeholder=\"Amount (SHITZUv1)\"\n />\n <button\n onClick={() => {\n const shitzuBalance = state.shitzuBalance\n .toString()\n .replace(/[^0-9.]/g, \"\");\n const amount = Big(shitzuBalance.toString())\n .div(Big(10).pow(tokenDecimals))\n .toString();\n State.update({\n amount,\n });\n }}\n >\n MAX\n </button>\n </label>\n\n {state.sender && typeof shitzuBalance === \"string\" && (\n <div>SHITZUv1 balance: {shitzuBalance}</div>\n )}\n\n {!!state.sender ? (\n <>\n <button\n onClick={() => {\n if (notEnoughAllowance) {\n setAllowance(state.amount);\n } else {\n migrate(state.amount);\n }\n }}\n disabled={disabled}\n >\n <span>{notEnoughAllowance ? \"approve SHITZUv1\" : \"Migrate\"}</span>\n </button>\n </>\n ) : (\n <Web3Connect\n connectLabel=\"Connect Web3 Wallet\"\n disconnectLabel=\"Disconnect Web3 Wallet\"\n connectingLabel=\"Connecting...\"\n />\n )}\n </>\n )}\n </Wrapper>\n);\n" } } } } }

Transaction Execution Plan

Convert Transaction To Receipt
Gas Burned:
333 Ggas
Tokens Burned:
0.00003 
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
5 Tgas
Tokens Burned:
0.00058 
Called method: 'set' in contract: social.near
Arguments:
{ "data": { "marior.near": { "widget": { "ShitzuMigrate": { "": "if (\n state.chainId === undefined &&\n ethers !== undefined &&\n Ethers.send(\"eth_requestAccounts\", [])[0]\n) {\n Ethers.provider()\n .getNetwork()\n .then((chainIdData) => {\n if (chainIdData?.chainId) {\n State.update({ chainId: chainIdData.chainId });\n }\n });\n}\nif (state.chainId !== undefined && state.chainId !== 1313161554) {\n return <p>Switch to Aurora Mainnet</p>;\n}\n\nconst shitzuNearAddress = \"token.0xshitzu.near\";\nconst shitzuDaoAddress = \"shitzu.sputnik-dao.near\";\nconst shitzuContractAddress = \"0x68e401B61eA53889505cc1366710f733A60C2d41\";\nconst migrateContractAddress = \"0xA6f40A8Ca2CE1A5D570A52BD34897aBDF75438FF\";\nconst tokenDecimals = 18;\nconst migrationEndTime = new Date(\"2024-06-15T00:00:00.000Z\");\n\nconst migrateAbi = fetch(\n \"https://raw.githubusercontent.com/Shitzu-Apes/token/main/abi/ShitzuMigrate.abi\"\n);\nif (!migrateAbi.ok) {\n return \"Loading\";\n}\n\nconst shitzuRes = fetch(\n \"https://old.explorer.aurora.dev/api/v2/smart-contracts/0x8BEc47865aDe3B172A928df8f990Bc7f2A3b9f79\"\n);\nif (!shitzuRes.ok) {\n return \"Loading\";\n}\nconst shitzuAbi = shitzuRes.body.abi;\n\nconst setAllowance = (amount) => {\n if (!state.receiverId || amount === undefined || amount === 0) {\n return;\n }\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n const migrateAmount = ethers.utils\n .parseUnits(amount, tokenDecimals)\n .toString();\n shitzuContract\n .approve(migrateContractAddress, migrateAmount)\n .then((txHash) => {\n console.log(\"txHash\", txHash);\n })\n .finally(() => {\n State.update({\n loading: false,\n });\n });\n State.update({\n loading: true,\n });\n};\n\nconst migrate = (amount) => {\n if (!state.receiverId || amount === undefined || amount === 0) {\n return;\n }\n\n asyncFetch(\"https://beta.rpc.mainnet.near.org\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: \"dontcare\",\n method: \"query\",\n params: {\n request_type: \"view_account\",\n finality: \"final\",\n account_id: state.receiverId,\n },\n }),\n }).then((res) => {\n if (!res.ok || res.body.error) {\n State.update({\n receiverError: `Account ${state.receiverId} does not exist!`,\n });\n return;\n }\n if (state.receiverId === shitzuNearAddress) {\n State.update({\n receiverError:\n \"You must not send to the Shitzu token contract. Otherwise your tokens will be locked!\",\n });\n return;\n }\n\n const migrateContract = new ethers.Contract(\n migrateContractAddress,\n migrateAbi.body,\n Ethers.provider().getSigner()\n );\n\n const migrateAmount = ethers.utils\n .parseUnits(amount, tokenDecimals)\n .toString();\n\n migrateContract\n .migrate(state.receiverId, migrateAmount)\n .then((txHash) => {\n console.log(\"txHash\", txHash);\n })\n .finally(() => {\n State.update({\n loading: false,\n });\n });\n State.update({\n loading: true,\n });\n });\n};\n\nif (state.sender === undefined) {\n const accounts = Ethers.send(\"eth_requestAccounts\", []);\n if (accounts.length) {\n State.update({ sender: accounts[0] });\n }\n} else {\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n shitzuContract\n .allowance(state.sender, migrateContractAddress)\n .then((allowance) => {\n State.update({ allowance });\n });\n}\n\nconst getSender = () => {\n return !state.sender\n ? \"\"\n : state.sender.substring(0, 6) +\n \"...\" +\n state.sender.substring(state.sender.length - 4, state.sender.length);\n};\n\nconst updateShitzuBalance = (receiver) => {\n const shitzuContract = new ethers.Contract(\n shitzuContractAddress,\n shitzuAbi,\n Ethers.provider().getSigner()\n );\n shitzuContract.balanceOf(receiver).then((shitzuBalance) => {\n State.update({ shitzuBalance });\n });\n};\n\nif (state.shitzuBalance === undefined && state.sender) {\n updateShitzuBalance(state.sender);\n}\n\nlet notEnoughAllowance;\nif (\n state.allowance !== undefined &&\n state.amount !== undefined &&\n !!state.amount\n) {\n notEnoughAllowance =\n state.allowance.toBigInt() <\n ethers.utils.parseUnits(state.amount, tokenDecimals).toBigInt();\n}\nconst disabled =\n state.loading || state.amount === undefined || state.receiverId === undefined;\nlet shitzuBalance;\nif (!!state.shitzuBalance) {\n shitzuBalance = Big(state.shitzuBalance.toString())\n .div(Big(10).pow(tokenDecimals))\n .toFixed(2)\n .replace(/\\d(?=(\\d{3})+\\.)/g, \"$&,\");\n}\n\nconst totalSupply = Near.view(shitzuNearAddress, \"ft_total_supply\");\nif (!totalSupply) return \"\";\nconst progress = Big(totalSupply)\n .mul(100)\n .div(Big(\"576167000\").mul(Big(10).pow(tokenDecimals)))\n .toFixed(3);\nconst price = JSON.parse(\n fetch(\"https://api.ref.finance/get-token-price?token_id=token.0xshitzu.near\")\n .body\n).price;\nconst marketCap = Big(price)\n .mul(totalSupply)\n .div(Big(10).pow(tokenDecimals))\n .toFixed(2);\n\nconst Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n gap: 1rem;\n max-width: 30rem;\n margin: 0 auto;\n\n label {\n font-size: 1.2rem;\n margin-bottom: 0.1rem;\n }\n`;\nconst Error = styled.span`\n color: #c00;\n`;\nconst Text = styled.div`\n font-size: 1.1rem;\n font-style: italic;\n`;\nconst Progress = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 0.8rem;\n height: 1.6rem;\n width: 100%;\n background: ${({ progress }) =>\n `linear-gradient(to right, lightblue 0% ${progress}%, lightgrey ${progress}% 100%)`};\n`;\nconst Countdown = styled.div`\n border: 1px solid #f00;\n border-radius: 0.6rem;\n background: #fcc;\n padding: 0.6rem;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n font-size: 1.8rem;\n font-weight: bold;\n`;\n\nif (state.migrationEndDiff === undefined) {\n State.update({\n migrationEndDiff: Math.trunc(\n (migrationEndTime.valueOf() - Date.now()) / 1_000\n ),\n });\n return \"\";\n}\nsetTimeout(() => {\n State.update({\n migrationEndDiff: Math.trunc(\n (migrationEndTime.valueOf() - Date.now()) / 1_000\n ),\n });\n}, 1_000);\n\nconst seconds = String(state.migrationEndDiff.valueOf() % 60).padStart(2, \"00\");\nconst minutes = String(\n Math.trunc((state.migrationEndDiff.valueOf() / 60) % 60)\n).padStart(2, \"00\");\nconst hours = String(\n Math.trunc((state.migrationEndDiff.valueOf() / (60 * 60)) % 24)\n).padStart(2, \"00\");\nconst days = String(\n Math.trunc(state.migrationEndDiff.valueOf() / (60 * 60 * 24))\n);\n\nreturn (\n <Wrapper>\n <h2 style={{ alignSelf: \"center\" }}>SHITZU Migration</h2>\n\n <Countdown>\n {state.migrationEndDiff > 0 ? (\n <>\n <h3>Migration will close indefinitely in:</h3>\n {days}:{hours}:{minutes}:{seconds}\n </>\n ) : (\n <>\n Migration is closed indefinitely:\n <a\n href=\"https://dev.near.org/astraplusplus.ndctools.near/widget/home?page=dao&tab=proposals&daoId=shitzu.sputnik-dao.near&proposalId=106\"\n target=\"_blank\"\n >\n Proposal\n </a>\n <a href=\"https://shitzuapes.xyz\" target=\"_blank\">\n Website\n </a>\n <a href=\"https://app.shitzuapes.xyz\" target=\"_blank\">\n App\n </a>\n </>\n )}\n </Countdown>\n\n <Progress progress={progress}>{progress}% migrated</Progress>\n\n <h5>Market Cap: {marketCap}$</h5>\n\n <a\n style={{ alignSelf: \"center\" }}\n href={`https://app.ref.finance/#near|${shitzuNearAddress}`}\n target=\"_blank\"\n >\n <button>Buy SHITZU on Ref Finance</button>\n </a>\n\n {state.migrationEndDiff > 0 && (\n <>\n <Text>\n This BOS component lets you migrate SHITZU from Aurora to the new\n contract on Near. The migration will close on June 15th 0:00am UTC.\n Until then you can migrate SHITZU 1:1 for the new token. The old\n SHITZU has address 0x68e401B61eA53889505cc1366710f733A60C2d41 and can\n be bought at{\" \"}\n <a href=\"https://www.trisolaris.io/\" target=\"_blank\">\n Trisolaris\n </a>\n . The new SHITZU has address {shitzuNearAddress}\n </Text>\n\n <div>Logged in as: {getSender()}</div>\n\n <label for=\"receiver\">\n Receiver (Near address)\n <input\n id=\"receiver\"\n disabled={!state.sender}\n value={state.receiverId}\n onChange={(e) =>\n State.update({\n receiverId: e.target.value,\n receiverError: undefined,\n })\n }\n placeholder=\"Receiver (Near address)\"\n />\n <button\n onClick={() => {\n State.update({\n receiverId: shitzuDaoAddress,\n });\n }}\n >\n Donate to DAO\n </button>\n {state.receiverError && <Error>{state.receiverError}</Error>}\n </label>\n\n <label for=\"amount\">\n Amount (SHITZUv1)\n <input\n id=\"amount\"\n disabled={!state.sender}\n value={state.amount}\n onChange={(e) => {\n const amount = e.target.value;\n State.update({ amount: amount.replace(/[^0-9.]/g, \"\") });\n }}\n placeholder=\"Amount (SHITZUv1)\"\n />\n <button\n onClick={() => {\n const shitzuBalance = state.shitzuBalance\n .toString()\n .replace(/[^0-9.]/g, \"\");\n const amount = Big(shitzuBalance.toString())\n .div(Big(10).pow(tokenDecimals))\n .toString();\n State.update({\n amount,\n });\n }}\n >\n MAX\n </button>\n </label>\n\n {state.sender && typeof shitzuBalance === \"string\" && (\n <div>SHITZUv1 balance: {shitzuBalance}</div>\n )}\n\n {!!state.sender ? (\n <>\n <button\n onClick={() => {\n if (notEnoughAllowance) {\n setAllowance(state.amount);\n } else {\n migrate(state.amount);\n }\n }}\n disabled={disabled}\n >\n <span>{notEnoughAllowance ? \"approve SHITZUv1\" : \"Migrate\"}</span>\n </button>\n </>\n ) : (\n <Web3Connect\n connectLabel=\"Connect Web3 Wallet\"\n disconnectLabel=\"Disconnect Web3 Wallet\"\n connectingLabel=\"Connecting...\"\n />\n )}\n </>\n )}\n </Wrapper>\n);\n" } } } } }
Result:
{ "block_height": "121170213" }
No logs
Receipt:
Predecessor ID:
Receiver ID:
Gas Burned:
223 Ggas
Tokens Burned:
0 
Transferred 0.01819  to marior.near
Empty result
No logs