Skip to content

Commit

Permalink
integrated contract in pay
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh11515 committed Feb 16, 2023
1 parent 3375337 commit 3a746d0
Show file tree
Hide file tree
Showing 11 changed files with 3,029 additions and 2,939 deletions.
2 changes: 1 addition & 1 deletion contracts/.keystore/dinesh.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"address":"e643cf465ede9ad11e152bab8d3cdc6cbc3712e1","id":"7b1c4539-2590-487b-a185-a80cd9ec6803","version":3,"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"1604473865ba5ae684d58ce0dc53400e"},"ciphertext":"4c98240a7df683c3e5eba5194fcc91decaaa46318420dcb431cb47fb5f705054","kdf":"scrypt","kdfparams":{"salt":"c4925ac4115a60e3e7181a1ec7777aaedb404ffe8af9089372bc430436cfa111","n":131072,"dklen":32,"p":1,"r":8},"mac":"4ba3f626b20ec10e973ade9c3375b11243ec82d46ed5acee50d9aaed634fd4f7"},"x-ethers":{"client":"ethers.js","gethFilename":"UTC--2023-02-08T05-02-54.0Z--e643cf465ede9ad11e152bab8d3cdc6cbc3712e1","mnemonicCounter":"62f51230c6b456199c87b3c6183648e6","mnemonicCiphertext":"eb67bf6a3fb736177f455acf202a6a74","path":"m/44'/60'/0'/0/0","locale":"en","version":"0.1"}}
{"address":"e643cf465ede9ad11e152bab8d3cdc6cbc3712e1","id":"c387f110-d1b8-44d7-a389-9d2dcc3ad4a2","version":3,"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"8c4ccfc470ba50c96b354cadd1d52588"},"ciphertext":"5e02aaa584100be7af765bfd05b9d5499680712deaffdc5f801a7ab5406fab75","kdf":"scrypt","kdfparams":{"salt":"ed35f80c5c127c19ec3e02e3b74527c7c485977bcc6b81617a92f1387c22f205","n":131072,"dklen":32,"p":1,"r":8},"mac":"aff3e5fbf3bfcfa3f0667e00e333e5e820e2573adde0f4ebcacd9d76848b06f6"},"x-ethers":{"client":"ethers.js","gethFilename":"UTC--2023-02-16T12-53-31.0Z--e643cf465ede9ad11e152bab8d3cdc6cbc3712e1","mnemonicCounter":"39c9502013e2dcdcd550229c54909d6c","mnemonicCiphertext":"ac2cd53341ced3cfdb89dd3924b9bae1","path":"m/44'/60'/0'/0/0","locale":"en","version":"0.1"}}
8 changes: 8 additions & 0 deletions contracts/contracts/LinkPay.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,12 @@ contract LinkPay {
_amount * (10**token.decimals())
);
}

function getTokensByUser(string memory _username)
public
view
returns (tokenDetails[] memory)
{
return acceptableTokens[_username];
}
}
3 changes: 3 additions & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const config: HardhatUserConfig = {
url: "https://dimensional-fabled-patron.matic-testnet.discover.quiknode.pro/52f7211c36c11560b648d2af0576acb8e9fb8062/",
},
},
etherscan: {
apiKey: "USK8S3HV5D9GMWA14TF9WKI4KRBW4Z27C7",
},
};

export default config;
7 changes: 3 additions & 4 deletions contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { ethers } from "hardhat";
import { ethers, accounts } from "hardhat";

async function main() {
// We get the contract to deploy
const signer = await ethers.getSigners();
console.log("signer", signer[0].address);
const LinkPay = await ethers.getContractFactory("LinkPay");
const signer = await accounts.getSigners();
const LinkPay = await ethers.getContractFactory("LinkPay", signer[0]);
const linkPay = await LinkPay.deploy();

await linkPay.deployed();
Expand Down
2 changes: 1 addition & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/babel", "next/core-web-vitals"]
}
File renamed without changes.
33 changes: 32 additions & 1 deletion frontend/constants/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const contractAddress = "0xe0f388c6d7ce0540ffb7c5e5ff2b444e64eb2fcd";
export const contractAddress = "0x367B56C44A598B27f9083EC1DbEfe1B3ea42C377";
export const contractABI = [
{
inputs: [
Expand Down Expand Up @@ -210,6 +210,37 @@ export const contractABI = [
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "string",
name: "_username",
type: "string",
},
],
name: "getTokensByUser",
outputs: [
{
components: [
{
internalType: "address",
name: "tokenAddress",
type: "address",
},
{
internalType: "string",
name: "tokenName",
type: "string",
},
],
internalType: "struct LinkPay.tokenDetails[]",
name: "",
type: "tuple[]",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
Expand Down
7 changes: 5 additions & 2 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
images: {
domains: ["i.seadn.io"],
},
};

module.exports = nextConfig
module.exports = nextConfig;
Loading

1 comment on commit 3a746d0

@vercel
Copy link

@vercel vercel bot commented on 3a746d0 Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

linkpay – ./

linkpay-git-main-dinesh11515.vercel.app
linkpay-dinesh11515.vercel.app
linkpay.vercel.app

Please sign in to comment.