Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/xeon-protocol/xeon-dapp int…
Browse files Browse the repository at this point in the history
…o feat/gas-sponsoring
  • Loading branch information
heyJonBray committed Aug 9, 2024
2 parents c404a20 + ff46b35 commit 1a70ce7
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 57 deletions.
148 changes: 148 additions & 0 deletions src/abi/PriceOracle.abi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
[
{ "inputs": [], "stateMutability": "nonpayable", "type": "constructor" },
{
"inputs": [
{ "internalType": "address", "name": "owner", "type": "address" }
],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [
{ "internalType": "address", "name": "account", "type": "address" }
],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "token",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "price",
"type": "uint256"
}
],
"name": "PriceUpdated",
"type": "event"
},
{
"inputs": [],
"name": "WETH",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "token", "type": "address" }
],
"name": "getValueInWETH",
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oDEGEN",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oHIGHER",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oPEPE",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oROR",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "oVELA",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [{ "internalType": "address", "name": "", "type": "address" }],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "token", "type": "address" },
{ "internalType": "uint256", "name": "priceInWETH", "type": "uint256" }
],
"name": "setTokenPriceInWETH",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "uint256", "name": "priceInUSD", "type": "uint256" }
],
"name": "setWETHPriceInUSD",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{ "internalType": "address", "name": "newOwner", "type": "address" }
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
73 changes: 16 additions & 57 deletions src/components/testing/TokenTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,6 @@ const TokenTable = () => {
visible: { opacity: 1, y: 0 },
};

const glitchVariants = {
visible: {
textShadow: [
'1px 1px 0px lime',
'-1px -1px 0px purple',
'1px -1px 0px lime',
'-1px 1px 0px lime',
'2px 2px 2px lime',
],
transition: {
duration: 0.2,
repeat: Infinity,
repeatType: 'mirror',
},
},
};

const ref = useRef(null);
const inView = useInView(ref);

Expand Down Expand Up @@ -256,16 +239,7 @@ const TokenTable = () => {

return (
<div className="overflow-x-auto overflow-y-hidden mt-10 px-8 pt-8 md:px-20 max-w-screen-2xl mx-auto">
<motion.h1 className="text-3xl text-grey">
<motion.span
variants={glitchVariants}
initial="hidden"
animate={inView ? 'visible' : 'hidden'}
>
Claim
</motion.span>{' '}
Testnet Tokens
</motion.h1>
<h1 className="text-3xl text-grey">Claim Testnet Tokens</h1>
<div className="mb-4">
<input
type="text"
Expand All @@ -275,11 +249,8 @@ const TokenTable = () => {
className="w-full bg-[#26222B] p-2 border text-grey border-gray-300 rounded mt-4"
/>
</div>
<motion.table
<table
ref={ref}
initial="hidden"
animate={inView ? 'visible' : 'hidden'}
variants={tableVariants}
className="min-w-full bg-black border rounded mt-10 text-grey"
>
<thead>
Expand All @@ -289,44 +260,32 @@ const TokenTable = () => {
<th className="py-2 px-4 border-b text-left">ADDR</th>
<th className="py-2 px-4 border-b text-left">PAIR</th>
<th className="py-2 px-4 border-b text-left">SUPPLY</th>
<th className="py-2 px-4 border-b text-left">CTA</th>
<th className="py-2 px-4 border-b text-left">{''}</th>
</tr>
</thead>
<motion.tbody variants={tableVariants}>
<tbody>
{tokens.map((token, index) => (
<motion.tr key={index} variants={rowVariants}>
<motion.td className="py-2 px-4 border-b text-left">
{token.name}
</motion.td>
<motion.td className="py-2 px-4 border-b text-left">
{token.symbol}
</motion.td>
<motion.td className="py-2 px-4 border-b text-left">
<tr key={index}>
<td className="py-2 px-4 border-b text-left">{token.name}</td>
<td className="py-2 px-4 border-b text-left">{token.symbol}</td>
<td className="py-2 px-4 border-b text-left">
<a
target="_blank"
rel="noreferrer noopener"
href={`https://sepolia.basescan.org/address/${token.address}`}
>
{token.address.slice(0, 14)}...
</a>

<button
className="ml-2 bg-black text-white px-2 py-1 rounded hover:text-lime-400"
onClick={() => copyToClipboard(token.address)}
>
<FaCopy />
</button>
</motion.td>
<motion.td
className="py-2 px-4 border-b text-left"
variants={glitchVariants}
>
{token.pair}
</motion.td>
<motion.td className="py-2 px-4 border-b text-left">
{token.supply}
</motion.td>
<motion.td className="py-2 px-4 border-b text-left">
</td>
<td className="py-2 px-4 border-b text-left">{token.pair}</td>
<td className="py-2 px-4 border-b text-left">{token.supply}</td>
<td className="py-2 px-4 border-b text-left">
{token.name === 'WETH' ? (
<p>
visit
Expand All @@ -352,11 +311,11 @@ const TokenTable = () => {
)}
</div>
)}
</motion.td>
</motion.tr>
</td>
</tr>
))}
</motion.tbody>
</motion.table>
</tbody>
</table>

<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
Expand Down

0 comments on commit 1a70ce7

Please sign in to comment.