Skip to content

Commit

Permalink
feature: defined contract address in .env
Browse files Browse the repository at this point in the history
  • Loading branch information
srdarkseer committed Apr 19, 2024
1 parent 4e8a462 commit 61563a6
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const nextConfig = {
NEXT_PUBLIC_APP_ID: process.env.NEXT_PUBLIC_APP_ID,
NEXT_PUBLIC_SERVER_URL: process.env.NEXT_PUBLIC_SERVER_URL,
MORALIS_API_KEY: process.env.MORALIS_API_KEY,
SAI_CONTRACT_ADDRESS: process.env.SAI_CONTRACT_ADDRESS,
},
// images: {
// loader: process.env.NODE_ENV === "production" ? "custom" : "default",
Expand Down
72 changes: 72 additions & 0 deletions src/lib/contractABI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
export default function contractABI() {
const abi = [
// Dummy Contract ABI
{
inputs: [
{
internalType: "string",
name: "_name",
type: "string",
},
{
internalType: "uint256",
name: "_age",
type: "uint256",
},
],
name: "createPerson",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "_personAddress",
type: "address",
},
],
name: "getPerson",
outputs: [
{
internalType: "string",
name: "name",
type: "string",
},
{
internalType: "uint256",
name: "age",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "personAddress",
type: "address",
},
{
indexed: false,
internalType: "string",
name: "name",
type: "string",
},
{
indexed: false,
internalType: "uint256",
name: "age",
type: "uint256",
},
],
name: "PersonCreated",
type: "event",
},
];
}
3 changes: 2 additions & 1 deletion src/views/Landing/components/PopUpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@ const PopUpModal = ({ isOpen }: { isOpen: boolean }) => {
ethersProvider = new ethers.providers.Web3Provider(wallet.provider, "any");
}

const contractAddress = "0xe722C6833a0BF4B874C18C3f10cB54fD58A4180A";
const contractAddress = `${process.env.SAI_CONTRACT_ADDRESS}`; // SAI's Contract Address
const contractABI = [
// Dummy Contract ABI
{
inputs: [
{
Expand Down

0 comments on commit 61563a6

Please sign in to comment.