├── test
└── .gitkeep
├── .eslintrc
├── public
├── favicon.ico
└── vercel.svg
├── postcss.config.js
├── next.config.js
├── migrations
├── 1_initial_migration.js
├── 3_polymarket_migration.js
└── 2_polytoken_migration.js
├── next-env.d.ts
├── tailwind.config.js
├── pages
├── api
│ └── hello.ts
├── _app.tsx
├── admin
│ ├── markets.tsx
│ └── index.tsx
├── index.tsx
├── portfolio.tsx
└── market
│ └── [id].tsx
├── styles
├── globals.css
└── Home.module.css
├── contracts
├── Migrations.sol
├── PolyToken.sol
└── Polymarket.sol
├── .gitignore
├── tsconfig.json
├── truffle-config.js
├── package.json
├── components
├── Chart
│ └── ChartContainer.tsx
├── AdminMarketCard.tsx
├── Filter.tsx
├── Navbar.tsx
├── MarketCard.tsx
└── PortfolioMarketCard.tsx
├── contexts
└── DataContext.tsx
├── README.md
└── abis
├── Context.json
├── IERC20Metadata.json
└── IERC20.json
/test/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["next", "next/core-web-vitals"]
3 | }
4 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/viral-sangani/Polymarket-clone/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | reactStrictMode: true,
3 | images: {
4 | domains: ["ipfs.infura.io"],
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | const Migrations = artifacts.require("Migrations");
2 |
3 | module.exports = function (deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/migrations/3_polymarket_migration.js:
--------------------------------------------------------------------------------
1 | const Polymarket = artifacts.require("Polymarket");
2 |
3 | module.exports = async function (deployer) {
4 | await deployer.deploy(
5 | Polymarket,
6 | "0xe450830A28e479F8bd6f8C1706B1CAB160Cb313F"
7 | );
8 | };
9 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 | ///
4 |
5 | // NOTE: This file should not be edited
6 | // see https://nextjs.org/docs/basic-features/typescript for more information.
7 |
--------------------------------------------------------------------------------
/tailwind.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | purge: ["./pages/**/*.{js,ts,jsx,tsx}", "./components/**/*.{js,ts,jsx,tsx}"],
3 | darkMode: false, // or 'media' or 'class'
4 | theme: {
5 | extend: {},
6 | },
7 | variants: {
8 | extend: {},
9 | },
10 | plugins: [],
11 | };
12 |
--------------------------------------------------------------------------------
/pages/api/hello.ts:
--------------------------------------------------------------------------------
1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2 | import type { NextApiRequest, NextApiResponse } from 'next'
3 |
4 | type Data = {
5 | name: string
6 | }
7 |
8 | export default function handler(
9 | req: NextApiRequest,
10 | res: NextApiResponse
11 | ) {
12 | res.status(200).json({ name: 'John Doe' })
13 | }
14 |
--------------------------------------------------------------------------------
/pages/_app.tsx:
--------------------------------------------------------------------------------
1 | import type { AppProps } from "next/app";
2 | import "tailwindcss/tailwind.css";
3 | import { DataProvider } from "../contexts/DataContext";
4 | import "../styles/globals.css";
5 |
6 | function MyApp({ Component, pageProps }: AppProps) {
7 | return (
8 |
9 |
10 |
11 | );
12 | }
13 | export default MyApp;
14 |
--------------------------------------------------------------------------------
/migrations/2_polytoken_migration.js:
--------------------------------------------------------------------------------
1 | const PolyToken = artifacts.require("PolyToken");
2 | // const Polymarket = artifacts.require("Polymarket");
3 |
4 | module.exports = async function (deployer) {
5 | await deployer.deploy(PolyToken);
6 | const polyToken = await PolyToken.deployed();
7 | console.log(`polyToken.address`, polyToken.address)
8 | // await deployer.deploy(Polymarket, polyToken.address);
9 | };
10 |
--------------------------------------------------------------------------------
/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | a {
10 | color: inherit;
11 | text-decoration: none;
12 | }
13 |
14 | * {
15 | box-sizing: border-box;
16 | }
17 |
18 | @media (min-width: 640px) {
19 | .w-fixed {
20 | flex: 0 1 230px;
21 | min-width: 230px;
22 | }
23 | }
--------------------------------------------------------------------------------
/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity >=0.4.22 <0.9.0;
3 |
4 | contract Migrations {
5 | address public owner = msg.sender;
6 | uint public last_completed_migration;
7 |
8 | modifier restricted() {
9 | require(
10 | msg.sender == owner,
11 | "This function is restricted to the contract's owner"
12 | );
13 | _;
14 | }
15 |
16 | function setCompleted(uint completed) public restricted {
17 | last_completed_migration = completed;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/contracts/PolyToken.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: GPL-3.0
2 | pragma solidity ^0.8.6;
3 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4 |
5 | contract PolyToken is ERC20 {
6 | address public owner;
7 |
8 | constructor() ERC20("Poly Token", "POLY") {
9 | owner = msg.sender;
10 | _mint(msg.sender, 100000 * 10**18);
11 | }
12 |
13 | function mint(address to, uint256 amount) external {
14 | require(msg.sender == owner, "Only owner can mint");
15 | _mint(to, amount);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env.local
29 | .env.development.local
30 | .env.test.local
31 | .env.production.local
32 |
33 | # vercel
34 | .vercel
35 | .secret
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "lib": [
5 | "dom",
6 | "dom.iterable",
7 | "esnext"
8 | ],
9 | "allowJs": true,
10 | "skipLibCheck": true,
11 | "strict": true,
12 | "forceConsistentCasingInFileNames": true,
13 | "noEmit": true,
14 | "esModuleInterop": true,
15 | "module": "esnext",
16 | "moduleResolution": "node",
17 | "resolveJsonModule": true,
18 | "isolatedModules": true,
19 | "jsx": "preserve",
20 | "incremental": true
21 | },
22 | "include": [
23 | "next-env.d.ts",
24 | "**/*.ts",
25 | "**/*.tsx"
26 | ],
27 | "exclude": [
28 | "node_modules"
29 | ]
30 | }
31 |
--------------------------------------------------------------------------------
/truffle-config.js:
--------------------------------------------------------------------------------
1 | const HDWalletProvider = require("@truffle/hdwallet-provider");
2 | const fs = require("fs");
3 | const mnemonic = fs.readFileSync(".secret").toString().trim();
4 |
5 | module.exports = {
6 | networks: {
7 | development: {
8 | host: "localhost",
9 | port: 8545,
10 | network_id: "*",
11 | },
12 | matic: {
13 | provider: () =>
14 | new HDWalletProvider(
15 | mnemonic,
16 | `https://matic-mumbai.chainstacklabs.com`
17 | ),
18 | network_id: 80001,
19 | confirmations: 2,
20 | timeoutBlocks: 200,
21 | skipDryRun: true,
22 | chainId: 80001,
23 | },
24 | },
25 | contracts_directory: "./contracts",
26 | contracts_build_directory: "./abis",
27 | compilers: {
28 | solc: {
29 | version: "^0.8.6",
30 | optimizer: {
31 | enabled: true,
32 | runs: 200,
33 | },
34 | },
35 | },
36 |
37 | db: {
38 | enabled: false,
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "polymarket",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start",
9 | "lint": "next lint"
10 | },
11 | "dependencies": {
12 | "@headlessui/react": "^1.4.1",
13 | "@heroicons/react": "^1.0.5",
14 | "@openzeppelin/contracts": "^4.3.2",
15 | "@truffle/hdwallet-provider": "^1.6.0",
16 | "@types/canvasjs": "^1.9.7",
17 | "@types/plotly.js-dist-min": "^2.3.0",
18 | "autoprefixer": "^10.4.0",
19 | "chartjs-adapter-moment": "^1.0.0",
20 | "ipfs-http-client": "^53.0.1",
21 | "moment": "^2.29.1",
22 | "next": "12.0.1",
23 | "plotly.js": "^2.6.2",
24 | "plotly.js-dist-min": "^2.6.2",
25 | "postcss": "^8.3.11",
26 | "react": "17.0.2",
27 | "react-chartjs-2": "^3.3.0",
28 | "react-dom": "17.0.2",
29 | "tailwindcss": "^2.2.19",
30 | "web3": "^1.6.0"
31 | },
32 | "devDependencies": {
33 | "@types/react": "17.0.33",
34 | "eslint": "7.32.0",
35 | "eslint-config-next": "12.0.1",
36 | "typescript": "4.4.4"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/components/Chart/ChartContainer.tsx:
--------------------------------------------------------------------------------
1 | import Plotly from "plotly.js-dist-min";
2 | import React, { useEffect } from "react";
3 | import Web3 from "web3";
4 | import { useData } from "../../contexts/DataContext";
5 |
6 | interface Props {
7 | questionId: string;
8 | }
9 |
10 | interface ChartData {
11 | time: Date[];
12 | amount: number[];
13 | }
14 |
15 | const ChartContainer: React.FC = ({ questionId }) => {
16 | const { polymarket } = useData();
17 |
18 | const fetchGraphData = async () => {
19 | var data = await polymarket.methods.getGraphData(questionId).call();
20 | var yesData: ChartData = {
21 | time: [],
22 | amount: [],
23 | };
24 | var noData: ChartData = {
25 | time: [],
26 | amount: [],
27 | };
28 | data["0"].forEach((item: any) => {
29 | var sum = yesData.amount.reduce((a, b) => a + b, 0);
30 | yesData.amount.push(
31 | sum + parseFloat(Web3.utils.fromWei(item[1], "ether"))
32 | );
33 | yesData.time.push(new Date(parseInt(item[2] + "000")));
34 | });
35 | data["1"].forEach((item: any) => {
36 | var sum = noData.amount.reduce((a, b) => a + b, 0);
37 | noData.amount.push(
38 | sum + parseFloat(Web3.utils.fromWei(item[1], "ether"))
39 | );
40 | noData.time.push(new Date(parseInt(item[2] + "000")));
41 | });
42 |
43 | var yes = {
44 | x: [...yesData.time],
45 | y: [...yesData.amount],
46 | mode: "lines+markers",
47 | name: "Yes",
48 | };
49 |
50 | var no = {
51 | x: [...noData.time],
52 | y: [...noData.amount],
53 | mode: "lines+markers",
54 | name: "No",
55 | };
56 | var chartData = [yes, no];
57 |
58 | var layout = {
59 | title: "YES / NO Graph",
60 | };
61 |
62 | Plotly.newPlot("myDiv", chartData, layout, { displayModeBar: false });
63 | };
64 |
65 | useEffect(() => {
66 | fetchGraphData();
67 | });
68 |
69 | return (
70 | <>
71 |
72 | >
73 | );
74 | };
75 |
76 | export default ChartContainer;
77 |
--------------------------------------------------------------------------------
/components/AdminMarketCard.tsx:
--------------------------------------------------------------------------------
1 | import Img from "next/image";
2 | import React from "react";
3 | import Web3 from "web3";
4 |
5 | interface Props {
6 | id: string;
7 | title: string;
8 | imageHash: string;
9 | totalAmount: string;
10 | onYes: () => void;
11 | onNo: () => void;
12 | }
13 |
14 | export const AdminMarketCard: React.FC = ({
15 | title,
16 | totalAmount,
17 | onYes,
18 | onNo,
19 | imageHash,
20 | }) => {
21 | return (
22 |
23 |
24 |
25 |
26 |

32 |
33 |
{title}
34 |
35 |
36 |
37 |
38 | Total Liquidity
39 |
40 |
41 | {parseFloat(Web3.utils.fromWei(totalAmount, "ether")).toFixed(2)}{" "}
42 | POLY
43 |
44 |
45 |
46 | Ending In
47 | 12 Days
48 |
49 |
50 |
56 |
62 |
63 |
64 |
65 |
66 | );
67 | };
68 |
--------------------------------------------------------------------------------
/styles/Home.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | min-height: 100vh;
3 | padding: 0 0.5rem;
4 | display: flex;
5 | flex-direction: column;
6 | justify-content: center;
7 | align-items: center;
8 | /* height: 100vh; */
9 | }
10 |
11 | .main {
12 | padding: 5rem 0;
13 | flex: 1;
14 | display: flex;
15 | flex-direction: column;
16 | justify-content: center;
17 | align-items: center;
18 | }
19 |
20 | .footer {
21 | width: 100%;
22 | height: 100px;
23 | border-top: 1px solid #eaeaea;
24 | display: flex;
25 | justify-content: center;
26 | align-items: center;
27 | }
28 |
29 | .footer a {
30 | display: flex;
31 | justify-content: center;
32 | align-items: center;
33 | flex-grow: 1;
34 | }
35 |
36 | .title a {
37 | color: #0070f3;
38 | text-decoration: none;
39 | }
40 |
41 | .title a:hover,
42 | .title a:focus,
43 | .title a:active {
44 | text-decoration: underline;
45 | }
46 |
47 | .title {
48 | margin: 0;
49 | line-height: 1.15;
50 | font-size: 4rem;
51 | }
52 |
53 | .title,
54 | .description {
55 | text-align: center;
56 | }
57 |
58 | .description {
59 | line-height: 1.5;
60 | font-size: 1.5rem;
61 | }
62 |
63 | .code {
64 | background: #fafafa;
65 | border-radius: 5px;
66 | padding: 0.75rem;
67 | font-size: 1.1rem;
68 | font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
69 | Bitstream Vera Sans Mono, Courier New, monospace;
70 | }
71 |
72 | .grid {
73 | display: flex;
74 | align-items: center;
75 | justify-content: center;
76 | flex-wrap: wrap;
77 | max-width: 800px;
78 | margin-top: 3rem;
79 | }
80 |
81 | .card {
82 | margin: 1rem;
83 | padding: 1.5rem;
84 | text-align: left;
85 | color: inherit;
86 | text-decoration: none;
87 | border: 1px solid #eaeaea;
88 | border-radius: 10px;
89 | transition: color 0.15s ease, border-color 0.15s ease;
90 | width: 45%;
91 | }
92 |
93 | .card:hover,
94 | .card:focus,
95 | .card:active {
96 | color: #0070f3;
97 | border-color: #0070f3;
98 | }
99 |
100 | .card h2 {
101 | margin: 0 0 1rem 0;
102 | font-size: 1.5rem;
103 | }
104 |
105 | .card p {
106 | margin: 0;
107 | font-size: 1.25rem;
108 | line-height: 1.5;
109 | }
110 |
111 | .logo {
112 | height: 1em;
113 | margin-left: 0.5rem;
114 | }
115 |
116 | @media (max-width: 600px) {
117 | .grid {
118 | width: 100%;
119 | flex-direction: column;
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/components/Filter.tsx:
--------------------------------------------------------------------------------
1 | import { Menu, Transition } from "@headlessui/react";
2 | import { ChevronDownIcon } from "@heroicons/react/solid";
3 | import { Fragment } from "react";
4 |
5 | interface Props {
6 | list: string[];
7 | activeItem: string;
8 | category: string;
9 | onChange: (item: string) => void;
10 | }
11 |
12 | export const Filter: React.FC = ({
13 | list,
14 | activeItem,
15 | category,
16 | onChange,
17 | }) => {
18 | return (
19 | <>
20 |
30 |
39 |
40 |
41 | {list.map((item) => (
42 |
onChange(item)}>
43 | {({ active }) => {
44 | return (
45 |
52 | );
53 | }}
54 |
55 | ))}
56 |
57 |
58 |
59 |
60 | >
61 | );
62 | };
63 |
--------------------------------------------------------------------------------
/components/Navbar.tsx:
--------------------------------------------------------------------------------
1 | import Link from "next/link";
2 | import { useRouter } from "next/router";
3 | import React from "react";
4 | import { useData } from "../contexts/DataContext";
5 |
6 | function Navbar() {
7 | const router = useRouter();
8 | const { account, loadWeb3 } = useData();
9 |
10 | return (
11 | <>
12 |
52 | >
53 | );
54 | }
55 |
56 | export default Navbar;
57 |
58 | const TabButton = ({
59 | title,
60 | isActive,
61 | url,
62 | }: {
63 | title: string;
64 | isActive: boolean;
65 | url: string;
66 | }) => {
67 | return (
68 |
69 |
76 | {title}
77 |
78 |
79 | );
80 | };
81 |
--------------------------------------------------------------------------------
/contexts/DataContext.tsx:
--------------------------------------------------------------------------------
1 | declare let window: any;
2 | import { createContext, useContext, useState } from "react";
3 | import Web3 from "web3";
4 | import Polymarket from "../abis/Polymarket.json";
5 | import PolyToken from "../abis/PolyToken.json";
6 |
7 | interface DataContextProps {
8 | account: string;
9 | loading: boolean;
10 | loadWeb3: () => Promise;
11 | polymarket: any;
12 | polyToken: any;
13 | }
14 |
15 | const DataContext = createContext({
16 | account: "",
17 | loading: true,
18 | loadWeb3: async () => {},
19 | polymarket: null,
20 | polyToken: null,
21 | });
22 |
23 | export const DataProvider: React.FC = ({ children }) => {
24 | const data = useProviderData();
25 |
26 | return {children};
27 | };
28 |
29 | export const useData = () => useContext(DataContext);
30 |
31 | export const useProviderData = () => {
32 | const [loading, setLoading] = useState(true);
33 | const [account, setAccount] = useState("");
34 | const [polymarket, setPolymarket] = useState();
35 | const [polyToken, setPolyToken] = useState();
36 |
37 | const loadWeb3 = async () => {
38 | if (window.ethereum) {
39 | window.web3 = new Web3(window.ethereum);
40 | await window.ethereum.enable();
41 | } else if (window.web3) {
42 | window.web3 = new Web3(window.web3.currentProvider);
43 | } else {
44 | window.alert("Non-Eth browser detected. Please consider using MetaMask.");
45 | return;
46 | }
47 | var allAccounts = await window.web3.eth.getAccounts();
48 | setAccount(allAccounts[0]);
49 | await loadBlockchainData();
50 | };
51 |
52 | const loadBlockchainData = async () => {
53 | const web3 = window.web3;
54 |
55 | const polymarketData = Polymarket.networks["80001"];
56 | const polyTokenData = PolyToken.networks["80001"];
57 |
58 | if (polymarketData && polyTokenData) {
59 | var tempContract = await new web3.eth.Contract(
60 | Polymarket.abi,
61 | polymarketData.address
62 | );
63 | setPolymarket(tempContract);
64 | var tempTokenContract = await new web3.eth.Contract(
65 | PolyToken.abi,
66 | polyTokenData.address
67 | );
68 |
69 | setPolyToken(tempTokenContract);
70 | } else {
71 | window.alert("TestNet not found");
72 | }
73 | setTimeout(() => {
74 | setLoading(false);
75 | }, 500);
76 | };
77 |
78 | return {
79 | account,
80 | polymarket,
81 | polyToken,
82 | loading,
83 | loadWeb3,
84 | };
85 | };
86 |
--------------------------------------------------------------------------------
/components/MarketCard.tsx:
--------------------------------------------------------------------------------
1 | import Img from "next/image";
2 | import Link from "next/link";
3 | import React from "react";
4 | import Web3 from "web3";
5 | import { MarketProps } from "../pages";
6 |
7 | export const MarketCard: React.FC = ({
8 | id,
9 | title,
10 | totalAmount,
11 | totalYes,
12 | totalNo,
13 | imageHash,
14 | }) => {
15 | return (
16 |
17 |
18 |
19 |
20 |
21 |

27 |
28 |
{title}
29 |
30 |
31 |
32 | Volume
33 |
34 | {parseFloat(Web3.utils.fromWei(totalAmount, "ether")).toFixed(
35 | 2
36 | )}{" "}
37 | POLY
38 |
39 |
40 |
41 |
Yes
42 |
43 |
44 | {parseFloat(Web3.utils.fromWei(totalYes, "ether")).toFixed(2)}{" "}
45 | POLY
46 |
47 |
48 |
49 |
50 |
No
51 |
52 |
53 | {parseFloat(Web3.utils.fromWei(totalNo, "ether")).toFixed(2)}{" "}
54 | POLY
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | );
63 | };
64 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Polymarket Clone
21 |
22 |
23 | ## About The Project
24 |
25 | Polymarket is a decentralized information market, harnessing the power of free markets to demystify the real-world events that matter most.
26 |
27 | ## Tech stack and libraries
28 | - Solidity
29 | - Polygon Blockchain
30 | - Nextjs
31 | - web3.js
32 | - TailwindCSS
33 | - Metamask
34 | - IPFS
35 |
36 | ## Demo Video
37 |
38 | 
39 |
40 | ## 🗺 Roadmap
41 |
42 | See the [open issues](https://github.com/viral-sangani/polygon-peer-to-peer-payment/issues) for a list of proposed features (and known issues).
43 |
44 | ## 🤝 Contributing
45 |
46 | Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
47 |
48 | 1. Fork the Project
49 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
50 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
51 | 4. Push to the Branch (`git push origin feature/AmazingFeature`)
52 | 5. Open a Pull Request
53 |
54 | ## 📝 License
55 |
56 | Distributed under the MIT License. See `LICENSE` for more information.
57 |
58 | ---
59 |
60 |
61 |
62 | [](https://github.com/viral-sangani/polygon-peer-to-peer-payment/)
63 |
--------------------------------------------------------------------------------
/components/PortfolioMarketCard.tsx:
--------------------------------------------------------------------------------
1 | import moment from "moment";
2 | import Img from "next/image";
3 | import React from "react";
4 | import Web3 from "web3";
5 |
6 | export interface MarketProps {
7 | id: string;
8 | title: string;
9 | imageHash: string;
10 | totalAmount: string;
11 | totalYes: string;
12 | totalNo: string;
13 | userYes: string;
14 | userNo: string;
15 | hasResolved?: boolean;
16 | timestamp: string;
17 | endTimestamp: string;
18 | }
19 |
20 | export const PortfolioMarketCard: React.FC = ({
21 | title,
22 | userYes,
23 | userNo,
24 | id,
25 | imageHash,
26 | totalYes,
27 | totalNo,
28 | totalAmount,
29 | hasResolved,
30 | timestamp,
31 | endTimestamp,
32 | }) => {
33 | var endingOn = moment(parseInt(endTimestamp));
34 | var now = moment(new Date()); //todays date
35 | var daysLeft = moment.duration(endingOn.diff(now)).asDays().toFixed(0);
36 | return (
37 |
38 |
39 |
40 |
41 |

47 |
48 |
{title}
49 |
50 |
51 |
52 | Outcome
53 | {userYes ? "YES" : "NO"}
54 |
55 |
56 |
57 | Amount Added
58 |
59 |
60 | {Web3.utils.fromWei(userYes ?? userNo)} POLY
61 |
62 |
63 |
64 | Added On
65 |
66 | {timestamp
67 | ? moment(parseInt(timestamp) * 1000).format(
68 | "MMMM D, YYYY HH:mm a"
69 | )
70 | : "N/A"}
71 |
72 |
73 |
74 | Ending In
75 |
76 | {parseInt(daysLeft) > 0 ? `${daysLeft} days` : "Ended"}
77 |
78 |
79 |
80 |
81 | Trade
82 |
83 |
84 |
85 |
86 |
87 | );
88 | };
89 |
--------------------------------------------------------------------------------
/pages/admin/markets.tsx:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import Link from "next/link";
3 | import React, { useCallback, useEffect, useState } from "react";
4 | import { MarketProps } from "..";
5 | import { AdminMarketCard } from "../../components/AdminMarketCard";
6 | import Navbar from "../../components/Navbar";
7 | import { useData } from "../../contexts/DataContext";
8 |
9 | const Markets: React.FC = () => {
10 | const { polymarket, account, loadWeb3, loading } = useData();
11 | const [markets, setMarkets] = useState([]);
12 |
13 | const getMarkets = useCallback(async () => {
14 | var totalQuestions = await polymarket.methods
15 | .totalQuestions()
16 | .call({ from: account });
17 | var dataArray: MarketProps[] = [];
18 | for (var i = 0; i < totalQuestions; i++) {
19 | var data = await polymarket.methods.questions(i).call({ from: account });
20 | dataArray.push({
21 | id: data.id,
22 | title: data.question,
23 | imageHash: data.creatorImageHash,
24 | totalAmount: data.totalAmount,
25 | totalYes: data.totalYesAmount,
26 | totalNo: data.totalNoAmount,
27 | });
28 | }
29 | setMarkets(dataArray);
30 | }, [account, polymarket]);
31 |
32 | useEffect(() => {
33 | loadWeb3().then(() => {
34 | if (!loading) getMarkets();
35 | });
36 | }, [loading]);
37 |
38 | return (
39 | <>
40 |
41 |
42 |
Polymarket
43 |
44 |
45 |
46 |
47 |
58 |
59 |
60 | {markets &&
61 | markets.map((market) => (
62 |
63 |
{
69 | await polymarket.methods
70 | .distributeWinningAmount(market.id, true)
71 | .send({ from: account });
72 | }}
73 | onNo={async () => {
74 | await polymarket.methods
75 | .distributeWinningAmount(market.id, false)
76 | .send({ from: account });
77 | }}
78 | />
79 |
80 | ))}
81 |
82 |
83 | >
84 | );
85 | };
86 |
87 | export default Markets;
88 |
--------------------------------------------------------------------------------
/pages/index.tsx:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import { useCallback, useEffect, useState } from "react";
3 | import { Filter } from "../components/Filter";
4 | import { MarketCard } from "../components/MarketCard";
5 | import Navbar from "../components/Navbar";
6 | import { useData } from "../contexts/DataContext";
7 | import styles from "../styles/Home.module.css";
8 |
9 | export interface MarketProps {
10 | id: string;
11 | title: string;
12 | imageHash: string;
13 | totalAmount: string;
14 | totalYes: string;
15 | totalNo: string;
16 | }
17 |
18 | export default function Home() {
19 | const { polymarket, account, loadWeb3, loading } = useData();
20 | const [markets, setMarkets] = useState([]);
21 |
22 | const getMarkets = useCallback(async () => {
23 | var totalQuestions = await polymarket.methods
24 | .totalQuestions()
25 | .call({ from: account });
26 | var dataArray: MarketProps[] = [];
27 | for (var i = 0; i < totalQuestions; i++) {
28 | var data = await polymarket.methods.questions(i).call({ from: account });
29 | dataArray.push({
30 | id: data.id,
31 | title: data.question,
32 | imageHash: data.creatorImageHash,
33 | totalAmount: data.totalAmount,
34 | totalYes: data.totalYesAmount,
35 | totalNo: data.totalNoAmount,
36 | });
37 | }
38 | setMarkets(dataArray);
39 | }, [account, polymarket]);
40 |
41 | useEffect(() => {
42 | loadWeb3().then(() => {
43 | if (!loading) getMarkets();
44 | });
45 | }, [loading]);
46 |
47 | return (
48 |
49 |
50 |
Polymarket
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
70 |
71 |
78 |
79 |
80 | {}}
85 | />
86 | {}}
91 | />
92 |
93 |
Market
94 |
95 | {markets.map((market) => {
96 | return (
97 |
106 | );
107 | })}
108 |
109 |
110 |
111 |
112 | );
113 | }
114 |
--------------------------------------------------------------------------------
/pages/admin/index.tsx:
--------------------------------------------------------------------------------
1 | import { create } from "ipfs-http-client";
2 | import Head from "next/head";
3 | import Link from "next/link";
4 | import { useRouter } from "next/router";
5 | import React, { useEffect } from "react";
6 | import Navbar from "../../components/Navbar";
7 | import { useData } from "../../contexts/DataContext";
8 |
9 | const Admin = () => {
10 | const router = useRouter();
11 | const { polymarket, loadWeb3, account } = useData!();
12 | const [loading, setLoading] = React.useState(false);
13 | const client = create({ url: "https://ipfs.infura.io:5001/api/v0" });
14 |
15 | const [title, setTitle] = React.useState("");
16 | const [description, setDescription] = React.useState("");
17 | const [imageHash, setImageHash] = React.useState("");
18 | const [resolverUrl, setResolverUrl] = React.useState("");
19 | const [timestamp, setTimestamp] = React.useState<
20 | string | number | readonly string[] | undefined
21 | >(Date());
22 |
23 | const uploadImage = async (e: any) => {
24 | const file = e.target.files[0];
25 | const added = await client.add(file);
26 | setImageHash(added.path);
27 | };
28 |
29 | useEffect(() => {
30 | loadWeb3();
31 | }, [loading]);
32 |
33 | const handleSubmit = async () => {
34 | setLoading(true);
35 | await polymarket.methods
36 | .createQuestion(title, imageHash, description, resolverUrl, timestamp)
37 | .send({
38 | from: account,
39 | });
40 | setLoading(false);
41 | setTitle("");
42 | setDescription("");
43 | setImageHash("");
44 | setResolverUrl("");
45 | setTimestamp(undefined);
46 | router.push("/");
47 | };
48 |
49 | return (
50 | <>
51 |
125 | >
126 | );
127 | };
128 |
129 | export default Admin;
130 |
--------------------------------------------------------------------------------
/pages/portfolio.tsx:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import React, { useCallback, useEffect, useState } from "react";
3 | import Web3 from "web3";
4 | import Navbar from "../components/Navbar";
5 | import { PortfolioMarketCard } from "../components/PortfolioMarketCard";
6 | import { useData } from "../contexts/DataContext";
7 | import styles from "../styles/Home.module.css";
8 |
9 | export interface MarketProps {
10 | id: string;
11 | title?: string;
12 | imageHash?: string;
13 | totalAmount?: string;
14 | totalYes?: string;
15 | totalNo?: string;
16 | userYes?: string;
17 | hasResolved?: boolean;
18 | userNo?: string;
19 | timestamp?: string;
20 | endTimestamp?: string;
21 | }
22 |
23 | export interface QuestionsProps {
24 | id: string;
25 | title?: string;
26 | imageHash?: string;
27 | totalAmount?: string;
28 | totalYes?: string;
29 | totalNo?: string;
30 | hasResolved?: boolean;
31 | endTimestamp?: string;
32 | }
33 |
34 | const Portfolio = () => {
35 | const { polymarket, account, loadWeb3, loading } = useData();
36 | const [markets, setMarkets] = useState([]);
37 | const [portfolioValue, setPortfolioValue] = useState(0);
38 | const [allQuestions, setAllQuestions] = useState([]);
39 | const [openPositions, setOpenPositions] = useState(0);
40 |
41 | const getMarkets = useCallback(async () => {
42 | var totalQuestions = await polymarket.methods
43 | .totalQuestions()
44 | .call({ from: account });
45 | for (var i = 0; i < totalQuestions; i++) {
46 | var questions = await polymarket.methods
47 | .questions(i)
48 | .call({ from: account });
49 | allQuestions.push({
50 | id: questions.id,
51 | title: questions.question,
52 | imageHash: questions.creatorImageHash,
53 | totalAmount: questions.totalAmount,
54 | totalYes: questions.totalYesAmount,
55 | totalNo: questions.totalNoAmount,
56 | hasResolved: questions.eventCompleted,
57 | endTimestamp: questions.endTimestamp,
58 | });
59 | }
60 |
61 | var dataArray: MarketProps[] = [];
62 | var totalPortValue = 0;
63 | for (var i = 0; i < totalQuestions; i++) {
64 | var data = await polymarket.methods
65 | .getGraphData(i)
66 | .call({ from: account });
67 | data["0"].forEach((item: any) => {
68 | if (item[0] == account) {
69 | dataArray.push({
70 | id: i.toString(),
71 | userYes: item[1].toString(),
72 | timestamp: item[2].toString(),
73 | });
74 | totalPortValue += parseInt(item[1]);
75 | }
76 | });
77 | data["1"].forEach((item: any) => {
78 | if (item[0] == account) {
79 | dataArray.push({
80 | id: i.toString(),
81 | userNo: item[1].toString(),
82 | timestamp: item[2].toString(),
83 | });
84 | totalPortValue += parseInt(item[1]);
85 | }
86 | });
87 | }
88 | setPortfolioValue(totalPortValue);
89 | for (var i = 0; i < dataArray.length; i++) {
90 | var question = allQuestions.find((item) => item.id == dataArray[i].id);
91 | dataArray[i].title = question!.title;
92 | dataArray[i].imageHash = question!.imageHash;
93 | dataArray[i].totalAmount = question!.totalAmount;
94 | dataArray[i].totalYes = question!.totalYes;
95 | dataArray[i].totalNo = question!.totalNo!;
96 | dataArray[i].hasResolved = question!.hasResolved;
97 | dataArray[i].endTimestamp = question!.endTimestamp;
98 | }
99 | setMarkets(dataArray);
100 | }, [account, polymarket]);
101 |
102 | useEffect(() => {
103 | loadWeb3().then(() => {
104 | if (!loading) {
105 | getMarkets();
106 | }
107 | });
108 | }, [loading]);
109 |
110 | return (
111 |
112 |
113 |
Polymarket
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
Portfolio Value
123 |
124 | {Web3.utils.fromWei(portfolioValue.toString())} POLY
125 |
126 |
127 |
128 |
Your Market Positions
129 | {markets.map((market) => (
130 |
144 | ))}
145 |
146 |
147 |
148 | );
149 | };
150 |
151 | export default Portfolio;
152 |
--------------------------------------------------------------------------------
/contracts/Polymarket.sol:
--------------------------------------------------------------------------------
1 | // SPDX-License-Identifier: MIT
2 | pragma solidity ^0.8.6;
3 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4 |
5 | contract Polymarket {
6 | address public owner;
7 | address public polyToken;
8 |
9 | uint256 public totalQuestions = 0;
10 |
11 | constructor(address _polyToken) {
12 | owner = msg.sender;
13 | polyToken = _polyToken;
14 | }
15 |
16 | mapping(uint256 => Questions) public questions;
17 |
18 | struct Questions {
19 | uint256 id;
20 | string question;
21 | uint256 timestamp;
22 | uint256 endTimestamp;
23 | address createdBy;
24 | string creatorImageHash;
25 | AmountAdded[] yesCount;
26 | AmountAdded[] noCount;
27 | uint256 totalAmount;
28 | uint256 totalYesAmount;
29 | uint256 totalNoAmount;
30 | bool eventCompleted;
31 | string description;
32 | string resolverUrl;
33 | }
34 |
35 | struct AmountAdded {
36 | address user;
37 | uint256 amount;
38 | uint256 timestamp;
39 | }
40 |
41 | mapping(address => uint256) public winningAmount;
42 | address[] public winningAddresses;
43 |
44 | event QuestionCreated(
45 | uint256 id,
46 | string question,
47 | uint256 timestamp,
48 | address createdBy,
49 | string creatorImageHash,
50 | uint256 totalAmount,
51 | uint256 totalYesAmount,
52 | uint256 totalNoAmount
53 | );
54 |
55 | function createQuestion(
56 | string memory _question,
57 | string memory _creatorImageHash,
58 | string memory _description,
59 | string memory _resolverUrl,
60 | uint256 _endTimestamp
61 | ) public {
62 | require(msg.sender == owner, "Unauthorized");
63 |
64 | uint256 timestamp = block.timestamp;
65 |
66 | Questions storage question = questions[totalQuestions];
67 |
68 | question.id = totalQuestions++;
69 | question.question = _question;
70 | question.timestamp = timestamp;
71 | question.createdBy = msg.sender;
72 | question.creatorImageHash = _creatorImageHash;
73 | question.totalAmount = 0;
74 | question.totalYesAmount = 0;
75 | question.totalNoAmount = 0;
76 | question.description = _description;
77 | question.resolverUrl = _resolverUrl;
78 | question.endTimestamp = _endTimestamp;
79 |
80 | emit QuestionCreated(
81 | totalQuestions,
82 | _question,
83 | timestamp,
84 | msg.sender,
85 | _creatorImageHash,
86 | 0,
87 | 0,
88 | 0
89 | );
90 | }
91 |
92 | function addYesBet(uint256 _questionId, uint256 _value) public payable {
93 | require(_questionId == 0, "Question ID cannot be null");
94 | Questions storage question = questions[_questionId];
95 | ERC20(polyToken).transferFrom(msg.sender, address(this), _value);
96 | AmountAdded memory amountAdded = AmountAdded(
97 | msg.sender,
98 | _value,
99 | block.timestamp
100 | );
101 |
102 | question.totalYesAmount += _value;
103 | question.totalAmount += _value;
104 | question.yesCount.push(amountAdded);
105 | }
106 |
107 | function addNoBet(uint256 _questionId, uint256 _value) public payable {
108 | require(_questionId == 0, "Question ID cannot be null");
109 | Questions storage question = questions[_questionId];
110 | ERC20(polyToken).transferFrom(msg.sender, address(this), _value);
111 | AmountAdded memory amountAdded = AmountAdded(
112 | msg.sender,
113 | _value,
114 | block.timestamp
115 | );
116 |
117 | question.totalNoAmount += _value;
118 | question.totalAmount += _value;
119 | question.noCount.push(amountAdded);
120 | }
121 |
122 | function getGraphData(uint256 _questionId)
123 | public
124 | view
125 | returns (AmountAdded[] memory, AmountAdded[] memory)
126 | {
127 | Questions storage question = questions[_questionId];
128 | return (question.yesCount, question.noCount);
129 | }
130 |
131 | function distributeWinningAmount(uint256 _questionId, bool eventOutcome)
132 | public
133 | payable
134 | {
135 | require(msg.sender == owner, "Unauthorized");
136 |
137 | Questions storage question = questions[_questionId];
138 | if (eventOutcome) {
139 | for (uint256 i = 0; i < question.yesCount.length; i++) {
140 | uint256 amount = (question.totalNoAmount *
141 | question.yesCount[i].amount) / question.totalYesAmount;
142 | winningAmount[question.yesCount[i].user] += (amount +
143 | question.yesCount[i].amount);
144 | winningAddresses.push(question.yesCount[i].user);
145 | }
146 |
147 | for (uint256 i = 0; i < winningAddresses.length; i++) {
148 | address payable _address = payable(winningAddresses[i]);
149 | ERC20(polyToken).transfer(_address, winningAmount[_address]);
150 | delete winningAmount[_address];
151 | }
152 | delete winningAddresses;
153 | } else {
154 | for (uint256 i = 0; i < question.noCount.length; i++) {
155 | uint256 amount = (question.totalYesAmount *
156 | question.noCount[i].amount) / question.totalNoAmount;
157 | winningAmount[question.noCount[i].user] += (amount +
158 | question.noCount[i].amount);
159 | winningAddresses.push(question.noCount[i].user);
160 | }
161 |
162 | for (uint256 i = 0; i < winningAddresses.length; i++) {
163 | address payable _address = payable(winningAddresses[i]);
164 | ERC20(polyToken).transfer(_address, winningAmount[_address]);
165 | delete winningAmount[_address];
166 | }
167 | delete winningAddresses;
168 | }
169 | question.eventCompleted = true;
170 | }
171 |
172 | function isAdmin() public view returns (bool) {
173 | if (msg.sender == owner) return true;
174 | else return false;
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/pages/market/[id].tsx:
--------------------------------------------------------------------------------
1 | import moment from "moment";
2 | import Head from "next/head";
3 | import Img from "next/image";
4 | import { useRouter } from "next/router";
5 | import React, { useCallback, useEffect, useState } from "react";
6 | import Web3 from "web3";
7 | import ChartContainer from "../../components/Chart/ChartContainer";
8 | import Navbar from "../../components/Navbar";
9 | import { useData } from "../../contexts/DataContext";
10 |
11 | export interface MarketProps {
12 | id: string;
13 | title: string;
14 | imageHash: string;
15 | totalAmount: number;
16 | totalYes: number;
17 | totalNo: number;
18 | description: string;
19 | endTimestamp: number;
20 | resolverUrl: string;
21 | }
22 |
23 | const Details = () => {
24 | const router = useRouter();
25 | const { id } = router.query;
26 | const { polymarket, account, loadWeb3, loading, polyToken } = useData();
27 | const [market, setMarket] = useState();
28 | const [selected, setSelected] = useState("YES");
29 | const [dataLoading, setDataLoading] = useState(true);
30 | const [button, setButton] = useState("Trade");
31 |
32 | const [input, setInput] = useState("");
33 |
34 | const getMarketData = useCallback(async () => {
35 | var data = await polymarket.methods.questions(id).call({ from: account });
36 | setMarket({
37 | id: data.id,
38 | title: data.question,
39 | imageHash: data.creatorImageHash,
40 | totalAmount: parseInt(data.totalAmount),
41 | totalYes: parseInt(data.totalYesAmount),
42 | totalNo: parseInt(data.totalNoAmount),
43 | description: data.description,
44 | endTimestamp: parseInt(data.endTimestamp),
45 | resolverUrl: data.resolverUrl,
46 | });
47 | setDataLoading(false);
48 | }, [account, id, polymarket]);
49 |
50 | const handleTrade = async () => {
51 | var bal = await polyToken.methods.balanceOf(account).call();
52 | setButton("Please wait");
53 |
54 | if (input && selected === "YES") {
55 | if (parseInt(input) < parseInt(Web3.utils.fromWei(bal, "ether"))) {
56 | await polyToken.methods
57 | .approve(polymarket._address, Web3.utils.toWei(input, "ether"))
58 | .send({ from: account });
59 | await polymarket.methods
60 | .addYesBet(id, Web3.utils.toWei(input, "ether"))
61 | .send({ from: account });
62 | }
63 | } else if (input && selected === "NO") {
64 | if (parseInt(input) < parseInt(Web3.utils.fromWei(bal, "ether"))) {
65 | await polyToken.methods
66 | .approve(polymarket._address, Web3.utils.toWei(input, "ether"))
67 | .send({ from: account });
68 | await polymarket.methods
69 | .addNoBet(id, Web3.utils.toWei(input, "ether"))
70 | .send({ from: account });
71 | }
72 | }
73 | await getMarketData();
74 | setButton("Trade");
75 | };
76 |
77 | useEffect(() => {
78 | loadWeb3().then(() => {
79 | if (!loading) getMarketData();
80 | });
81 | }, [loading]);
82 |
83 | return (
84 |
85 |
86 |
Polymarket
87 |
88 |
89 |
90 |
91 |
92 | {dataLoading ? (
93 |
98 | ) : (
99 |
100 |
101 |
102 |
103 |

109 |
110 |
111 |
112 | US curreny affairs
113 |
114 |
115 | {market?.title}
116 |
117 |
118 |
119 |
120 |
121 |
122 | Market End on
123 |
124 |
125 | {market?.endTimestamp
126 | ? moment(
127 | parseInt((market?.endTimestamp).toFixed(0))
128 | ).format("MMMM D, YYYY")
129 | : "N/A"}
130 |
131 |
132 |
133 |
134 | Total Volume
135 |
136 |
137 | {Web3.utils.fromWei(
138 | market?.totalAmount.toString() ?? "0",
139 | "ether"
140 | ) ?? 0}{" "}
141 | POLY
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
Buy
154 |
155 |
Pick Outcome
156 |
setSelected("YES")}
163 | >
164 | YES{" "}
165 | {!market?.totalAmount
166 | ? `0`
167 | : (
168 | (market?.totalYes * 100) /
169 | market?.totalAmount
170 | ).toFixed(2)}
171 | %
172 |
173 |
setSelected("NO")}
180 | >
181 | No{" "}
182 | {!market?.totalAmount
183 | ? `0`
184 | : (
185 | (market?.totalNo * 100) /
186 | market?.totalAmount
187 | ).toFixed(2)}
188 | %
189 |
190 |
How much?
191 |
192 | setInput(e.target.value)}
197 | className="w-full py-2 px-2 text-base text-gray-700 border-gray-300 rounded-md focus:outline-none"
198 | placeholder="0"
199 | autoComplete="off"
200 | />
201 |
202 | POLY |{" "}
203 |
204 |
205 | Max
206 |
207 |
208 |
215 |
216 |
217 |
218 |
230 |
231 |
232 | )}
233 |
234 |
235 | );
236 | };
237 |
238 | export default Details;
239 |
--------------------------------------------------------------------------------
/abis/Context.json:
--------------------------------------------------------------------------------
1 | {
2 | "contractName": "Context",
3 | "abi": [],
4 | "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/Context.sol\":\"Context\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/Context.sol\":{\"keccak256\":\"0x90565a39ae45c80f0468dc96c7b20d0afc3055f344c8203a0c9258239f350b9f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://26e8b38a7ac8e7b4463af00cf7fff1bf48ae9875765bf4f7751e100124d0bc8c\",\"dweb:/ipfs/QmWcsmkVr24xmmjfnBQZoemFniXjj3vwT78Cz6uqZW1Hux\"]}},\"version\":1}",
5 | "bytecode": "0x",
6 | "deployedBytecode": "0x",
7 | "immutableReferences": {},
8 | "generatedSources": [],
9 | "deployedGeneratedSources": [],
10 | "sourceMap": "",
11 | "deployedSourceMap": "",
12 | "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n",
13 | "sourcePath": "@openzeppelin/contracts/utils/Context.sol",
14 | "ast": {
15 | "absolutePath": "@openzeppelin/contracts/utils/Context.sol",
16 | "exportedSymbols": {
17 | "Context": [
18 | 670
19 | ]
20 | },
21 | "id": 671,
22 | "license": "MIT",
23 | "nodeType": "SourceUnit",
24 | "nodes": [
25 | {
26 | "id": 650,
27 | "literals": [
28 | "solidity",
29 | "^",
30 | "0.8",
31 | ".0"
32 | ],
33 | "nodeType": "PragmaDirective",
34 | "src": "33:23:3"
35 | },
36 | {
37 | "abstract": true,
38 | "baseContracts": [],
39 | "canonicalName": "Context",
40 | "contractDependencies": [],
41 | "contractKind": "contract",
42 | "documentation": {
43 | "id": 651,
44 | "nodeType": "StructuredDocumentation",
45 | "src": "58:496:3",
46 | "text": " @dev Provides information about the current execution context, including the\n sender of the transaction and its data. While these are generally available\n via msg.sender and msg.data, they should not be accessed in such a direct\n manner, since when dealing with meta-transactions the account sending and\n paying for execution may not be the actual sender (as far as an application\n is concerned).\n This contract is only required for intermediate, library-like contracts."
47 | },
48 | "fullyImplemented": true,
49 | "id": 670,
50 | "linearizedBaseContracts": [
51 | 670
52 | ],
53 | "name": "Context",
54 | "nameLocation": "573:7:3",
55 | "nodeType": "ContractDefinition",
56 | "nodes": [
57 | {
58 | "body": {
59 | "id": 659,
60 | "nodeType": "Block",
61 | "src": "649:34:3",
62 | "statements": [
63 | {
64 | "expression": {
65 | "expression": {
66 | "id": 656,
67 | "name": "msg",
68 | "nodeType": "Identifier",
69 | "overloadedDeclarations": [],
70 | "referencedDeclaration": 4294967281,
71 | "src": "666:3:3",
72 | "typeDescriptions": {
73 | "typeIdentifier": "t_magic_message",
74 | "typeString": "msg"
75 | }
76 | },
77 | "id": 657,
78 | "isConstant": false,
79 | "isLValue": false,
80 | "isPure": false,
81 | "lValueRequested": false,
82 | "memberName": "sender",
83 | "nodeType": "MemberAccess",
84 | "src": "666:10:3",
85 | "typeDescriptions": {
86 | "typeIdentifier": "t_address",
87 | "typeString": "address"
88 | }
89 | },
90 | "functionReturnParameters": 655,
91 | "id": 658,
92 | "nodeType": "Return",
93 | "src": "659:17:3"
94 | }
95 | ]
96 | },
97 | "id": 660,
98 | "implemented": true,
99 | "kind": "function",
100 | "modifiers": [],
101 | "name": "_msgSender",
102 | "nameLocation": "596:10:3",
103 | "nodeType": "FunctionDefinition",
104 | "parameters": {
105 | "id": 652,
106 | "nodeType": "ParameterList",
107 | "parameters": [],
108 | "src": "606:2:3"
109 | },
110 | "returnParameters": {
111 | "id": 655,
112 | "nodeType": "ParameterList",
113 | "parameters": [
114 | {
115 | "constant": false,
116 | "id": 654,
117 | "mutability": "mutable",
118 | "name": "",
119 | "nameLocation": "-1:-1:-1",
120 | "nodeType": "VariableDeclaration",
121 | "scope": 660,
122 | "src": "640:7:3",
123 | "stateVariable": false,
124 | "storageLocation": "default",
125 | "typeDescriptions": {
126 | "typeIdentifier": "t_address",
127 | "typeString": "address"
128 | },
129 | "typeName": {
130 | "id": 653,
131 | "name": "address",
132 | "nodeType": "ElementaryTypeName",
133 | "src": "640:7:3",
134 | "stateMutability": "nonpayable",
135 | "typeDescriptions": {
136 | "typeIdentifier": "t_address",
137 | "typeString": "address"
138 | }
139 | },
140 | "visibility": "internal"
141 | }
142 | ],
143 | "src": "639:9:3"
144 | },
145 | "scope": 670,
146 | "src": "587:96:3",
147 | "stateMutability": "view",
148 | "virtual": true,
149 | "visibility": "internal"
150 | },
151 | {
152 | "body": {
153 | "id": 668,
154 | "nodeType": "Block",
155 | "src": "756:32:3",
156 | "statements": [
157 | {
158 | "expression": {
159 | "expression": {
160 | "id": 665,
161 | "name": "msg",
162 | "nodeType": "Identifier",
163 | "overloadedDeclarations": [],
164 | "referencedDeclaration": 4294967281,
165 | "src": "773:3:3",
166 | "typeDescriptions": {
167 | "typeIdentifier": "t_magic_message",
168 | "typeString": "msg"
169 | }
170 | },
171 | "id": 666,
172 | "isConstant": false,
173 | "isLValue": false,
174 | "isPure": false,
175 | "lValueRequested": false,
176 | "memberName": "data",
177 | "nodeType": "MemberAccess",
178 | "src": "773:8:3",
179 | "typeDescriptions": {
180 | "typeIdentifier": "t_bytes_calldata_ptr",
181 | "typeString": "bytes calldata"
182 | }
183 | },
184 | "functionReturnParameters": 664,
185 | "id": 667,
186 | "nodeType": "Return",
187 | "src": "766:15:3"
188 | }
189 | ]
190 | },
191 | "id": 669,
192 | "implemented": true,
193 | "kind": "function",
194 | "modifiers": [],
195 | "name": "_msgData",
196 | "nameLocation": "698:8:3",
197 | "nodeType": "FunctionDefinition",
198 | "parameters": {
199 | "id": 661,
200 | "nodeType": "ParameterList",
201 | "parameters": [],
202 | "src": "706:2:3"
203 | },
204 | "returnParameters": {
205 | "id": 664,
206 | "nodeType": "ParameterList",
207 | "parameters": [
208 | {
209 | "constant": false,
210 | "id": 663,
211 | "mutability": "mutable",
212 | "name": "",
213 | "nameLocation": "-1:-1:-1",
214 | "nodeType": "VariableDeclaration",
215 | "scope": 669,
216 | "src": "740:14:3",
217 | "stateVariable": false,
218 | "storageLocation": "calldata",
219 | "typeDescriptions": {
220 | "typeIdentifier": "t_bytes_calldata_ptr",
221 | "typeString": "bytes"
222 | },
223 | "typeName": {
224 | "id": 662,
225 | "name": "bytes",
226 | "nodeType": "ElementaryTypeName",
227 | "src": "740:5:3",
228 | "typeDescriptions": {
229 | "typeIdentifier": "t_bytes_storage_ptr",
230 | "typeString": "bytes"
231 | }
232 | },
233 | "visibility": "internal"
234 | }
235 | ],
236 | "src": "739:16:3"
237 | },
238 | "scope": 670,
239 | "src": "689:99:3",
240 | "stateMutability": "view",
241 | "virtual": true,
242 | "visibility": "internal"
243 | }
244 | ],
245 | "scope": 671,
246 | "src": "555:235:3",
247 | "usedErrors": []
248 | }
249 | ],
250 | "src": "33:758:3"
251 | },
252 | "legacyAST": {
253 | "absolutePath": "@openzeppelin/contracts/utils/Context.sol",
254 | "exportedSymbols": {
255 | "Context": [
256 | 670
257 | ]
258 | },
259 | "id": 671,
260 | "license": "MIT",
261 | "nodeType": "SourceUnit",
262 | "nodes": [
263 | {
264 | "id": 650,
265 | "literals": [
266 | "solidity",
267 | "^",
268 | "0.8",
269 | ".0"
270 | ],
271 | "nodeType": "PragmaDirective",
272 | "src": "33:23:3"
273 | },
274 | {
275 | "abstract": true,
276 | "baseContracts": [],
277 | "canonicalName": "Context",
278 | "contractDependencies": [],
279 | "contractKind": "contract",
280 | "documentation": {
281 | "id": 651,
282 | "nodeType": "StructuredDocumentation",
283 | "src": "58:496:3",
284 | "text": " @dev Provides information about the current execution context, including the\n sender of the transaction and its data. While these are generally available\n via msg.sender and msg.data, they should not be accessed in such a direct\n manner, since when dealing with meta-transactions the account sending and\n paying for execution may not be the actual sender (as far as an application\n is concerned).\n This contract is only required for intermediate, library-like contracts."
285 | },
286 | "fullyImplemented": true,
287 | "id": 670,
288 | "linearizedBaseContracts": [
289 | 670
290 | ],
291 | "name": "Context",
292 | "nameLocation": "573:7:3",
293 | "nodeType": "ContractDefinition",
294 | "nodes": [
295 | {
296 | "body": {
297 | "id": 659,
298 | "nodeType": "Block",
299 | "src": "649:34:3",
300 | "statements": [
301 | {
302 | "expression": {
303 | "expression": {
304 | "id": 656,
305 | "name": "msg",
306 | "nodeType": "Identifier",
307 | "overloadedDeclarations": [],
308 | "referencedDeclaration": 4294967281,
309 | "src": "666:3:3",
310 | "typeDescriptions": {
311 | "typeIdentifier": "t_magic_message",
312 | "typeString": "msg"
313 | }
314 | },
315 | "id": 657,
316 | "isConstant": false,
317 | "isLValue": false,
318 | "isPure": false,
319 | "lValueRequested": false,
320 | "memberName": "sender",
321 | "nodeType": "MemberAccess",
322 | "src": "666:10:3",
323 | "typeDescriptions": {
324 | "typeIdentifier": "t_address",
325 | "typeString": "address"
326 | }
327 | },
328 | "functionReturnParameters": 655,
329 | "id": 658,
330 | "nodeType": "Return",
331 | "src": "659:17:3"
332 | }
333 | ]
334 | },
335 | "id": 660,
336 | "implemented": true,
337 | "kind": "function",
338 | "modifiers": [],
339 | "name": "_msgSender",
340 | "nameLocation": "596:10:3",
341 | "nodeType": "FunctionDefinition",
342 | "parameters": {
343 | "id": 652,
344 | "nodeType": "ParameterList",
345 | "parameters": [],
346 | "src": "606:2:3"
347 | },
348 | "returnParameters": {
349 | "id": 655,
350 | "nodeType": "ParameterList",
351 | "parameters": [
352 | {
353 | "constant": false,
354 | "id": 654,
355 | "mutability": "mutable",
356 | "name": "",
357 | "nameLocation": "-1:-1:-1",
358 | "nodeType": "VariableDeclaration",
359 | "scope": 660,
360 | "src": "640:7:3",
361 | "stateVariable": false,
362 | "storageLocation": "default",
363 | "typeDescriptions": {
364 | "typeIdentifier": "t_address",
365 | "typeString": "address"
366 | },
367 | "typeName": {
368 | "id": 653,
369 | "name": "address",
370 | "nodeType": "ElementaryTypeName",
371 | "src": "640:7:3",
372 | "stateMutability": "nonpayable",
373 | "typeDescriptions": {
374 | "typeIdentifier": "t_address",
375 | "typeString": "address"
376 | }
377 | },
378 | "visibility": "internal"
379 | }
380 | ],
381 | "src": "639:9:3"
382 | },
383 | "scope": 670,
384 | "src": "587:96:3",
385 | "stateMutability": "view",
386 | "virtual": true,
387 | "visibility": "internal"
388 | },
389 | {
390 | "body": {
391 | "id": 668,
392 | "nodeType": "Block",
393 | "src": "756:32:3",
394 | "statements": [
395 | {
396 | "expression": {
397 | "expression": {
398 | "id": 665,
399 | "name": "msg",
400 | "nodeType": "Identifier",
401 | "overloadedDeclarations": [],
402 | "referencedDeclaration": 4294967281,
403 | "src": "773:3:3",
404 | "typeDescriptions": {
405 | "typeIdentifier": "t_magic_message",
406 | "typeString": "msg"
407 | }
408 | },
409 | "id": 666,
410 | "isConstant": false,
411 | "isLValue": false,
412 | "isPure": false,
413 | "lValueRequested": false,
414 | "memberName": "data",
415 | "nodeType": "MemberAccess",
416 | "src": "773:8:3",
417 | "typeDescriptions": {
418 | "typeIdentifier": "t_bytes_calldata_ptr",
419 | "typeString": "bytes calldata"
420 | }
421 | },
422 | "functionReturnParameters": 664,
423 | "id": 667,
424 | "nodeType": "Return",
425 | "src": "766:15:3"
426 | }
427 | ]
428 | },
429 | "id": 669,
430 | "implemented": true,
431 | "kind": "function",
432 | "modifiers": [],
433 | "name": "_msgData",
434 | "nameLocation": "698:8:3",
435 | "nodeType": "FunctionDefinition",
436 | "parameters": {
437 | "id": 661,
438 | "nodeType": "ParameterList",
439 | "parameters": [],
440 | "src": "706:2:3"
441 | },
442 | "returnParameters": {
443 | "id": 664,
444 | "nodeType": "ParameterList",
445 | "parameters": [
446 | {
447 | "constant": false,
448 | "id": 663,
449 | "mutability": "mutable",
450 | "name": "",
451 | "nameLocation": "-1:-1:-1",
452 | "nodeType": "VariableDeclaration",
453 | "scope": 669,
454 | "src": "740:14:3",
455 | "stateVariable": false,
456 | "storageLocation": "calldata",
457 | "typeDescriptions": {
458 | "typeIdentifier": "t_bytes_calldata_ptr",
459 | "typeString": "bytes"
460 | },
461 | "typeName": {
462 | "id": 662,
463 | "name": "bytes",
464 | "nodeType": "ElementaryTypeName",
465 | "src": "740:5:3",
466 | "typeDescriptions": {
467 | "typeIdentifier": "t_bytes_storage_ptr",
468 | "typeString": "bytes"
469 | }
470 | },
471 | "visibility": "internal"
472 | }
473 | ],
474 | "src": "739:16:3"
475 | },
476 | "scope": 670,
477 | "src": "689:99:3",
478 | "stateMutability": "view",
479 | "virtual": true,
480 | "visibility": "internal"
481 | }
482 | ],
483 | "scope": 671,
484 | "src": "555:235:3",
485 | "usedErrors": []
486 | }
487 | ],
488 | "src": "33:758:3"
489 | },
490 | "compiler": {
491 | "name": "solc",
492 | "version": "0.8.10+commit.fc410830.Emscripten.clang"
493 | },
494 | "networks": {},
495 | "schemaVersion": "3.4.3",
496 | "updatedAt": "2021-11-17T16:45:05.085Z",
497 | "devdoc": {
498 | "details": "Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.",
499 | "kind": "dev",
500 | "methods": {},
501 | "version": 1
502 | },
503 | "userdoc": {
504 | "kind": "user",
505 | "methods": {},
506 | "version": 1
507 | }
508 | }
--------------------------------------------------------------------------------
/abis/IERC20Metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "contractName": "IERC20Metadata",
3 | "abi": [
4 | {
5 | "anonymous": false,
6 | "inputs": [
7 | {
8 | "indexed": true,
9 | "internalType": "address",
10 | "name": "owner",
11 | "type": "address"
12 | },
13 | {
14 | "indexed": true,
15 | "internalType": "address",
16 | "name": "spender",
17 | "type": "address"
18 | },
19 | {
20 | "indexed": false,
21 | "internalType": "uint256",
22 | "name": "value",
23 | "type": "uint256"
24 | }
25 | ],
26 | "name": "Approval",
27 | "type": "event"
28 | },
29 | {
30 | "anonymous": false,
31 | "inputs": [
32 | {
33 | "indexed": true,
34 | "internalType": "address",
35 | "name": "from",
36 | "type": "address"
37 | },
38 | {
39 | "indexed": true,
40 | "internalType": "address",
41 | "name": "to",
42 | "type": "address"
43 | },
44 | {
45 | "indexed": false,
46 | "internalType": "uint256",
47 | "name": "value",
48 | "type": "uint256"
49 | }
50 | ],
51 | "name": "Transfer",
52 | "type": "event"
53 | },
54 | {
55 | "inputs": [
56 | {
57 | "internalType": "address",
58 | "name": "owner",
59 | "type": "address"
60 | },
61 | {
62 | "internalType": "address",
63 | "name": "spender",
64 | "type": "address"
65 | }
66 | ],
67 | "name": "allowance",
68 | "outputs": [
69 | {
70 | "internalType": "uint256",
71 | "name": "",
72 | "type": "uint256"
73 | }
74 | ],
75 | "stateMutability": "view",
76 | "type": "function"
77 | },
78 | {
79 | "inputs": [
80 | {
81 | "internalType": "address",
82 | "name": "spender",
83 | "type": "address"
84 | },
85 | {
86 | "internalType": "uint256",
87 | "name": "amount",
88 | "type": "uint256"
89 | }
90 | ],
91 | "name": "approve",
92 | "outputs": [
93 | {
94 | "internalType": "bool",
95 | "name": "",
96 | "type": "bool"
97 | }
98 | ],
99 | "stateMutability": "nonpayable",
100 | "type": "function"
101 | },
102 | {
103 | "inputs": [
104 | {
105 | "internalType": "address",
106 | "name": "account",
107 | "type": "address"
108 | }
109 | ],
110 | "name": "balanceOf",
111 | "outputs": [
112 | {
113 | "internalType": "uint256",
114 | "name": "",
115 | "type": "uint256"
116 | }
117 | ],
118 | "stateMutability": "view",
119 | "type": "function"
120 | },
121 | {
122 | "inputs": [],
123 | "name": "totalSupply",
124 | "outputs": [
125 | {
126 | "internalType": "uint256",
127 | "name": "",
128 | "type": "uint256"
129 | }
130 | ],
131 | "stateMutability": "view",
132 | "type": "function"
133 | },
134 | {
135 | "inputs": [
136 | {
137 | "internalType": "address",
138 | "name": "recipient",
139 | "type": "address"
140 | },
141 | {
142 | "internalType": "uint256",
143 | "name": "amount",
144 | "type": "uint256"
145 | }
146 | ],
147 | "name": "transfer",
148 | "outputs": [
149 | {
150 | "internalType": "bool",
151 | "name": "",
152 | "type": "bool"
153 | }
154 | ],
155 | "stateMutability": "nonpayable",
156 | "type": "function"
157 | },
158 | {
159 | "inputs": [
160 | {
161 | "internalType": "address",
162 | "name": "sender",
163 | "type": "address"
164 | },
165 | {
166 | "internalType": "address",
167 | "name": "recipient",
168 | "type": "address"
169 | },
170 | {
171 | "internalType": "uint256",
172 | "name": "amount",
173 | "type": "uint256"
174 | }
175 | ],
176 | "name": "transferFrom",
177 | "outputs": [
178 | {
179 | "internalType": "bool",
180 | "name": "",
181 | "type": "bool"
182 | }
183 | ],
184 | "stateMutability": "nonpayable",
185 | "type": "function"
186 | },
187 | {
188 | "inputs": [],
189 | "name": "name",
190 | "outputs": [
191 | {
192 | "internalType": "string",
193 | "name": "",
194 | "type": "string"
195 | }
196 | ],
197 | "stateMutability": "view",
198 | "type": "function"
199 | },
200 | {
201 | "inputs": [],
202 | "name": "symbol",
203 | "outputs": [
204 | {
205 | "internalType": "string",
206 | "name": "",
207 | "type": "string"
208 | }
209 | ],
210 | "stateMutability": "view",
211 | "type": "function"
212 | },
213 | {
214 | "inputs": [],
215 | "name": "decimals",
216 | "outputs": [
217 | {
218 | "internalType": "uint8",
219 | "name": "",
220 | "type": "uint8"
221 | }
222 | ],
223 | "stateMutability": "view",
224 | "type": "function"
225 | }
226 | ],
227 | "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._\",\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"decimals()\":{\"details\":\"Returns the decimals places of the token.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":\"IERC20Metadata\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://087318b21c528119f649899f5b5580566dd8d7b0303d4904bd0e8580c3545f14\",\"dweb:/ipfs/Qmbn5Mj7aUn8hJuQ8VrQjjEXRsXyJKykgnjR9p4C3nfLtL\"]},\"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"keccak256\":\"0x83fe24f5c04a56091e50f4a345ff504c8bff658a76d4c43b16878c8f940c53b2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://d4c3df1a7ca104b633a7d81c6c6f5192367d150cd5a32cba81f7f27012729013\",\"dweb:/ipfs/QmSim72e3ZVsfgZt8UceCvbiSuMRHR6WDsiamqNzZahGSY\"]}},\"version\":1}",
228 | "bytecode": "0x",
229 | "deployedBytecode": "0x",
230 | "immutableReferences": {},
231 | "generatedSources": [],
232 | "deployedGeneratedSources": [],
233 | "sourceMap": "",
234 | "deployedSourceMap": "",
235 | "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n",
236 | "sourcePath": "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol",
237 | "ast": {
238 | "absolutePath": "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol",
239 | "exportedSymbols": {
240 | "IERC20": [
241 | 623
242 | ],
243 | "IERC20Metadata": [
244 | 648
245 | ]
246 | },
247 | "id": 649,
248 | "license": "MIT",
249 | "nodeType": "SourceUnit",
250 | "nodes": [
251 | {
252 | "id": 625,
253 | "literals": [
254 | "solidity",
255 | "^",
256 | "0.8",
257 | ".0"
258 | ],
259 | "nodeType": "PragmaDirective",
260 | "src": "33:23:2"
261 | },
262 | {
263 | "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
264 | "file": "../IERC20.sol",
265 | "id": 626,
266 | "nameLocation": "-1:-1:-1",
267 | "nodeType": "ImportDirective",
268 | "scope": 649,
269 | "sourceUnit": 624,
270 | "src": "58:23:2",
271 | "symbolAliases": [],
272 | "unitAlias": ""
273 | },
274 | {
275 | "abstract": false,
276 | "baseContracts": [
277 | {
278 | "baseName": {
279 | "id": 628,
280 | "name": "IERC20",
281 | "nodeType": "IdentifierPath",
282 | "referencedDeclaration": 623,
283 | "src": "228:6:2"
284 | },
285 | "id": 629,
286 | "nodeType": "InheritanceSpecifier",
287 | "src": "228:6:2"
288 | }
289 | ],
290 | "canonicalName": "IERC20Metadata",
291 | "contractDependencies": [],
292 | "contractKind": "interface",
293 | "documentation": {
294 | "id": 627,
295 | "nodeType": "StructuredDocumentation",
296 | "src": "83:116:2",
297 | "text": " @dev Interface for the optional metadata functions from the ERC20 standard.\n _Available since v4.1._"
298 | },
299 | "fullyImplemented": false,
300 | "id": 648,
301 | "linearizedBaseContracts": [
302 | 648,
303 | 623
304 | ],
305 | "name": "IERC20Metadata",
306 | "nameLocation": "210:14:2",
307 | "nodeType": "ContractDefinition",
308 | "nodes": [
309 | {
310 | "documentation": {
311 | "id": 630,
312 | "nodeType": "StructuredDocumentation",
313 | "src": "241:54:2",
314 | "text": " @dev Returns the name of the token."
315 | },
316 | "functionSelector": "06fdde03",
317 | "id": 635,
318 | "implemented": false,
319 | "kind": "function",
320 | "modifiers": [],
321 | "name": "name",
322 | "nameLocation": "309:4:2",
323 | "nodeType": "FunctionDefinition",
324 | "parameters": {
325 | "id": 631,
326 | "nodeType": "ParameterList",
327 | "parameters": [],
328 | "src": "313:2:2"
329 | },
330 | "returnParameters": {
331 | "id": 634,
332 | "nodeType": "ParameterList",
333 | "parameters": [
334 | {
335 | "constant": false,
336 | "id": 633,
337 | "mutability": "mutable",
338 | "name": "",
339 | "nameLocation": "-1:-1:-1",
340 | "nodeType": "VariableDeclaration",
341 | "scope": 635,
342 | "src": "339:13:2",
343 | "stateVariable": false,
344 | "storageLocation": "memory",
345 | "typeDescriptions": {
346 | "typeIdentifier": "t_string_memory_ptr",
347 | "typeString": "string"
348 | },
349 | "typeName": {
350 | "id": 632,
351 | "name": "string",
352 | "nodeType": "ElementaryTypeName",
353 | "src": "339:6:2",
354 | "typeDescriptions": {
355 | "typeIdentifier": "t_string_storage_ptr",
356 | "typeString": "string"
357 | }
358 | },
359 | "visibility": "internal"
360 | }
361 | ],
362 | "src": "338:15:2"
363 | },
364 | "scope": 648,
365 | "src": "300:54:2",
366 | "stateMutability": "view",
367 | "virtual": false,
368 | "visibility": "external"
369 | },
370 | {
371 | "documentation": {
372 | "id": 636,
373 | "nodeType": "StructuredDocumentation",
374 | "src": "360:56:2",
375 | "text": " @dev Returns the symbol of the token."
376 | },
377 | "functionSelector": "95d89b41",
378 | "id": 641,
379 | "implemented": false,
380 | "kind": "function",
381 | "modifiers": [],
382 | "name": "symbol",
383 | "nameLocation": "430:6:2",
384 | "nodeType": "FunctionDefinition",
385 | "parameters": {
386 | "id": 637,
387 | "nodeType": "ParameterList",
388 | "parameters": [],
389 | "src": "436:2:2"
390 | },
391 | "returnParameters": {
392 | "id": 640,
393 | "nodeType": "ParameterList",
394 | "parameters": [
395 | {
396 | "constant": false,
397 | "id": 639,
398 | "mutability": "mutable",
399 | "name": "",
400 | "nameLocation": "-1:-1:-1",
401 | "nodeType": "VariableDeclaration",
402 | "scope": 641,
403 | "src": "462:13:2",
404 | "stateVariable": false,
405 | "storageLocation": "memory",
406 | "typeDescriptions": {
407 | "typeIdentifier": "t_string_memory_ptr",
408 | "typeString": "string"
409 | },
410 | "typeName": {
411 | "id": 638,
412 | "name": "string",
413 | "nodeType": "ElementaryTypeName",
414 | "src": "462:6:2",
415 | "typeDescriptions": {
416 | "typeIdentifier": "t_string_storage_ptr",
417 | "typeString": "string"
418 | }
419 | },
420 | "visibility": "internal"
421 | }
422 | ],
423 | "src": "461:15:2"
424 | },
425 | "scope": 648,
426 | "src": "421:56:2",
427 | "stateMutability": "view",
428 | "virtual": false,
429 | "visibility": "external"
430 | },
431 | {
432 | "documentation": {
433 | "id": 642,
434 | "nodeType": "StructuredDocumentation",
435 | "src": "483:65:2",
436 | "text": " @dev Returns the decimals places of the token."
437 | },
438 | "functionSelector": "313ce567",
439 | "id": 647,
440 | "implemented": false,
441 | "kind": "function",
442 | "modifiers": [],
443 | "name": "decimals",
444 | "nameLocation": "562:8:2",
445 | "nodeType": "FunctionDefinition",
446 | "parameters": {
447 | "id": 643,
448 | "nodeType": "ParameterList",
449 | "parameters": [],
450 | "src": "570:2:2"
451 | },
452 | "returnParameters": {
453 | "id": 646,
454 | "nodeType": "ParameterList",
455 | "parameters": [
456 | {
457 | "constant": false,
458 | "id": 645,
459 | "mutability": "mutable",
460 | "name": "",
461 | "nameLocation": "-1:-1:-1",
462 | "nodeType": "VariableDeclaration",
463 | "scope": 647,
464 | "src": "596:5:2",
465 | "stateVariable": false,
466 | "storageLocation": "default",
467 | "typeDescriptions": {
468 | "typeIdentifier": "t_uint8",
469 | "typeString": "uint8"
470 | },
471 | "typeName": {
472 | "id": 644,
473 | "name": "uint8",
474 | "nodeType": "ElementaryTypeName",
475 | "src": "596:5:2",
476 | "typeDescriptions": {
477 | "typeIdentifier": "t_uint8",
478 | "typeString": "uint8"
479 | }
480 | },
481 | "visibility": "internal"
482 | }
483 | ],
484 | "src": "595:7:2"
485 | },
486 | "scope": 648,
487 | "src": "553:50:2",
488 | "stateMutability": "view",
489 | "virtual": false,
490 | "visibility": "external"
491 | }
492 | ],
493 | "scope": 649,
494 | "src": "200:405:2",
495 | "usedErrors": []
496 | }
497 | ],
498 | "src": "33:573:2"
499 | },
500 | "legacyAST": {
501 | "absolutePath": "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol",
502 | "exportedSymbols": {
503 | "IERC20": [
504 | 623
505 | ],
506 | "IERC20Metadata": [
507 | 648
508 | ]
509 | },
510 | "id": 649,
511 | "license": "MIT",
512 | "nodeType": "SourceUnit",
513 | "nodes": [
514 | {
515 | "id": 625,
516 | "literals": [
517 | "solidity",
518 | "^",
519 | "0.8",
520 | ".0"
521 | ],
522 | "nodeType": "PragmaDirective",
523 | "src": "33:23:2"
524 | },
525 | {
526 | "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
527 | "file": "../IERC20.sol",
528 | "id": 626,
529 | "nameLocation": "-1:-1:-1",
530 | "nodeType": "ImportDirective",
531 | "scope": 649,
532 | "sourceUnit": 624,
533 | "src": "58:23:2",
534 | "symbolAliases": [],
535 | "unitAlias": ""
536 | },
537 | {
538 | "abstract": false,
539 | "baseContracts": [
540 | {
541 | "baseName": {
542 | "id": 628,
543 | "name": "IERC20",
544 | "nodeType": "IdentifierPath",
545 | "referencedDeclaration": 623,
546 | "src": "228:6:2"
547 | },
548 | "id": 629,
549 | "nodeType": "InheritanceSpecifier",
550 | "src": "228:6:2"
551 | }
552 | ],
553 | "canonicalName": "IERC20Metadata",
554 | "contractDependencies": [],
555 | "contractKind": "interface",
556 | "documentation": {
557 | "id": 627,
558 | "nodeType": "StructuredDocumentation",
559 | "src": "83:116:2",
560 | "text": " @dev Interface for the optional metadata functions from the ERC20 standard.\n _Available since v4.1._"
561 | },
562 | "fullyImplemented": false,
563 | "id": 648,
564 | "linearizedBaseContracts": [
565 | 648,
566 | 623
567 | ],
568 | "name": "IERC20Metadata",
569 | "nameLocation": "210:14:2",
570 | "nodeType": "ContractDefinition",
571 | "nodes": [
572 | {
573 | "documentation": {
574 | "id": 630,
575 | "nodeType": "StructuredDocumentation",
576 | "src": "241:54:2",
577 | "text": " @dev Returns the name of the token."
578 | },
579 | "functionSelector": "06fdde03",
580 | "id": 635,
581 | "implemented": false,
582 | "kind": "function",
583 | "modifiers": [],
584 | "name": "name",
585 | "nameLocation": "309:4:2",
586 | "nodeType": "FunctionDefinition",
587 | "parameters": {
588 | "id": 631,
589 | "nodeType": "ParameterList",
590 | "parameters": [],
591 | "src": "313:2:2"
592 | },
593 | "returnParameters": {
594 | "id": 634,
595 | "nodeType": "ParameterList",
596 | "parameters": [
597 | {
598 | "constant": false,
599 | "id": 633,
600 | "mutability": "mutable",
601 | "name": "",
602 | "nameLocation": "-1:-1:-1",
603 | "nodeType": "VariableDeclaration",
604 | "scope": 635,
605 | "src": "339:13:2",
606 | "stateVariable": false,
607 | "storageLocation": "memory",
608 | "typeDescriptions": {
609 | "typeIdentifier": "t_string_memory_ptr",
610 | "typeString": "string"
611 | },
612 | "typeName": {
613 | "id": 632,
614 | "name": "string",
615 | "nodeType": "ElementaryTypeName",
616 | "src": "339:6:2",
617 | "typeDescriptions": {
618 | "typeIdentifier": "t_string_storage_ptr",
619 | "typeString": "string"
620 | }
621 | },
622 | "visibility": "internal"
623 | }
624 | ],
625 | "src": "338:15:2"
626 | },
627 | "scope": 648,
628 | "src": "300:54:2",
629 | "stateMutability": "view",
630 | "virtual": false,
631 | "visibility": "external"
632 | },
633 | {
634 | "documentation": {
635 | "id": 636,
636 | "nodeType": "StructuredDocumentation",
637 | "src": "360:56:2",
638 | "text": " @dev Returns the symbol of the token."
639 | },
640 | "functionSelector": "95d89b41",
641 | "id": 641,
642 | "implemented": false,
643 | "kind": "function",
644 | "modifiers": [],
645 | "name": "symbol",
646 | "nameLocation": "430:6:2",
647 | "nodeType": "FunctionDefinition",
648 | "parameters": {
649 | "id": 637,
650 | "nodeType": "ParameterList",
651 | "parameters": [],
652 | "src": "436:2:2"
653 | },
654 | "returnParameters": {
655 | "id": 640,
656 | "nodeType": "ParameterList",
657 | "parameters": [
658 | {
659 | "constant": false,
660 | "id": 639,
661 | "mutability": "mutable",
662 | "name": "",
663 | "nameLocation": "-1:-1:-1",
664 | "nodeType": "VariableDeclaration",
665 | "scope": 641,
666 | "src": "462:13:2",
667 | "stateVariable": false,
668 | "storageLocation": "memory",
669 | "typeDescriptions": {
670 | "typeIdentifier": "t_string_memory_ptr",
671 | "typeString": "string"
672 | },
673 | "typeName": {
674 | "id": 638,
675 | "name": "string",
676 | "nodeType": "ElementaryTypeName",
677 | "src": "462:6:2",
678 | "typeDescriptions": {
679 | "typeIdentifier": "t_string_storage_ptr",
680 | "typeString": "string"
681 | }
682 | },
683 | "visibility": "internal"
684 | }
685 | ],
686 | "src": "461:15:2"
687 | },
688 | "scope": 648,
689 | "src": "421:56:2",
690 | "stateMutability": "view",
691 | "virtual": false,
692 | "visibility": "external"
693 | },
694 | {
695 | "documentation": {
696 | "id": 642,
697 | "nodeType": "StructuredDocumentation",
698 | "src": "483:65:2",
699 | "text": " @dev Returns the decimals places of the token."
700 | },
701 | "functionSelector": "313ce567",
702 | "id": 647,
703 | "implemented": false,
704 | "kind": "function",
705 | "modifiers": [],
706 | "name": "decimals",
707 | "nameLocation": "562:8:2",
708 | "nodeType": "FunctionDefinition",
709 | "parameters": {
710 | "id": 643,
711 | "nodeType": "ParameterList",
712 | "parameters": [],
713 | "src": "570:2:2"
714 | },
715 | "returnParameters": {
716 | "id": 646,
717 | "nodeType": "ParameterList",
718 | "parameters": [
719 | {
720 | "constant": false,
721 | "id": 645,
722 | "mutability": "mutable",
723 | "name": "",
724 | "nameLocation": "-1:-1:-1",
725 | "nodeType": "VariableDeclaration",
726 | "scope": 647,
727 | "src": "596:5:2",
728 | "stateVariable": false,
729 | "storageLocation": "default",
730 | "typeDescriptions": {
731 | "typeIdentifier": "t_uint8",
732 | "typeString": "uint8"
733 | },
734 | "typeName": {
735 | "id": 644,
736 | "name": "uint8",
737 | "nodeType": "ElementaryTypeName",
738 | "src": "596:5:2",
739 | "typeDescriptions": {
740 | "typeIdentifier": "t_uint8",
741 | "typeString": "uint8"
742 | }
743 | },
744 | "visibility": "internal"
745 | }
746 | ],
747 | "src": "595:7:2"
748 | },
749 | "scope": 648,
750 | "src": "553:50:2",
751 | "stateMutability": "view",
752 | "virtual": false,
753 | "visibility": "external"
754 | }
755 | ],
756 | "scope": 649,
757 | "src": "200:405:2",
758 | "usedErrors": []
759 | }
760 | ],
761 | "src": "33:573:2"
762 | },
763 | "compiler": {
764 | "name": "solc",
765 | "version": "0.8.10+commit.fc410830.Emscripten.clang"
766 | },
767 | "networks": {},
768 | "schemaVersion": "3.4.3",
769 | "updatedAt": "2021-11-17T16:45:05.084Z",
770 | "devdoc": {
771 | "details": "Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._",
772 | "kind": "dev",
773 | "methods": {
774 | "allowance(address,address)": {
775 | "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called."
776 | },
777 | "approve(address,uint256)": {
778 | "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event."
779 | },
780 | "balanceOf(address)": {
781 | "details": "Returns the amount of tokens owned by `account`."
782 | },
783 | "decimals()": {
784 | "details": "Returns the decimals places of the token."
785 | },
786 | "name()": {
787 | "details": "Returns the name of the token."
788 | },
789 | "symbol()": {
790 | "details": "Returns the symbol of the token."
791 | },
792 | "totalSupply()": {
793 | "details": "Returns the amount of tokens in existence."
794 | },
795 | "transfer(address,uint256)": {
796 | "details": "Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
797 | },
798 | "transferFrom(address,address,uint256)": {
799 | "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
800 | }
801 | },
802 | "version": 1
803 | },
804 | "userdoc": {
805 | "kind": "user",
806 | "methods": {},
807 | "version": 1
808 | }
809 | }
--------------------------------------------------------------------------------
/abis/IERC20.json:
--------------------------------------------------------------------------------
1 | {
2 | "contractName": "IERC20",
3 | "abi": [
4 | {
5 | "anonymous": false,
6 | "inputs": [
7 | {
8 | "indexed": true,
9 | "internalType": "address",
10 | "name": "owner",
11 | "type": "address"
12 | },
13 | {
14 | "indexed": true,
15 | "internalType": "address",
16 | "name": "spender",
17 | "type": "address"
18 | },
19 | {
20 | "indexed": false,
21 | "internalType": "uint256",
22 | "name": "value",
23 | "type": "uint256"
24 | }
25 | ],
26 | "name": "Approval",
27 | "type": "event"
28 | },
29 | {
30 | "anonymous": false,
31 | "inputs": [
32 | {
33 | "indexed": true,
34 | "internalType": "address",
35 | "name": "from",
36 | "type": "address"
37 | },
38 | {
39 | "indexed": true,
40 | "internalType": "address",
41 | "name": "to",
42 | "type": "address"
43 | },
44 | {
45 | "indexed": false,
46 | "internalType": "uint256",
47 | "name": "value",
48 | "type": "uint256"
49 | }
50 | ],
51 | "name": "Transfer",
52 | "type": "event"
53 | },
54 | {
55 | "inputs": [],
56 | "name": "totalSupply",
57 | "outputs": [
58 | {
59 | "internalType": "uint256",
60 | "name": "",
61 | "type": "uint256"
62 | }
63 | ],
64 | "stateMutability": "view",
65 | "type": "function"
66 | },
67 | {
68 | "inputs": [
69 | {
70 | "internalType": "address",
71 | "name": "account",
72 | "type": "address"
73 | }
74 | ],
75 | "name": "balanceOf",
76 | "outputs": [
77 | {
78 | "internalType": "uint256",
79 | "name": "",
80 | "type": "uint256"
81 | }
82 | ],
83 | "stateMutability": "view",
84 | "type": "function"
85 | },
86 | {
87 | "inputs": [
88 | {
89 | "internalType": "address",
90 | "name": "recipient",
91 | "type": "address"
92 | },
93 | {
94 | "internalType": "uint256",
95 | "name": "amount",
96 | "type": "uint256"
97 | }
98 | ],
99 | "name": "transfer",
100 | "outputs": [
101 | {
102 | "internalType": "bool",
103 | "name": "",
104 | "type": "bool"
105 | }
106 | ],
107 | "stateMutability": "nonpayable",
108 | "type": "function"
109 | },
110 | {
111 | "inputs": [
112 | {
113 | "internalType": "address",
114 | "name": "owner",
115 | "type": "address"
116 | },
117 | {
118 | "internalType": "address",
119 | "name": "spender",
120 | "type": "address"
121 | }
122 | ],
123 | "name": "allowance",
124 | "outputs": [
125 | {
126 | "internalType": "uint256",
127 | "name": "",
128 | "type": "uint256"
129 | }
130 | ],
131 | "stateMutability": "view",
132 | "type": "function"
133 | },
134 | {
135 | "inputs": [
136 | {
137 | "internalType": "address",
138 | "name": "spender",
139 | "type": "address"
140 | },
141 | {
142 | "internalType": "uint256",
143 | "name": "amount",
144 | "type": "uint256"
145 | }
146 | ],
147 | "name": "approve",
148 | "outputs": [
149 | {
150 | "internalType": "bool",
151 | "name": "",
152 | "type": "bool"
153 | }
154 | ],
155 | "stateMutability": "nonpayable",
156 | "type": "function"
157 | },
158 | {
159 | "inputs": [
160 | {
161 | "internalType": "address",
162 | "name": "sender",
163 | "type": "address"
164 | },
165 | {
166 | "internalType": "address",
167 | "name": "recipient",
168 | "type": "address"
169 | },
170 | {
171 | "internalType": "uint256",
172 | "name": "amount",
173 | "type": "uint256"
174 | }
175 | ],
176 | "name": "transferFrom",
177 | "outputs": [
178 | {
179 | "internalType": "bool",
180 | "name": "",
181 | "type": "bool"
182 | }
183 | ],
184 | "stateMutability": "nonpayable",
185 | "type": "function"
186 | }
187 | ],
188 | "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP.\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x027b891937d20ccf213fdb9c31531574256de774bda99d3a70ecef6e1913ed2a\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://087318b21c528119f649899f5b5580566dd8d7b0303d4904bd0e8580c3545f14\",\"dweb:/ipfs/Qmbn5Mj7aUn8hJuQ8VrQjjEXRsXyJKykgnjR9p4C3nfLtL\"]}},\"version\":1}",
189 | "bytecode": "0x",
190 | "deployedBytecode": "0x",
191 | "immutableReferences": {},
192 | "generatedSources": [],
193 | "deployedGeneratedSources": [],
194 | "sourceMap": "",
195 | "deployedSourceMap": "",
196 | "source": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address recipient, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address sender,\n address recipient,\n uint256 amount\n ) external returns (bool);\n\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n",
197 | "sourcePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
198 | "ast": {
199 | "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
200 | "exportedSymbols": {
201 | "IERC20": [
202 | 623
203 | ]
204 | },
205 | "id": 624,
206 | "license": "MIT",
207 | "nodeType": "SourceUnit",
208 | "nodes": [
209 | {
210 | "id": 547,
211 | "literals": [
212 | "solidity",
213 | "^",
214 | "0.8",
215 | ".0"
216 | ],
217 | "nodeType": "PragmaDirective",
218 | "src": "33:23:1"
219 | },
220 | {
221 | "abstract": false,
222 | "baseContracts": [],
223 | "canonicalName": "IERC20",
224 | "contractDependencies": [],
225 | "contractKind": "interface",
226 | "documentation": {
227 | "id": 548,
228 | "nodeType": "StructuredDocumentation",
229 | "src": "58:70:1",
230 | "text": " @dev Interface of the ERC20 standard as defined in the EIP."
231 | },
232 | "fullyImplemented": false,
233 | "id": 623,
234 | "linearizedBaseContracts": [
235 | 623
236 | ],
237 | "name": "IERC20",
238 | "nameLocation": "139:6:1",
239 | "nodeType": "ContractDefinition",
240 | "nodes": [
241 | {
242 | "documentation": {
243 | "id": 549,
244 | "nodeType": "StructuredDocumentation",
245 | "src": "152:66:1",
246 | "text": " @dev Returns the amount of tokens in existence."
247 | },
248 | "functionSelector": "18160ddd",
249 | "id": 554,
250 | "implemented": false,
251 | "kind": "function",
252 | "modifiers": [],
253 | "name": "totalSupply",
254 | "nameLocation": "232:11:1",
255 | "nodeType": "FunctionDefinition",
256 | "parameters": {
257 | "id": 550,
258 | "nodeType": "ParameterList",
259 | "parameters": [],
260 | "src": "243:2:1"
261 | },
262 | "returnParameters": {
263 | "id": 553,
264 | "nodeType": "ParameterList",
265 | "parameters": [
266 | {
267 | "constant": false,
268 | "id": 552,
269 | "mutability": "mutable",
270 | "name": "",
271 | "nameLocation": "-1:-1:-1",
272 | "nodeType": "VariableDeclaration",
273 | "scope": 554,
274 | "src": "269:7:1",
275 | "stateVariable": false,
276 | "storageLocation": "default",
277 | "typeDescriptions": {
278 | "typeIdentifier": "t_uint256",
279 | "typeString": "uint256"
280 | },
281 | "typeName": {
282 | "id": 551,
283 | "name": "uint256",
284 | "nodeType": "ElementaryTypeName",
285 | "src": "269:7:1",
286 | "typeDescriptions": {
287 | "typeIdentifier": "t_uint256",
288 | "typeString": "uint256"
289 | }
290 | },
291 | "visibility": "internal"
292 | }
293 | ],
294 | "src": "268:9:1"
295 | },
296 | "scope": 623,
297 | "src": "223:55:1",
298 | "stateMutability": "view",
299 | "virtual": false,
300 | "visibility": "external"
301 | },
302 | {
303 | "documentation": {
304 | "id": 555,
305 | "nodeType": "StructuredDocumentation",
306 | "src": "284:72:1",
307 | "text": " @dev Returns the amount of tokens owned by `account`."
308 | },
309 | "functionSelector": "70a08231",
310 | "id": 562,
311 | "implemented": false,
312 | "kind": "function",
313 | "modifiers": [],
314 | "name": "balanceOf",
315 | "nameLocation": "370:9:1",
316 | "nodeType": "FunctionDefinition",
317 | "parameters": {
318 | "id": 558,
319 | "nodeType": "ParameterList",
320 | "parameters": [
321 | {
322 | "constant": false,
323 | "id": 557,
324 | "mutability": "mutable",
325 | "name": "account",
326 | "nameLocation": "388:7:1",
327 | "nodeType": "VariableDeclaration",
328 | "scope": 562,
329 | "src": "380:15:1",
330 | "stateVariable": false,
331 | "storageLocation": "default",
332 | "typeDescriptions": {
333 | "typeIdentifier": "t_address",
334 | "typeString": "address"
335 | },
336 | "typeName": {
337 | "id": 556,
338 | "name": "address",
339 | "nodeType": "ElementaryTypeName",
340 | "src": "380:7:1",
341 | "stateMutability": "nonpayable",
342 | "typeDescriptions": {
343 | "typeIdentifier": "t_address",
344 | "typeString": "address"
345 | }
346 | },
347 | "visibility": "internal"
348 | }
349 | ],
350 | "src": "379:17:1"
351 | },
352 | "returnParameters": {
353 | "id": 561,
354 | "nodeType": "ParameterList",
355 | "parameters": [
356 | {
357 | "constant": false,
358 | "id": 560,
359 | "mutability": "mutable",
360 | "name": "",
361 | "nameLocation": "-1:-1:-1",
362 | "nodeType": "VariableDeclaration",
363 | "scope": 562,
364 | "src": "420:7:1",
365 | "stateVariable": false,
366 | "storageLocation": "default",
367 | "typeDescriptions": {
368 | "typeIdentifier": "t_uint256",
369 | "typeString": "uint256"
370 | },
371 | "typeName": {
372 | "id": 559,
373 | "name": "uint256",
374 | "nodeType": "ElementaryTypeName",
375 | "src": "420:7:1",
376 | "typeDescriptions": {
377 | "typeIdentifier": "t_uint256",
378 | "typeString": "uint256"
379 | }
380 | },
381 | "visibility": "internal"
382 | }
383 | ],
384 | "src": "419:9:1"
385 | },
386 | "scope": 623,
387 | "src": "361:68:1",
388 | "stateMutability": "view",
389 | "virtual": false,
390 | "visibility": "external"
391 | },
392 | {
393 | "documentation": {
394 | "id": 563,
395 | "nodeType": "StructuredDocumentation",
396 | "src": "435:209:1",
397 | "text": " @dev Moves `amount` tokens from the caller's account to `recipient`.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
398 | },
399 | "functionSelector": "a9059cbb",
400 | "id": 572,
401 | "implemented": false,
402 | "kind": "function",
403 | "modifiers": [],
404 | "name": "transfer",
405 | "nameLocation": "658:8:1",
406 | "nodeType": "FunctionDefinition",
407 | "parameters": {
408 | "id": 568,
409 | "nodeType": "ParameterList",
410 | "parameters": [
411 | {
412 | "constant": false,
413 | "id": 565,
414 | "mutability": "mutable",
415 | "name": "recipient",
416 | "nameLocation": "675:9:1",
417 | "nodeType": "VariableDeclaration",
418 | "scope": 572,
419 | "src": "667:17:1",
420 | "stateVariable": false,
421 | "storageLocation": "default",
422 | "typeDescriptions": {
423 | "typeIdentifier": "t_address",
424 | "typeString": "address"
425 | },
426 | "typeName": {
427 | "id": 564,
428 | "name": "address",
429 | "nodeType": "ElementaryTypeName",
430 | "src": "667:7:1",
431 | "stateMutability": "nonpayable",
432 | "typeDescriptions": {
433 | "typeIdentifier": "t_address",
434 | "typeString": "address"
435 | }
436 | },
437 | "visibility": "internal"
438 | },
439 | {
440 | "constant": false,
441 | "id": 567,
442 | "mutability": "mutable",
443 | "name": "amount",
444 | "nameLocation": "694:6:1",
445 | "nodeType": "VariableDeclaration",
446 | "scope": 572,
447 | "src": "686:14:1",
448 | "stateVariable": false,
449 | "storageLocation": "default",
450 | "typeDescriptions": {
451 | "typeIdentifier": "t_uint256",
452 | "typeString": "uint256"
453 | },
454 | "typeName": {
455 | "id": 566,
456 | "name": "uint256",
457 | "nodeType": "ElementaryTypeName",
458 | "src": "686:7:1",
459 | "typeDescriptions": {
460 | "typeIdentifier": "t_uint256",
461 | "typeString": "uint256"
462 | }
463 | },
464 | "visibility": "internal"
465 | }
466 | ],
467 | "src": "666:35:1"
468 | },
469 | "returnParameters": {
470 | "id": 571,
471 | "nodeType": "ParameterList",
472 | "parameters": [
473 | {
474 | "constant": false,
475 | "id": 570,
476 | "mutability": "mutable",
477 | "name": "",
478 | "nameLocation": "-1:-1:-1",
479 | "nodeType": "VariableDeclaration",
480 | "scope": 572,
481 | "src": "720:4:1",
482 | "stateVariable": false,
483 | "storageLocation": "default",
484 | "typeDescriptions": {
485 | "typeIdentifier": "t_bool",
486 | "typeString": "bool"
487 | },
488 | "typeName": {
489 | "id": 569,
490 | "name": "bool",
491 | "nodeType": "ElementaryTypeName",
492 | "src": "720:4:1",
493 | "typeDescriptions": {
494 | "typeIdentifier": "t_bool",
495 | "typeString": "bool"
496 | }
497 | },
498 | "visibility": "internal"
499 | }
500 | ],
501 | "src": "719:6:1"
502 | },
503 | "scope": 623,
504 | "src": "649:77:1",
505 | "stateMutability": "nonpayable",
506 | "virtual": false,
507 | "visibility": "external"
508 | },
509 | {
510 | "documentation": {
511 | "id": 573,
512 | "nodeType": "StructuredDocumentation",
513 | "src": "732:264:1",
514 | "text": " @dev Returns the remaining number of tokens that `spender` will be\n allowed to spend on behalf of `owner` through {transferFrom}. This is\n zero by default.\n This value changes when {approve} or {transferFrom} are called."
515 | },
516 | "functionSelector": "dd62ed3e",
517 | "id": 582,
518 | "implemented": false,
519 | "kind": "function",
520 | "modifiers": [],
521 | "name": "allowance",
522 | "nameLocation": "1010:9:1",
523 | "nodeType": "FunctionDefinition",
524 | "parameters": {
525 | "id": 578,
526 | "nodeType": "ParameterList",
527 | "parameters": [
528 | {
529 | "constant": false,
530 | "id": 575,
531 | "mutability": "mutable",
532 | "name": "owner",
533 | "nameLocation": "1028:5:1",
534 | "nodeType": "VariableDeclaration",
535 | "scope": 582,
536 | "src": "1020:13:1",
537 | "stateVariable": false,
538 | "storageLocation": "default",
539 | "typeDescriptions": {
540 | "typeIdentifier": "t_address",
541 | "typeString": "address"
542 | },
543 | "typeName": {
544 | "id": 574,
545 | "name": "address",
546 | "nodeType": "ElementaryTypeName",
547 | "src": "1020:7:1",
548 | "stateMutability": "nonpayable",
549 | "typeDescriptions": {
550 | "typeIdentifier": "t_address",
551 | "typeString": "address"
552 | }
553 | },
554 | "visibility": "internal"
555 | },
556 | {
557 | "constant": false,
558 | "id": 577,
559 | "mutability": "mutable",
560 | "name": "spender",
561 | "nameLocation": "1043:7:1",
562 | "nodeType": "VariableDeclaration",
563 | "scope": 582,
564 | "src": "1035:15:1",
565 | "stateVariable": false,
566 | "storageLocation": "default",
567 | "typeDescriptions": {
568 | "typeIdentifier": "t_address",
569 | "typeString": "address"
570 | },
571 | "typeName": {
572 | "id": 576,
573 | "name": "address",
574 | "nodeType": "ElementaryTypeName",
575 | "src": "1035:7:1",
576 | "stateMutability": "nonpayable",
577 | "typeDescriptions": {
578 | "typeIdentifier": "t_address",
579 | "typeString": "address"
580 | }
581 | },
582 | "visibility": "internal"
583 | }
584 | ],
585 | "src": "1019:32:1"
586 | },
587 | "returnParameters": {
588 | "id": 581,
589 | "nodeType": "ParameterList",
590 | "parameters": [
591 | {
592 | "constant": false,
593 | "id": 580,
594 | "mutability": "mutable",
595 | "name": "",
596 | "nameLocation": "-1:-1:-1",
597 | "nodeType": "VariableDeclaration",
598 | "scope": 582,
599 | "src": "1075:7:1",
600 | "stateVariable": false,
601 | "storageLocation": "default",
602 | "typeDescriptions": {
603 | "typeIdentifier": "t_uint256",
604 | "typeString": "uint256"
605 | },
606 | "typeName": {
607 | "id": 579,
608 | "name": "uint256",
609 | "nodeType": "ElementaryTypeName",
610 | "src": "1075:7:1",
611 | "typeDescriptions": {
612 | "typeIdentifier": "t_uint256",
613 | "typeString": "uint256"
614 | }
615 | },
616 | "visibility": "internal"
617 | }
618 | ],
619 | "src": "1074:9:1"
620 | },
621 | "scope": 623,
622 | "src": "1001:83:1",
623 | "stateMutability": "view",
624 | "virtual": false,
625 | "visibility": "external"
626 | },
627 | {
628 | "documentation": {
629 | "id": 583,
630 | "nodeType": "StructuredDocumentation",
631 | "src": "1090:642:1",
632 | "text": " @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n Returns a boolean value indicating whether the operation succeeded.\n IMPORTANT: Beware that changing an allowance with this method brings the risk\n that someone may use both the old and the new allowance by unfortunate\n transaction ordering. One possible solution to mitigate this race\n condition is to first reduce the spender's allowance to 0 and set the\n desired value afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n Emits an {Approval} event."
633 | },
634 | "functionSelector": "095ea7b3",
635 | "id": 592,
636 | "implemented": false,
637 | "kind": "function",
638 | "modifiers": [],
639 | "name": "approve",
640 | "nameLocation": "1746:7:1",
641 | "nodeType": "FunctionDefinition",
642 | "parameters": {
643 | "id": 588,
644 | "nodeType": "ParameterList",
645 | "parameters": [
646 | {
647 | "constant": false,
648 | "id": 585,
649 | "mutability": "mutable",
650 | "name": "spender",
651 | "nameLocation": "1762:7:1",
652 | "nodeType": "VariableDeclaration",
653 | "scope": 592,
654 | "src": "1754:15:1",
655 | "stateVariable": false,
656 | "storageLocation": "default",
657 | "typeDescriptions": {
658 | "typeIdentifier": "t_address",
659 | "typeString": "address"
660 | },
661 | "typeName": {
662 | "id": 584,
663 | "name": "address",
664 | "nodeType": "ElementaryTypeName",
665 | "src": "1754:7:1",
666 | "stateMutability": "nonpayable",
667 | "typeDescriptions": {
668 | "typeIdentifier": "t_address",
669 | "typeString": "address"
670 | }
671 | },
672 | "visibility": "internal"
673 | },
674 | {
675 | "constant": false,
676 | "id": 587,
677 | "mutability": "mutable",
678 | "name": "amount",
679 | "nameLocation": "1779:6:1",
680 | "nodeType": "VariableDeclaration",
681 | "scope": 592,
682 | "src": "1771:14:1",
683 | "stateVariable": false,
684 | "storageLocation": "default",
685 | "typeDescriptions": {
686 | "typeIdentifier": "t_uint256",
687 | "typeString": "uint256"
688 | },
689 | "typeName": {
690 | "id": 586,
691 | "name": "uint256",
692 | "nodeType": "ElementaryTypeName",
693 | "src": "1771:7:1",
694 | "typeDescriptions": {
695 | "typeIdentifier": "t_uint256",
696 | "typeString": "uint256"
697 | }
698 | },
699 | "visibility": "internal"
700 | }
701 | ],
702 | "src": "1753:33:1"
703 | },
704 | "returnParameters": {
705 | "id": 591,
706 | "nodeType": "ParameterList",
707 | "parameters": [
708 | {
709 | "constant": false,
710 | "id": 590,
711 | "mutability": "mutable",
712 | "name": "",
713 | "nameLocation": "-1:-1:-1",
714 | "nodeType": "VariableDeclaration",
715 | "scope": 592,
716 | "src": "1805:4:1",
717 | "stateVariable": false,
718 | "storageLocation": "default",
719 | "typeDescriptions": {
720 | "typeIdentifier": "t_bool",
721 | "typeString": "bool"
722 | },
723 | "typeName": {
724 | "id": 589,
725 | "name": "bool",
726 | "nodeType": "ElementaryTypeName",
727 | "src": "1805:4:1",
728 | "typeDescriptions": {
729 | "typeIdentifier": "t_bool",
730 | "typeString": "bool"
731 | }
732 | },
733 | "visibility": "internal"
734 | }
735 | ],
736 | "src": "1804:6:1"
737 | },
738 | "scope": 623,
739 | "src": "1737:74:1",
740 | "stateMutability": "nonpayable",
741 | "virtual": false,
742 | "visibility": "external"
743 | },
744 | {
745 | "documentation": {
746 | "id": 593,
747 | "nodeType": "StructuredDocumentation",
748 | "src": "1817:296:1",
749 | "text": " @dev Moves `amount` tokens from `sender` to `recipient` using the\n allowance mechanism. `amount` is then deducted from the caller's\n allowance.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
750 | },
751 | "functionSelector": "23b872dd",
752 | "id": 604,
753 | "implemented": false,
754 | "kind": "function",
755 | "modifiers": [],
756 | "name": "transferFrom",
757 | "nameLocation": "2127:12:1",
758 | "nodeType": "FunctionDefinition",
759 | "parameters": {
760 | "id": 600,
761 | "nodeType": "ParameterList",
762 | "parameters": [
763 | {
764 | "constant": false,
765 | "id": 595,
766 | "mutability": "mutable",
767 | "name": "sender",
768 | "nameLocation": "2157:6:1",
769 | "nodeType": "VariableDeclaration",
770 | "scope": 604,
771 | "src": "2149:14:1",
772 | "stateVariable": false,
773 | "storageLocation": "default",
774 | "typeDescriptions": {
775 | "typeIdentifier": "t_address",
776 | "typeString": "address"
777 | },
778 | "typeName": {
779 | "id": 594,
780 | "name": "address",
781 | "nodeType": "ElementaryTypeName",
782 | "src": "2149:7:1",
783 | "stateMutability": "nonpayable",
784 | "typeDescriptions": {
785 | "typeIdentifier": "t_address",
786 | "typeString": "address"
787 | }
788 | },
789 | "visibility": "internal"
790 | },
791 | {
792 | "constant": false,
793 | "id": 597,
794 | "mutability": "mutable",
795 | "name": "recipient",
796 | "nameLocation": "2181:9:1",
797 | "nodeType": "VariableDeclaration",
798 | "scope": 604,
799 | "src": "2173:17:1",
800 | "stateVariable": false,
801 | "storageLocation": "default",
802 | "typeDescriptions": {
803 | "typeIdentifier": "t_address",
804 | "typeString": "address"
805 | },
806 | "typeName": {
807 | "id": 596,
808 | "name": "address",
809 | "nodeType": "ElementaryTypeName",
810 | "src": "2173:7:1",
811 | "stateMutability": "nonpayable",
812 | "typeDescriptions": {
813 | "typeIdentifier": "t_address",
814 | "typeString": "address"
815 | }
816 | },
817 | "visibility": "internal"
818 | },
819 | {
820 | "constant": false,
821 | "id": 599,
822 | "mutability": "mutable",
823 | "name": "amount",
824 | "nameLocation": "2208:6:1",
825 | "nodeType": "VariableDeclaration",
826 | "scope": 604,
827 | "src": "2200:14:1",
828 | "stateVariable": false,
829 | "storageLocation": "default",
830 | "typeDescriptions": {
831 | "typeIdentifier": "t_uint256",
832 | "typeString": "uint256"
833 | },
834 | "typeName": {
835 | "id": 598,
836 | "name": "uint256",
837 | "nodeType": "ElementaryTypeName",
838 | "src": "2200:7:1",
839 | "typeDescriptions": {
840 | "typeIdentifier": "t_uint256",
841 | "typeString": "uint256"
842 | }
843 | },
844 | "visibility": "internal"
845 | }
846 | ],
847 | "src": "2139:81:1"
848 | },
849 | "returnParameters": {
850 | "id": 603,
851 | "nodeType": "ParameterList",
852 | "parameters": [
853 | {
854 | "constant": false,
855 | "id": 602,
856 | "mutability": "mutable",
857 | "name": "",
858 | "nameLocation": "-1:-1:-1",
859 | "nodeType": "VariableDeclaration",
860 | "scope": 604,
861 | "src": "2239:4:1",
862 | "stateVariable": false,
863 | "storageLocation": "default",
864 | "typeDescriptions": {
865 | "typeIdentifier": "t_bool",
866 | "typeString": "bool"
867 | },
868 | "typeName": {
869 | "id": 601,
870 | "name": "bool",
871 | "nodeType": "ElementaryTypeName",
872 | "src": "2239:4:1",
873 | "typeDescriptions": {
874 | "typeIdentifier": "t_bool",
875 | "typeString": "bool"
876 | }
877 | },
878 | "visibility": "internal"
879 | }
880 | ],
881 | "src": "2238:6:1"
882 | },
883 | "scope": 623,
884 | "src": "2118:127:1",
885 | "stateMutability": "nonpayable",
886 | "virtual": false,
887 | "visibility": "external"
888 | },
889 | {
890 | "anonymous": false,
891 | "documentation": {
892 | "id": 605,
893 | "nodeType": "StructuredDocumentation",
894 | "src": "2251:158:1",
895 | "text": " @dev Emitted when `value` tokens are moved from one account (`from`) to\n another (`to`).\n Note that `value` may be zero."
896 | },
897 | "id": 613,
898 | "name": "Transfer",
899 | "nameLocation": "2420:8:1",
900 | "nodeType": "EventDefinition",
901 | "parameters": {
902 | "id": 612,
903 | "nodeType": "ParameterList",
904 | "parameters": [
905 | {
906 | "constant": false,
907 | "id": 607,
908 | "indexed": true,
909 | "mutability": "mutable",
910 | "name": "from",
911 | "nameLocation": "2445:4:1",
912 | "nodeType": "VariableDeclaration",
913 | "scope": 613,
914 | "src": "2429:20:1",
915 | "stateVariable": false,
916 | "storageLocation": "default",
917 | "typeDescriptions": {
918 | "typeIdentifier": "t_address",
919 | "typeString": "address"
920 | },
921 | "typeName": {
922 | "id": 606,
923 | "name": "address",
924 | "nodeType": "ElementaryTypeName",
925 | "src": "2429:7:1",
926 | "stateMutability": "nonpayable",
927 | "typeDescriptions": {
928 | "typeIdentifier": "t_address",
929 | "typeString": "address"
930 | }
931 | },
932 | "visibility": "internal"
933 | },
934 | {
935 | "constant": false,
936 | "id": 609,
937 | "indexed": true,
938 | "mutability": "mutable",
939 | "name": "to",
940 | "nameLocation": "2467:2:1",
941 | "nodeType": "VariableDeclaration",
942 | "scope": 613,
943 | "src": "2451:18:1",
944 | "stateVariable": false,
945 | "storageLocation": "default",
946 | "typeDescriptions": {
947 | "typeIdentifier": "t_address",
948 | "typeString": "address"
949 | },
950 | "typeName": {
951 | "id": 608,
952 | "name": "address",
953 | "nodeType": "ElementaryTypeName",
954 | "src": "2451:7:1",
955 | "stateMutability": "nonpayable",
956 | "typeDescriptions": {
957 | "typeIdentifier": "t_address",
958 | "typeString": "address"
959 | }
960 | },
961 | "visibility": "internal"
962 | },
963 | {
964 | "constant": false,
965 | "id": 611,
966 | "indexed": false,
967 | "mutability": "mutable",
968 | "name": "value",
969 | "nameLocation": "2479:5:1",
970 | "nodeType": "VariableDeclaration",
971 | "scope": 613,
972 | "src": "2471:13:1",
973 | "stateVariable": false,
974 | "storageLocation": "default",
975 | "typeDescriptions": {
976 | "typeIdentifier": "t_uint256",
977 | "typeString": "uint256"
978 | },
979 | "typeName": {
980 | "id": 610,
981 | "name": "uint256",
982 | "nodeType": "ElementaryTypeName",
983 | "src": "2471:7:1",
984 | "typeDescriptions": {
985 | "typeIdentifier": "t_uint256",
986 | "typeString": "uint256"
987 | }
988 | },
989 | "visibility": "internal"
990 | }
991 | ],
992 | "src": "2428:57:1"
993 | },
994 | "src": "2414:72:1"
995 | },
996 | {
997 | "anonymous": false,
998 | "documentation": {
999 | "id": 614,
1000 | "nodeType": "StructuredDocumentation",
1001 | "src": "2492:148:1",
1002 | "text": " @dev Emitted when the allowance of a `spender` for an `owner` is set by\n a call to {approve}. `value` is the new allowance."
1003 | },
1004 | "id": 622,
1005 | "name": "Approval",
1006 | "nameLocation": "2651:8:1",
1007 | "nodeType": "EventDefinition",
1008 | "parameters": {
1009 | "id": 621,
1010 | "nodeType": "ParameterList",
1011 | "parameters": [
1012 | {
1013 | "constant": false,
1014 | "id": 616,
1015 | "indexed": true,
1016 | "mutability": "mutable",
1017 | "name": "owner",
1018 | "nameLocation": "2676:5:1",
1019 | "nodeType": "VariableDeclaration",
1020 | "scope": 622,
1021 | "src": "2660:21:1",
1022 | "stateVariable": false,
1023 | "storageLocation": "default",
1024 | "typeDescriptions": {
1025 | "typeIdentifier": "t_address",
1026 | "typeString": "address"
1027 | },
1028 | "typeName": {
1029 | "id": 615,
1030 | "name": "address",
1031 | "nodeType": "ElementaryTypeName",
1032 | "src": "2660:7:1",
1033 | "stateMutability": "nonpayable",
1034 | "typeDescriptions": {
1035 | "typeIdentifier": "t_address",
1036 | "typeString": "address"
1037 | }
1038 | },
1039 | "visibility": "internal"
1040 | },
1041 | {
1042 | "constant": false,
1043 | "id": 618,
1044 | "indexed": true,
1045 | "mutability": "mutable",
1046 | "name": "spender",
1047 | "nameLocation": "2699:7:1",
1048 | "nodeType": "VariableDeclaration",
1049 | "scope": 622,
1050 | "src": "2683:23:1",
1051 | "stateVariable": false,
1052 | "storageLocation": "default",
1053 | "typeDescriptions": {
1054 | "typeIdentifier": "t_address",
1055 | "typeString": "address"
1056 | },
1057 | "typeName": {
1058 | "id": 617,
1059 | "name": "address",
1060 | "nodeType": "ElementaryTypeName",
1061 | "src": "2683:7:1",
1062 | "stateMutability": "nonpayable",
1063 | "typeDescriptions": {
1064 | "typeIdentifier": "t_address",
1065 | "typeString": "address"
1066 | }
1067 | },
1068 | "visibility": "internal"
1069 | },
1070 | {
1071 | "constant": false,
1072 | "id": 620,
1073 | "indexed": false,
1074 | "mutability": "mutable",
1075 | "name": "value",
1076 | "nameLocation": "2716:5:1",
1077 | "nodeType": "VariableDeclaration",
1078 | "scope": 622,
1079 | "src": "2708:13:1",
1080 | "stateVariable": false,
1081 | "storageLocation": "default",
1082 | "typeDescriptions": {
1083 | "typeIdentifier": "t_uint256",
1084 | "typeString": "uint256"
1085 | },
1086 | "typeName": {
1087 | "id": 619,
1088 | "name": "uint256",
1089 | "nodeType": "ElementaryTypeName",
1090 | "src": "2708:7:1",
1091 | "typeDescriptions": {
1092 | "typeIdentifier": "t_uint256",
1093 | "typeString": "uint256"
1094 | }
1095 | },
1096 | "visibility": "internal"
1097 | }
1098 | ],
1099 | "src": "2659:63:1"
1100 | },
1101 | "src": "2645:78:1"
1102 | }
1103 | ],
1104 | "scope": 624,
1105 | "src": "129:2596:1",
1106 | "usedErrors": []
1107 | }
1108 | ],
1109 | "src": "33:2693:1"
1110 | },
1111 | "legacyAST": {
1112 | "absolutePath": "@openzeppelin/contracts/token/ERC20/IERC20.sol",
1113 | "exportedSymbols": {
1114 | "IERC20": [
1115 | 623
1116 | ]
1117 | },
1118 | "id": 624,
1119 | "license": "MIT",
1120 | "nodeType": "SourceUnit",
1121 | "nodes": [
1122 | {
1123 | "id": 547,
1124 | "literals": [
1125 | "solidity",
1126 | "^",
1127 | "0.8",
1128 | ".0"
1129 | ],
1130 | "nodeType": "PragmaDirective",
1131 | "src": "33:23:1"
1132 | },
1133 | {
1134 | "abstract": false,
1135 | "baseContracts": [],
1136 | "canonicalName": "IERC20",
1137 | "contractDependencies": [],
1138 | "contractKind": "interface",
1139 | "documentation": {
1140 | "id": 548,
1141 | "nodeType": "StructuredDocumentation",
1142 | "src": "58:70:1",
1143 | "text": " @dev Interface of the ERC20 standard as defined in the EIP."
1144 | },
1145 | "fullyImplemented": false,
1146 | "id": 623,
1147 | "linearizedBaseContracts": [
1148 | 623
1149 | ],
1150 | "name": "IERC20",
1151 | "nameLocation": "139:6:1",
1152 | "nodeType": "ContractDefinition",
1153 | "nodes": [
1154 | {
1155 | "documentation": {
1156 | "id": 549,
1157 | "nodeType": "StructuredDocumentation",
1158 | "src": "152:66:1",
1159 | "text": " @dev Returns the amount of tokens in existence."
1160 | },
1161 | "functionSelector": "18160ddd",
1162 | "id": 554,
1163 | "implemented": false,
1164 | "kind": "function",
1165 | "modifiers": [],
1166 | "name": "totalSupply",
1167 | "nameLocation": "232:11:1",
1168 | "nodeType": "FunctionDefinition",
1169 | "parameters": {
1170 | "id": 550,
1171 | "nodeType": "ParameterList",
1172 | "parameters": [],
1173 | "src": "243:2:1"
1174 | },
1175 | "returnParameters": {
1176 | "id": 553,
1177 | "nodeType": "ParameterList",
1178 | "parameters": [
1179 | {
1180 | "constant": false,
1181 | "id": 552,
1182 | "mutability": "mutable",
1183 | "name": "",
1184 | "nameLocation": "-1:-1:-1",
1185 | "nodeType": "VariableDeclaration",
1186 | "scope": 554,
1187 | "src": "269:7:1",
1188 | "stateVariable": false,
1189 | "storageLocation": "default",
1190 | "typeDescriptions": {
1191 | "typeIdentifier": "t_uint256",
1192 | "typeString": "uint256"
1193 | },
1194 | "typeName": {
1195 | "id": 551,
1196 | "name": "uint256",
1197 | "nodeType": "ElementaryTypeName",
1198 | "src": "269:7:1",
1199 | "typeDescriptions": {
1200 | "typeIdentifier": "t_uint256",
1201 | "typeString": "uint256"
1202 | }
1203 | },
1204 | "visibility": "internal"
1205 | }
1206 | ],
1207 | "src": "268:9:1"
1208 | },
1209 | "scope": 623,
1210 | "src": "223:55:1",
1211 | "stateMutability": "view",
1212 | "virtual": false,
1213 | "visibility": "external"
1214 | },
1215 | {
1216 | "documentation": {
1217 | "id": 555,
1218 | "nodeType": "StructuredDocumentation",
1219 | "src": "284:72:1",
1220 | "text": " @dev Returns the amount of tokens owned by `account`."
1221 | },
1222 | "functionSelector": "70a08231",
1223 | "id": 562,
1224 | "implemented": false,
1225 | "kind": "function",
1226 | "modifiers": [],
1227 | "name": "balanceOf",
1228 | "nameLocation": "370:9:1",
1229 | "nodeType": "FunctionDefinition",
1230 | "parameters": {
1231 | "id": 558,
1232 | "nodeType": "ParameterList",
1233 | "parameters": [
1234 | {
1235 | "constant": false,
1236 | "id": 557,
1237 | "mutability": "mutable",
1238 | "name": "account",
1239 | "nameLocation": "388:7:1",
1240 | "nodeType": "VariableDeclaration",
1241 | "scope": 562,
1242 | "src": "380:15:1",
1243 | "stateVariable": false,
1244 | "storageLocation": "default",
1245 | "typeDescriptions": {
1246 | "typeIdentifier": "t_address",
1247 | "typeString": "address"
1248 | },
1249 | "typeName": {
1250 | "id": 556,
1251 | "name": "address",
1252 | "nodeType": "ElementaryTypeName",
1253 | "src": "380:7:1",
1254 | "stateMutability": "nonpayable",
1255 | "typeDescriptions": {
1256 | "typeIdentifier": "t_address",
1257 | "typeString": "address"
1258 | }
1259 | },
1260 | "visibility": "internal"
1261 | }
1262 | ],
1263 | "src": "379:17:1"
1264 | },
1265 | "returnParameters": {
1266 | "id": 561,
1267 | "nodeType": "ParameterList",
1268 | "parameters": [
1269 | {
1270 | "constant": false,
1271 | "id": 560,
1272 | "mutability": "mutable",
1273 | "name": "",
1274 | "nameLocation": "-1:-1:-1",
1275 | "nodeType": "VariableDeclaration",
1276 | "scope": 562,
1277 | "src": "420:7:1",
1278 | "stateVariable": false,
1279 | "storageLocation": "default",
1280 | "typeDescriptions": {
1281 | "typeIdentifier": "t_uint256",
1282 | "typeString": "uint256"
1283 | },
1284 | "typeName": {
1285 | "id": 559,
1286 | "name": "uint256",
1287 | "nodeType": "ElementaryTypeName",
1288 | "src": "420:7:1",
1289 | "typeDescriptions": {
1290 | "typeIdentifier": "t_uint256",
1291 | "typeString": "uint256"
1292 | }
1293 | },
1294 | "visibility": "internal"
1295 | }
1296 | ],
1297 | "src": "419:9:1"
1298 | },
1299 | "scope": 623,
1300 | "src": "361:68:1",
1301 | "stateMutability": "view",
1302 | "virtual": false,
1303 | "visibility": "external"
1304 | },
1305 | {
1306 | "documentation": {
1307 | "id": 563,
1308 | "nodeType": "StructuredDocumentation",
1309 | "src": "435:209:1",
1310 | "text": " @dev Moves `amount` tokens from the caller's account to `recipient`.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
1311 | },
1312 | "functionSelector": "a9059cbb",
1313 | "id": 572,
1314 | "implemented": false,
1315 | "kind": "function",
1316 | "modifiers": [],
1317 | "name": "transfer",
1318 | "nameLocation": "658:8:1",
1319 | "nodeType": "FunctionDefinition",
1320 | "parameters": {
1321 | "id": 568,
1322 | "nodeType": "ParameterList",
1323 | "parameters": [
1324 | {
1325 | "constant": false,
1326 | "id": 565,
1327 | "mutability": "mutable",
1328 | "name": "recipient",
1329 | "nameLocation": "675:9:1",
1330 | "nodeType": "VariableDeclaration",
1331 | "scope": 572,
1332 | "src": "667:17:1",
1333 | "stateVariable": false,
1334 | "storageLocation": "default",
1335 | "typeDescriptions": {
1336 | "typeIdentifier": "t_address",
1337 | "typeString": "address"
1338 | },
1339 | "typeName": {
1340 | "id": 564,
1341 | "name": "address",
1342 | "nodeType": "ElementaryTypeName",
1343 | "src": "667:7:1",
1344 | "stateMutability": "nonpayable",
1345 | "typeDescriptions": {
1346 | "typeIdentifier": "t_address",
1347 | "typeString": "address"
1348 | }
1349 | },
1350 | "visibility": "internal"
1351 | },
1352 | {
1353 | "constant": false,
1354 | "id": 567,
1355 | "mutability": "mutable",
1356 | "name": "amount",
1357 | "nameLocation": "694:6:1",
1358 | "nodeType": "VariableDeclaration",
1359 | "scope": 572,
1360 | "src": "686:14:1",
1361 | "stateVariable": false,
1362 | "storageLocation": "default",
1363 | "typeDescriptions": {
1364 | "typeIdentifier": "t_uint256",
1365 | "typeString": "uint256"
1366 | },
1367 | "typeName": {
1368 | "id": 566,
1369 | "name": "uint256",
1370 | "nodeType": "ElementaryTypeName",
1371 | "src": "686:7:1",
1372 | "typeDescriptions": {
1373 | "typeIdentifier": "t_uint256",
1374 | "typeString": "uint256"
1375 | }
1376 | },
1377 | "visibility": "internal"
1378 | }
1379 | ],
1380 | "src": "666:35:1"
1381 | },
1382 | "returnParameters": {
1383 | "id": 571,
1384 | "nodeType": "ParameterList",
1385 | "parameters": [
1386 | {
1387 | "constant": false,
1388 | "id": 570,
1389 | "mutability": "mutable",
1390 | "name": "",
1391 | "nameLocation": "-1:-1:-1",
1392 | "nodeType": "VariableDeclaration",
1393 | "scope": 572,
1394 | "src": "720:4:1",
1395 | "stateVariable": false,
1396 | "storageLocation": "default",
1397 | "typeDescriptions": {
1398 | "typeIdentifier": "t_bool",
1399 | "typeString": "bool"
1400 | },
1401 | "typeName": {
1402 | "id": 569,
1403 | "name": "bool",
1404 | "nodeType": "ElementaryTypeName",
1405 | "src": "720:4:1",
1406 | "typeDescriptions": {
1407 | "typeIdentifier": "t_bool",
1408 | "typeString": "bool"
1409 | }
1410 | },
1411 | "visibility": "internal"
1412 | }
1413 | ],
1414 | "src": "719:6:1"
1415 | },
1416 | "scope": 623,
1417 | "src": "649:77:1",
1418 | "stateMutability": "nonpayable",
1419 | "virtual": false,
1420 | "visibility": "external"
1421 | },
1422 | {
1423 | "documentation": {
1424 | "id": 573,
1425 | "nodeType": "StructuredDocumentation",
1426 | "src": "732:264:1",
1427 | "text": " @dev Returns the remaining number of tokens that `spender` will be\n allowed to spend on behalf of `owner` through {transferFrom}. This is\n zero by default.\n This value changes when {approve} or {transferFrom} are called."
1428 | },
1429 | "functionSelector": "dd62ed3e",
1430 | "id": 582,
1431 | "implemented": false,
1432 | "kind": "function",
1433 | "modifiers": [],
1434 | "name": "allowance",
1435 | "nameLocation": "1010:9:1",
1436 | "nodeType": "FunctionDefinition",
1437 | "parameters": {
1438 | "id": 578,
1439 | "nodeType": "ParameterList",
1440 | "parameters": [
1441 | {
1442 | "constant": false,
1443 | "id": 575,
1444 | "mutability": "mutable",
1445 | "name": "owner",
1446 | "nameLocation": "1028:5:1",
1447 | "nodeType": "VariableDeclaration",
1448 | "scope": 582,
1449 | "src": "1020:13:1",
1450 | "stateVariable": false,
1451 | "storageLocation": "default",
1452 | "typeDescriptions": {
1453 | "typeIdentifier": "t_address",
1454 | "typeString": "address"
1455 | },
1456 | "typeName": {
1457 | "id": 574,
1458 | "name": "address",
1459 | "nodeType": "ElementaryTypeName",
1460 | "src": "1020:7:1",
1461 | "stateMutability": "nonpayable",
1462 | "typeDescriptions": {
1463 | "typeIdentifier": "t_address",
1464 | "typeString": "address"
1465 | }
1466 | },
1467 | "visibility": "internal"
1468 | },
1469 | {
1470 | "constant": false,
1471 | "id": 577,
1472 | "mutability": "mutable",
1473 | "name": "spender",
1474 | "nameLocation": "1043:7:1",
1475 | "nodeType": "VariableDeclaration",
1476 | "scope": 582,
1477 | "src": "1035:15:1",
1478 | "stateVariable": false,
1479 | "storageLocation": "default",
1480 | "typeDescriptions": {
1481 | "typeIdentifier": "t_address",
1482 | "typeString": "address"
1483 | },
1484 | "typeName": {
1485 | "id": 576,
1486 | "name": "address",
1487 | "nodeType": "ElementaryTypeName",
1488 | "src": "1035:7:1",
1489 | "stateMutability": "nonpayable",
1490 | "typeDescriptions": {
1491 | "typeIdentifier": "t_address",
1492 | "typeString": "address"
1493 | }
1494 | },
1495 | "visibility": "internal"
1496 | }
1497 | ],
1498 | "src": "1019:32:1"
1499 | },
1500 | "returnParameters": {
1501 | "id": 581,
1502 | "nodeType": "ParameterList",
1503 | "parameters": [
1504 | {
1505 | "constant": false,
1506 | "id": 580,
1507 | "mutability": "mutable",
1508 | "name": "",
1509 | "nameLocation": "-1:-1:-1",
1510 | "nodeType": "VariableDeclaration",
1511 | "scope": 582,
1512 | "src": "1075:7:1",
1513 | "stateVariable": false,
1514 | "storageLocation": "default",
1515 | "typeDescriptions": {
1516 | "typeIdentifier": "t_uint256",
1517 | "typeString": "uint256"
1518 | },
1519 | "typeName": {
1520 | "id": 579,
1521 | "name": "uint256",
1522 | "nodeType": "ElementaryTypeName",
1523 | "src": "1075:7:1",
1524 | "typeDescriptions": {
1525 | "typeIdentifier": "t_uint256",
1526 | "typeString": "uint256"
1527 | }
1528 | },
1529 | "visibility": "internal"
1530 | }
1531 | ],
1532 | "src": "1074:9:1"
1533 | },
1534 | "scope": 623,
1535 | "src": "1001:83:1",
1536 | "stateMutability": "view",
1537 | "virtual": false,
1538 | "visibility": "external"
1539 | },
1540 | {
1541 | "documentation": {
1542 | "id": 583,
1543 | "nodeType": "StructuredDocumentation",
1544 | "src": "1090:642:1",
1545 | "text": " @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n Returns a boolean value indicating whether the operation succeeded.\n IMPORTANT: Beware that changing an allowance with this method brings the risk\n that someone may use both the old and the new allowance by unfortunate\n transaction ordering. One possible solution to mitigate this race\n condition is to first reduce the spender's allowance to 0 and set the\n desired value afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n Emits an {Approval} event."
1546 | },
1547 | "functionSelector": "095ea7b3",
1548 | "id": 592,
1549 | "implemented": false,
1550 | "kind": "function",
1551 | "modifiers": [],
1552 | "name": "approve",
1553 | "nameLocation": "1746:7:1",
1554 | "nodeType": "FunctionDefinition",
1555 | "parameters": {
1556 | "id": 588,
1557 | "nodeType": "ParameterList",
1558 | "parameters": [
1559 | {
1560 | "constant": false,
1561 | "id": 585,
1562 | "mutability": "mutable",
1563 | "name": "spender",
1564 | "nameLocation": "1762:7:1",
1565 | "nodeType": "VariableDeclaration",
1566 | "scope": 592,
1567 | "src": "1754:15:1",
1568 | "stateVariable": false,
1569 | "storageLocation": "default",
1570 | "typeDescriptions": {
1571 | "typeIdentifier": "t_address",
1572 | "typeString": "address"
1573 | },
1574 | "typeName": {
1575 | "id": 584,
1576 | "name": "address",
1577 | "nodeType": "ElementaryTypeName",
1578 | "src": "1754:7:1",
1579 | "stateMutability": "nonpayable",
1580 | "typeDescriptions": {
1581 | "typeIdentifier": "t_address",
1582 | "typeString": "address"
1583 | }
1584 | },
1585 | "visibility": "internal"
1586 | },
1587 | {
1588 | "constant": false,
1589 | "id": 587,
1590 | "mutability": "mutable",
1591 | "name": "amount",
1592 | "nameLocation": "1779:6:1",
1593 | "nodeType": "VariableDeclaration",
1594 | "scope": 592,
1595 | "src": "1771:14:1",
1596 | "stateVariable": false,
1597 | "storageLocation": "default",
1598 | "typeDescriptions": {
1599 | "typeIdentifier": "t_uint256",
1600 | "typeString": "uint256"
1601 | },
1602 | "typeName": {
1603 | "id": 586,
1604 | "name": "uint256",
1605 | "nodeType": "ElementaryTypeName",
1606 | "src": "1771:7:1",
1607 | "typeDescriptions": {
1608 | "typeIdentifier": "t_uint256",
1609 | "typeString": "uint256"
1610 | }
1611 | },
1612 | "visibility": "internal"
1613 | }
1614 | ],
1615 | "src": "1753:33:1"
1616 | },
1617 | "returnParameters": {
1618 | "id": 591,
1619 | "nodeType": "ParameterList",
1620 | "parameters": [
1621 | {
1622 | "constant": false,
1623 | "id": 590,
1624 | "mutability": "mutable",
1625 | "name": "",
1626 | "nameLocation": "-1:-1:-1",
1627 | "nodeType": "VariableDeclaration",
1628 | "scope": 592,
1629 | "src": "1805:4:1",
1630 | "stateVariable": false,
1631 | "storageLocation": "default",
1632 | "typeDescriptions": {
1633 | "typeIdentifier": "t_bool",
1634 | "typeString": "bool"
1635 | },
1636 | "typeName": {
1637 | "id": 589,
1638 | "name": "bool",
1639 | "nodeType": "ElementaryTypeName",
1640 | "src": "1805:4:1",
1641 | "typeDescriptions": {
1642 | "typeIdentifier": "t_bool",
1643 | "typeString": "bool"
1644 | }
1645 | },
1646 | "visibility": "internal"
1647 | }
1648 | ],
1649 | "src": "1804:6:1"
1650 | },
1651 | "scope": 623,
1652 | "src": "1737:74:1",
1653 | "stateMutability": "nonpayable",
1654 | "virtual": false,
1655 | "visibility": "external"
1656 | },
1657 | {
1658 | "documentation": {
1659 | "id": 593,
1660 | "nodeType": "StructuredDocumentation",
1661 | "src": "1817:296:1",
1662 | "text": " @dev Moves `amount` tokens from `sender` to `recipient` using the\n allowance mechanism. `amount` is then deducted from the caller's\n allowance.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
1663 | },
1664 | "functionSelector": "23b872dd",
1665 | "id": 604,
1666 | "implemented": false,
1667 | "kind": "function",
1668 | "modifiers": [],
1669 | "name": "transferFrom",
1670 | "nameLocation": "2127:12:1",
1671 | "nodeType": "FunctionDefinition",
1672 | "parameters": {
1673 | "id": 600,
1674 | "nodeType": "ParameterList",
1675 | "parameters": [
1676 | {
1677 | "constant": false,
1678 | "id": 595,
1679 | "mutability": "mutable",
1680 | "name": "sender",
1681 | "nameLocation": "2157:6:1",
1682 | "nodeType": "VariableDeclaration",
1683 | "scope": 604,
1684 | "src": "2149:14:1",
1685 | "stateVariable": false,
1686 | "storageLocation": "default",
1687 | "typeDescriptions": {
1688 | "typeIdentifier": "t_address",
1689 | "typeString": "address"
1690 | },
1691 | "typeName": {
1692 | "id": 594,
1693 | "name": "address",
1694 | "nodeType": "ElementaryTypeName",
1695 | "src": "2149:7:1",
1696 | "stateMutability": "nonpayable",
1697 | "typeDescriptions": {
1698 | "typeIdentifier": "t_address",
1699 | "typeString": "address"
1700 | }
1701 | },
1702 | "visibility": "internal"
1703 | },
1704 | {
1705 | "constant": false,
1706 | "id": 597,
1707 | "mutability": "mutable",
1708 | "name": "recipient",
1709 | "nameLocation": "2181:9:1",
1710 | "nodeType": "VariableDeclaration",
1711 | "scope": 604,
1712 | "src": "2173:17:1",
1713 | "stateVariable": false,
1714 | "storageLocation": "default",
1715 | "typeDescriptions": {
1716 | "typeIdentifier": "t_address",
1717 | "typeString": "address"
1718 | },
1719 | "typeName": {
1720 | "id": 596,
1721 | "name": "address",
1722 | "nodeType": "ElementaryTypeName",
1723 | "src": "2173:7:1",
1724 | "stateMutability": "nonpayable",
1725 | "typeDescriptions": {
1726 | "typeIdentifier": "t_address",
1727 | "typeString": "address"
1728 | }
1729 | },
1730 | "visibility": "internal"
1731 | },
1732 | {
1733 | "constant": false,
1734 | "id": 599,
1735 | "mutability": "mutable",
1736 | "name": "amount",
1737 | "nameLocation": "2208:6:1",
1738 | "nodeType": "VariableDeclaration",
1739 | "scope": 604,
1740 | "src": "2200:14:1",
1741 | "stateVariable": false,
1742 | "storageLocation": "default",
1743 | "typeDescriptions": {
1744 | "typeIdentifier": "t_uint256",
1745 | "typeString": "uint256"
1746 | },
1747 | "typeName": {
1748 | "id": 598,
1749 | "name": "uint256",
1750 | "nodeType": "ElementaryTypeName",
1751 | "src": "2200:7:1",
1752 | "typeDescriptions": {
1753 | "typeIdentifier": "t_uint256",
1754 | "typeString": "uint256"
1755 | }
1756 | },
1757 | "visibility": "internal"
1758 | }
1759 | ],
1760 | "src": "2139:81:1"
1761 | },
1762 | "returnParameters": {
1763 | "id": 603,
1764 | "nodeType": "ParameterList",
1765 | "parameters": [
1766 | {
1767 | "constant": false,
1768 | "id": 602,
1769 | "mutability": "mutable",
1770 | "name": "",
1771 | "nameLocation": "-1:-1:-1",
1772 | "nodeType": "VariableDeclaration",
1773 | "scope": 604,
1774 | "src": "2239:4:1",
1775 | "stateVariable": false,
1776 | "storageLocation": "default",
1777 | "typeDescriptions": {
1778 | "typeIdentifier": "t_bool",
1779 | "typeString": "bool"
1780 | },
1781 | "typeName": {
1782 | "id": 601,
1783 | "name": "bool",
1784 | "nodeType": "ElementaryTypeName",
1785 | "src": "2239:4:1",
1786 | "typeDescriptions": {
1787 | "typeIdentifier": "t_bool",
1788 | "typeString": "bool"
1789 | }
1790 | },
1791 | "visibility": "internal"
1792 | }
1793 | ],
1794 | "src": "2238:6:1"
1795 | },
1796 | "scope": 623,
1797 | "src": "2118:127:1",
1798 | "stateMutability": "nonpayable",
1799 | "virtual": false,
1800 | "visibility": "external"
1801 | },
1802 | {
1803 | "anonymous": false,
1804 | "documentation": {
1805 | "id": 605,
1806 | "nodeType": "StructuredDocumentation",
1807 | "src": "2251:158:1",
1808 | "text": " @dev Emitted when `value` tokens are moved from one account (`from`) to\n another (`to`).\n Note that `value` may be zero."
1809 | },
1810 | "id": 613,
1811 | "name": "Transfer",
1812 | "nameLocation": "2420:8:1",
1813 | "nodeType": "EventDefinition",
1814 | "parameters": {
1815 | "id": 612,
1816 | "nodeType": "ParameterList",
1817 | "parameters": [
1818 | {
1819 | "constant": false,
1820 | "id": 607,
1821 | "indexed": true,
1822 | "mutability": "mutable",
1823 | "name": "from",
1824 | "nameLocation": "2445:4:1",
1825 | "nodeType": "VariableDeclaration",
1826 | "scope": 613,
1827 | "src": "2429:20:1",
1828 | "stateVariable": false,
1829 | "storageLocation": "default",
1830 | "typeDescriptions": {
1831 | "typeIdentifier": "t_address",
1832 | "typeString": "address"
1833 | },
1834 | "typeName": {
1835 | "id": 606,
1836 | "name": "address",
1837 | "nodeType": "ElementaryTypeName",
1838 | "src": "2429:7:1",
1839 | "stateMutability": "nonpayable",
1840 | "typeDescriptions": {
1841 | "typeIdentifier": "t_address",
1842 | "typeString": "address"
1843 | }
1844 | },
1845 | "visibility": "internal"
1846 | },
1847 | {
1848 | "constant": false,
1849 | "id": 609,
1850 | "indexed": true,
1851 | "mutability": "mutable",
1852 | "name": "to",
1853 | "nameLocation": "2467:2:1",
1854 | "nodeType": "VariableDeclaration",
1855 | "scope": 613,
1856 | "src": "2451:18:1",
1857 | "stateVariable": false,
1858 | "storageLocation": "default",
1859 | "typeDescriptions": {
1860 | "typeIdentifier": "t_address",
1861 | "typeString": "address"
1862 | },
1863 | "typeName": {
1864 | "id": 608,
1865 | "name": "address",
1866 | "nodeType": "ElementaryTypeName",
1867 | "src": "2451:7:1",
1868 | "stateMutability": "nonpayable",
1869 | "typeDescriptions": {
1870 | "typeIdentifier": "t_address",
1871 | "typeString": "address"
1872 | }
1873 | },
1874 | "visibility": "internal"
1875 | },
1876 | {
1877 | "constant": false,
1878 | "id": 611,
1879 | "indexed": false,
1880 | "mutability": "mutable",
1881 | "name": "value",
1882 | "nameLocation": "2479:5:1",
1883 | "nodeType": "VariableDeclaration",
1884 | "scope": 613,
1885 | "src": "2471:13:1",
1886 | "stateVariable": false,
1887 | "storageLocation": "default",
1888 | "typeDescriptions": {
1889 | "typeIdentifier": "t_uint256",
1890 | "typeString": "uint256"
1891 | },
1892 | "typeName": {
1893 | "id": 610,
1894 | "name": "uint256",
1895 | "nodeType": "ElementaryTypeName",
1896 | "src": "2471:7:1",
1897 | "typeDescriptions": {
1898 | "typeIdentifier": "t_uint256",
1899 | "typeString": "uint256"
1900 | }
1901 | },
1902 | "visibility": "internal"
1903 | }
1904 | ],
1905 | "src": "2428:57:1"
1906 | },
1907 | "src": "2414:72:1"
1908 | },
1909 | {
1910 | "anonymous": false,
1911 | "documentation": {
1912 | "id": 614,
1913 | "nodeType": "StructuredDocumentation",
1914 | "src": "2492:148:1",
1915 | "text": " @dev Emitted when the allowance of a `spender` for an `owner` is set by\n a call to {approve}. `value` is the new allowance."
1916 | },
1917 | "id": 622,
1918 | "name": "Approval",
1919 | "nameLocation": "2651:8:1",
1920 | "nodeType": "EventDefinition",
1921 | "parameters": {
1922 | "id": 621,
1923 | "nodeType": "ParameterList",
1924 | "parameters": [
1925 | {
1926 | "constant": false,
1927 | "id": 616,
1928 | "indexed": true,
1929 | "mutability": "mutable",
1930 | "name": "owner",
1931 | "nameLocation": "2676:5:1",
1932 | "nodeType": "VariableDeclaration",
1933 | "scope": 622,
1934 | "src": "2660:21:1",
1935 | "stateVariable": false,
1936 | "storageLocation": "default",
1937 | "typeDescriptions": {
1938 | "typeIdentifier": "t_address",
1939 | "typeString": "address"
1940 | },
1941 | "typeName": {
1942 | "id": 615,
1943 | "name": "address",
1944 | "nodeType": "ElementaryTypeName",
1945 | "src": "2660:7:1",
1946 | "stateMutability": "nonpayable",
1947 | "typeDescriptions": {
1948 | "typeIdentifier": "t_address",
1949 | "typeString": "address"
1950 | }
1951 | },
1952 | "visibility": "internal"
1953 | },
1954 | {
1955 | "constant": false,
1956 | "id": 618,
1957 | "indexed": true,
1958 | "mutability": "mutable",
1959 | "name": "spender",
1960 | "nameLocation": "2699:7:1",
1961 | "nodeType": "VariableDeclaration",
1962 | "scope": 622,
1963 | "src": "2683:23:1",
1964 | "stateVariable": false,
1965 | "storageLocation": "default",
1966 | "typeDescriptions": {
1967 | "typeIdentifier": "t_address",
1968 | "typeString": "address"
1969 | },
1970 | "typeName": {
1971 | "id": 617,
1972 | "name": "address",
1973 | "nodeType": "ElementaryTypeName",
1974 | "src": "2683:7:1",
1975 | "stateMutability": "nonpayable",
1976 | "typeDescriptions": {
1977 | "typeIdentifier": "t_address",
1978 | "typeString": "address"
1979 | }
1980 | },
1981 | "visibility": "internal"
1982 | },
1983 | {
1984 | "constant": false,
1985 | "id": 620,
1986 | "indexed": false,
1987 | "mutability": "mutable",
1988 | "name": "value",
1989 | "nameLocation": "2716:5:1",
1990 | "nodeType": "VariableDeclaration",
1991 | "scope": 622,
1992 | "src": "2708:13:1",
1993 | "stateVariable": false,
1994 | "storageLocation": "default",
1995 | "typeDescriptions": {
1996 | "typeIdentifier": "t_uint256",
1997 | "typeString": "uint256"
1998 | },
1999 | "typeName": {
2000 | "id": 619,
2001 | "name": "uint256",
2002 | "nodeType": "ElementaryTypeName",
2003 | "src": "2708:7:1",
2004 | "typeDescriptions": {
2005 | "typeIdentifier": "t_uint256",
2006 | "typeString": "uint256"
2007 | }
2008 | },
2009 | "visibility": "internal"
2010 | }
2011 | ],
2012 | "src": "2659:63:1"
2013 | },
2014 | "src": "2645:78:1"
2015 | }
2016 | ],
2017 | "scope": 624,
2018 | "src": "129:2596:1",
2019 | "usedErrors": []
2020 | }
2021 | ],
2022 | "src": "33:2693:1"
2023 | },
2024 | "compiler": {
2025 | "name": "solc",
2026 | "version": "0.8.10+commit.fc410830.Emscripten.clang"
2027 | },
2028 | "networks": {},
2029 | "schemaVersion": "3.4.3",
2030 | "updatedAt": "2021-11-17T16:45:05.082Z",
2031 | "devdoc": {
2032 | "details": "Interface of the ERC20 standard as defined in the EIP.",
2033 | "events": {
2034 | "Approval(address,address,uint256)": {
2035 | "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
2036 | },
2037 | "Transfer(address,address,uint256)": {
2038 | "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
2039 | }
2040 | },
2041 | "kind": "dev",
2042 | "methods": {
2043 | "allowance(address,address)": {
2044 | "details": "Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called."
2045 | },
2046 | "approve(address,uint256)": {
2047 | "details": "Sets `amount` as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event."
2048 | },
2049 | "balanceOf(address)": {
2050 | "details": "Returns the amount of tokens owned by `account`."
2051 | },
2052 | "totalSupply()": {
2053 | "details": "Returns the amount of tokens in existence."
2054 | },
2055 | "transfer(address,uint256)": {
2056 | "details": "Moves `amount` tokens from the caller's account to `recipient`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
2057 | },
2058 | "transferFrom(address,address,uint256)": {
2059 | "details": "Moves `amount` tokens from `sender` to `recipient` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
2060 | }
2061 | },
2062 | "version": 1
2063 | },
2064 | "userdoc": {
2065 | "kind": "user",
2066 | "methods": {},
2067 | "version": 1
2068 | }
2069 | }
--------------------------------------------------------------------------------