diff --git a/.gitignore b/.gitignore index df7fe48..50ce186 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. +# ABI files +/src/contracts + # dependencies /node_modules /.pnp @@ -23,3 +26,5 @@ yarn-debug.log* debug.log* yarn-error.log* package-lock.json + + diff --git a/contracts/truffle-config.js b/contracts/truffle-config.js index 55de901..e5883f5 100644 --- a/contracts/truffle-config.js +++ b/contracts/truffle-config.js @@ -1,30 +1,32 @@ -const path = require("path"); +/* eslint-disable */ +const path = require('path') module.exports = { // See // to customize your Truffle configuration! - contracts_build_directory: path.join(__dirname, "../src/contracts"), + contracts_build_directory: path.join(__dirname, '../src/contracts'), networks: { development: { host: '127.0.0.1', port: 8545, gas: 6721975, // <-- Use this high gas value gasPrice: 1000000000, - network_id: '*' // Match any network id - } + network_id: '*', // Match any network id + }, }, // Configure your compilers compilers: { solc: { - version: "0.6.6", // Fetch exact version from solc-bin (default: truffle's version) + version: '0.6.6', // Fetch exact version from solc-bin (default: truffle's version) docker: false, // Use "0.5.1" you've installed locally with docker (default: false) - settings: { // See the solidity docs for advice about optimization and evmVersion + settings: { + // See the solidity docs for advice about optimization and evmVersion optimizer: { enabled: true, - runs: 200 + runs: 200, }, - evmVersion: 'constantinople' - } - } - } -}; + evmVersion: 'constantinople', + }, + }, + }, +} diff --git a/debug.log b/debug.log index 25e771a..3133e44 100644 --- a/debug.log +++ b/debug.log @@ -13,3 +13,33 @@ [0527/213826.031:ERROR:crash_report_database_win.cc(469)] failed to stat report [0528/151733.993:ERROR:crash_report_database_win.cc(469)] failed to stat report [0528/151734.019:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0529/140617.768:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0529/140617.771:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0601/221346.435:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0601/221346.456:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/164611.913:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/164611.915:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/190943.213:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/190943.215:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/192715.867:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0602/192715.870:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0603/212048.026:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0603/212048.028:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0604/185505.121:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0604/185505.138:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/101632.670:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/101632.672:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/105518.019:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/105518.043:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/114652.318:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0605/114652.321:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0608/071321.652:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0608/071321.678:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0608/185726.898:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0608/185726.920:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0609/092800.632:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0609/092800.634:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0609/094719.262:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0609/094719.264:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0610/122246.990:ERROR:crash_report_database_win.cc(469)] failed to stat report +[0610/122247.014:ERROR:crash_report_database_win.cc(469)] failed to stat report diff --git a/src/App.js b/src/App.js index 4ecffa2..79f7b5e 100644 --- a/src/App.js +++ b/src/App.js @@ -9,32 +9,33 @@ import theme from './theme-court' import MainView from './components/MainView' import ErrorPage from './ErrorPage' -import Dashboard from './components/Dashboard/Dashboard' +import Profile from './components/Profile/Profile' /* eslint-disable prettier/prettier */ import Tasks from './components/Tasks/Tasks' import Sample from './components/Sample/Sample' -import Disputes from './components/Disputes/Disputes' +import Disputes from './components/Dashboard/Dashboard' import { WalletProvider } from './providers/Wallet' import { ActivityProvider } from './components/Activity/ActivityProvider' +// import { TokenContext } from './components/Profile/APIcall' function App() { return ( -
- - {/* */} - - - - - - - - -
+
+ + {/* */} + + + + + + + + +
diff --git a/src/components/Activity/activity-types.js b/src/components/Activity/activity-types.js index 3c972b2..d0d118c 100644 --- a/src/components/Activity/activity-types.js +++ b/src/components/Activity/activity-types.js @@ -1,3 +1,4 @@ +/* eslint-disable */ import iconAnj from './assets/activity-icon-anj.svg' import execute from './assets/activity-icon-execute-ruling.svg' @@ -22,6 +23,15 @@ const ACTIVITY_TYPES = new Map( `, } }, + + newProject({ name, budget }) { + return { + icon: execute, + title: 'Added Project', + description: ` Created Project ${name} , ${budget} + `, + } + }, transaction({ transactionHash }) { return { title: 'Transaction', diff --git a/src/components/Dashboard/APIcall.js b/src/components/Dashboard/APIcall.js deleted file mode 100644 index 2007ecc..0000000 --- a/src/components/Dashboard/APIcall.js +++ /dev/null @@ -1,77 +0,0 @@ -/* eslint-disable */ -import React, { useState, useEffect } from 'react' -import GitHubLogin from 'react-github-login' -import { Button } from '@aragon/ui' -import './test.css' - -function APIcall() { - const [boolButtonText, setBoolButtonText] = useState('CONNECT') - const [boolButtonText_disconnect, setBoolButtonText_disconnect] = useState( - 'DISCONNECT' - ) - - const onSuccess = function(details) { - const code = details.code - - fetch(`https://gitfund-oauth.herokuapp.com/authenticate/${code}`) - .then((response) => response.json()) - .then(({ token }) => localStorage.setItem('ACCESS TOKEN', token)) - - // if (boolButtonText === 'CONNECT') { - // setBoolButtonText('DISCONNECT') - // } else { - // setBoolButtonText('CONNECT') - // } - setBoolButtonText('DISCONNECT') - } - - const onSuccess_disconnect = function() { - localStorage.removeItem('ACCESS TOKEN') - setBoolButtonText_disconnect('CONNECT') - } - - const onFailure_disconnect = function() { - return null - } - - const onFailure = (response) => console.error(response) - - return ( -
- -
- ) -} - -export default APIcall diff --git a/src/components/Dashboard/Connect.js b/src/components/Dashboard/Connect.js deleted file mode 100644 index 6a47364..0000000 --- a/src/components/Dashboard/Connect.js +++ /dev/null @@ -1,43 +0,0 @@ -/* eslint-disable prettier/prettier */ -import React, { useEffect } from 'react' -import { Button } from '@aragon/ui' - -function Connect() { - const CLIENT_ID = '69bc88033c4b1bc2b4dc' - const REDIRECT_URI = 'http://localhost:3000/dashboard' - - useEffect(() => { - const code = - window.location.href.match(/\?code=(.*)/) && - window.location.href.match(/\?code=(.*)/)[1] - console.log(window.location.href) - - console.log(code) - // console.log(screen.id) - - fetch(`https://gitfund-oauth.herokuapp.com/authenticate/${code}`) - .then((response) => response.json()) - .then(({ token }) => { - console.log(token) - console.log(token) - localStorage.setItem('GithubToken', token) - }) - }, []) - - return ( - <> - - {localStorage.getItem('GithubToken') === 'undefined' ? ( - + ) : ( + + + {(toast) => ( + + )} + + + )} + + + {list.length === 0 ? ( +
+ +
+ ) : ( + <> + i.name)]} + ref={inputDropdown} + style={{ + marginTop: '4rem', + }} + /> + {console.log(selected)} + + + + + )} +
+ + ) +} + +export default Import diff --git a/src/components/Dashboard/ImportNew.js b/src/components/Dashboard/ImportNew.js deleted file mode 100644 index c393fad..0000000 --- a/src/components/Dashboard/ImportNew.js +++ /dev/null @@ -1,41 +0,0 @@ -/* eslint-disable prettier/prettier */ -import React from 'react' -const CLIENT_ID = '69bc88033c4b1bc2b4dc' -const REDIRECT_URI = 'http://localhost:3000/' - -class ImportNew extends React.Component { - state = { - token: null, - } - - componentDidMount() { - const code = - // window.location.href.match(/?code=(.*)/) && - // window.location.href.match(/?code=(.*)/)[1] - window.location.href.match(/(.*)/) - console.log(code) - - if (code) { - fetch(`https://gitfund-oauth.herokuapp.com/authenticate/${code}`) - .then((response) => response.json()) - .then(({ token }) => { - this.setState({ - token: token, - }) - }) - } - } - - render() { - return ( -
- - - -
- ) - } -} -export default ImportNew diff --git a/src/components/Dashboard/test.css b/src/components/Dashboard/test.css deleted file mode 100644 index 4b08b4c..0000000 --- a/src/components/Dashboard/test.css +++ /dev/null @@ -1,3 +0,0 @@ -.testcss { - all: unset; -} diff --git a/src/components/Dashboard/useFetchProject.js b/src/components/Dashboard/useFetchProject.js new file mode 100644 index 0000000..f215cba --- /dev/null +++ b/src/components/Dashboard/useFetchProject.js @@ -0,0 +1,34 @@ +/* eslint-disable */ +import { useEffect, useState, useCallback } from 'react' +import { useContract } from '../web3-contracts' + +import { useActivity } from '../components/Activity/ActivityProvider' + +import GitFundedGrantFactory from '../contracts/GitFundedGrantFactory.json' + +const GAS_LIMIT = 3000000 + +// Project creation contract +function useProjectFetchContract() { + return useContract( + GitFundedGrantFactory.networks['10'].address, + GitFundedGrantFactory.abi + ) +} + +export function useProjectAddActions() { + const { addActivity } = useActivity() + const projectFetchContract = useProjectFetchContract() + + const fetch = useCallback( + (id, name, budget) => { + return addActivity( + projectFetchContract.fetchProject(id, name, budget), + 'fetchProject', + { id: id, name: name, budget: budget } + ) + }, + [addActivity, projectFetchContract] + ) + return { fetch } +} diff --git a/src/components/Disputes/Disputes.js b/src/components/Disputes/Disputes.js deleted file mode 100644 index 6edb8fd..0000000 --- a/src/components/Disputes/Disputes.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable prettier/prettier */ - -import React, { useCallback, useMemo, useState } from 'react' -import { Header } from '@aragon/ui' - -import DisputeDetail from './DisputeDetail' -import DisputeList from './DisputeList' - -import { disputes } from '../../mock-data' - -import Import from './Import' - -function Disputes() { - const [selectedDispute, selectDispute] = useSelectedDispute(disputes) - - const handleBack = useCallback(() => { - selectDispute(-1) - }, [selectDispute]) - - return ( - -
- -
-
- {selectedDispute ? ( - - ) : ( - - )} - - ) -} - -const useSelectedDispute = (disputes) => { - const [selectedDisputeId, setSelectedDisputeId] = useState(-1) - - const selectDispute = (disputeId) => setSelectedDisputeId(disputeId) - - const selectedDispute = useMemo( - () => disputes.find((dispute) => dispute.id === selectedDisputeId) || null, - [disputes, selectedDisputeId] - ) - - return [selectedDispute, selectDispute] -} - -export default Disputes diff --git a/src/components/Disputes/GithubRESTAPI.js b/src/components/Disputes/GithubRESTAPI.js deleted file mode 100644 index 77561cb..0000000 --- a/src/components/Disputes/GithubRESTAPI.js +++ /dev/null @@ -1,26 +0,0 @@ -/* eslint-disable prettier/prettier */ -const GIHUB_SERVER = 'https://api.github.com/' - -export default class GitHubRestApi { - constructor(accessToken) { - this.accessTokan = accessToken - } - - fetchRepoDetails(repoId) { - return fetch(GIHUB_SERVER + 'repositories/' + repoId, { - method: 'GET', - headers: { - Authorization: this.accessTokan, - }, - }) - .then((res) => res.json()) - .then(function(response) { - return response - }) - .catch(function(error) { - return { meta: { status: false, message: error } } - }) - } -} - -module.export = GitHubRestApi diff --git a/src/components/Disputes/Import.js b/src/components/Disputes/Import.js deleted file mode 100644 index 5f7637b..0000000 --- a/src/components/Disputes/Import.js +++ /dev/null @@ -1,96 +0,0 @@ -/* eslint-disable */ -import React, { useState, useEffect } from 'react' -import { - SidePanel, - Button, - DropDown, - TextInput, - textStyle, - Main, - GU, -} from '@aragon/ui' -import { Octokit } from '@octokit/rest' -import { useWallet } from 'use-wallet' - -function Import() { - const wallet = useWallet() - - const [USERNAME, SETUSERNAME] = useState(null) - - const [opened, setOpened] = useState(false) - - const [list, setList] = useState([]) - - const TOKEN = localStorage.getItem('ACCESS TOKEN') - - const octokit = new Octokit({ - auth: TOKEN, - }) - - const [publicRepos, setPublicRepos] = useState(0) - async function userInfo() { - const { data } = await octokit.request('/user') - let num = data.public_repos - setPublicRepos(num - 1) - return data - } - async function listUserRepos() { - setOpened(true) - - let repoList = [] - const user = await userInfo() - for (let page = 1; page <= Math.ceil(user.public_repos / 100); page++) { - const { data } = await octokit.repos.listForAuthenticatedUser({ - per_page: 100, - page: page, - }) - let repoIndex = 0 - while (repoIndex < data.length) { - repoList.push(data[repoIndex].name) - repoIndex++ - } - setList([...repoList]) - } - - return repoList - } - - function handleClose() { - setOpened(false) - } - - const [selected, setSelected] = useState(-1) - - function handleOnChange(index, items) { - setSelected(index) - } - - return ( - <> - {wallet.account !== null ? ( - - ) : null} - - - - - - - - - - - - ) -} - -export default Import diff --git a/src/components/Dashboard/Test.js b/src/components/Profile/APICallContainer.js similarity index 68% rename from src/components/Dashboard/Test.js rename to src/components/Profile/APICallContainer.js index f8f807d..5c7457e 100644 --- a/src/components/Dashboard/Test.js +++ b/src/components/Profile/APICallContainer.js @@ -2,7 +2,7 @@ import React from 'react' import APIcall from './APIcall' -function Test() { +function APICallContainer() { return (
@@ -10,4 +10,4 @@ function Test() { ) } -export default Test +export default APICallContainer diff --git a/src/components/Profile/APIcall.js b/src/components/Profile/APIcall.js new file mode 100644 index 0000000..fbb7354 --- /dev/null +++ b/src/components/Profile/APIcall.js @@ -0,0 +1,143 @@ +/* eslint-disable */ +import React, { useState, useEffect } from 'react' +import GitHubLogin from 'react-github-login' +import { Button, Split, Box, DataView, textStyle, theme } from '@aragon/ui' +import './buttonCustomStyle.css' +import { Octokit } from '@octokit/rest' + +const octokit = new Octokit({ + auth: localStorage.getItem('ACCESS TOKEN'), +}) + +function APIcall() { + const [boolButtonText, setBoolButtonText] = useState('CONNECT') + const [boolButtonText_disconnect, setBoolButtonText_disconnect] = useState( + 'DISCONNECT' + ) + + const onSuccess = function(details) { + const code = details.code + + fetch(`https://gitfund-oauth.herokuapp.com/authenticate/${code}`) + .then((response) => response.json()) + .then(({ token }) => localStorage.setItem('ACCESS TOKEN', token)) + + setBoolButtonText('DISCONNECT') + } + + const onSuccess_disconnect = function() { + localStorage.removeItem('ACCESS TOKEN') + setBoolButtonText_disconnect('CONNECT') + } + + const onFailure_disconnect = function() { + return null + } + + const onFailure = (response) => console.error(response) + + let TokenSave = localStorage.getItem('ACCESS TOKEN') + + ///// USER INFO + + const [name, setName] = useState(null) + const [company, setCompany] = useState(null) + const [repos, setRepos] = useState(null) + const [followers, setFollowers] = useState(null) + const [following, setFollowing] = useState(null) + + async function a() { + const { data } = await octokit.request('/user') + console.log({ data }) + setName(data.name) + setCompany(data.company) + setRepos(data.public_repos) + setFollowers(data.followers) + setFollowing(data.following) + } + a() + + ///// + + return ( + <> +
+ +
+ + {localStorage.getItem('ACCESS TOKEN') ? ( + +
+ +
+ {name} +
+
+ +
+ {company} +
+
+ +
+ {followers} +
+
+ +
+ {following} +
+
+ +
+ {repos} +
+
+
+
+ ) : null} + + ) +} + +export default APIcall diff --git a/src/components/Dashboard/Balance.js b/src/components/Profile/Balance.js similarity index 100% rename from src/components/Dashboard/Balance.js rename to src/components/Profile/Balance.js diff --git a/src/components/Dashboard/Balances.js b/src/components/Profile/Balances.js similarity index 100% rename from src/components/Dashboard/Balances.js rename to src/components/Profile/Balances.js diff --git a/src/components/Dashboard/CourtStats.js b/src/components/Profile/CourtStats.js similarity index 100% rename from src/components/Dashboard/CourtStats.js rename to src/components/Profile/CourtStats.js diff --git a/src/components/Dashboard/DashboardStats.js b/src/components/Profile/DashboardStats.js similarity index 100% rename from src/components/Dashboard/DashboardStats.js rename to src/components/Profile/DashboardStats.js diff --git a/src/components/Dashboard/LatestActivity.js b/src/components/Profile/LatestActivity.js similarity index 100% rename from src/components/Dashboard/LatestActivity.js rename to src/components/Profile/LatestActivity.js diff --git a/src/components/Profile/Profile.js b/src/components/Profile/Profile.js new file mode 100644 index 0000000..498ec05 --- /dev/null +++ b/src/components/Profile/Profile.js @@ -0,0 +1,17 @@ +/* eslint-disable prettier/prettier */ +import React from 'react' +import { Header, Split } from '@aragon/ui' +import ProfileHeader from './ProfileHeader' +import DashboardStats from './DashboardStats' + +function Profile() { + return ( + +
+ + } /> + + ) +} + +export default Profile diff --git a/src/components/Dashboard/ProfileHeader.js b/src/components/Profile/ProfileHeader.js similarity index 94% rename from src/components/Dashboard/ProfileHeader.js rename to src/components/Profile/ProfileHeader.js index 1733711..7261ca1 100644 --- a/src/components/Dashboard/ProfileHeader.js +++ b/src/components/Profile/ProfileHeader.js @@ -1,6 +1,6 @@ /* eslint-disable prettier/prettier */ import React from 'react' -import Test from './Test' +import APICallContainer from './APICallContainer' import { Box, GU, textStyle, EthIdenticon } from '@aragon/ui' import { useWallet } from 'use-wallet' @@ -41,7 +41,7 @@ export default function ProfileHeader({ active }) { soften={0} />
- + ) : (
diff --git a/src/components/Dashboard/TaskTable.js b/src/components/Profile/TaskTable.js similarity index 100% rename from src/components/Dashboard/TaskTable.js rename to src/components/Profile/TaskTable.js diff --git a/src/components/Profile/buttonCustomStyle.css b/src/components/Profile/buttonCustomStyle.css new file mode 100644 index 0000000..46c7bf5 --- /dev/null +++ b/src/components/Profile/buttonCustomStyle.css @@ -0,0 +1,3 @@ +.buttonCustomStyle { + all: unset; +} diff --git a/src/contracts/Counter.json b/src/contracts/Counter.json deleted file mode 100644 index 9578e17..0000000 --- a/src/contracts/Counter.json +++ /dev/null @@ -1,1882 +0,0 @@ -{ - "contractName": "Counter", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "num", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "getCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "increaseCounter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "decreaseCounter", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"num\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"decreaseCounter\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseCounter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Counter.sol\":\"Counter\"},\"evmVersion\":\"constantinople\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Counter.sol\":{\"keccak256\":\"0x183f19ba1d71af9183380f7c9e342fe5da276722916fc3e6c5f0b9217db08e7f\",\"urls\":[\"bzz-raw://9f1a975137b5c988b02ac489bf8c04f3e4e9fe6db25503f4dce45e6a5b19fbd3\",\"dweb:/ipfs/Qmck5NzBHj4KSs6frUvkZ4e2LycYGV6Ttbe85DWTk12baD\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b506040516101ef3803806101ef8339818101604052602081101561003357600080fd5b5051600180546001600160a01b03191633179055600055610196806100596000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80638ada066e146100515780638da5cb5b1461006b5780639e80c0741461008f578063b24f03af146100ae575b600080fd5b6100596100df565b60408051918252519081900360200190f35b6100736100e5565b604080516001600160a01b039092168252519081900360200190f35b6100ac600480360360208110156100a557600080fd5b50356100f4565b005b6100cb600480360360208110156100c457600080fd5b50356100ff565b604080519115158252519081900360200190f35b60005490565b6001546001600160a01b031690565b600080549091019055565b60008160005411610150576040805162461bcd60e51b8152602060048201526016602482015275043616e6e6f74206265206c6f776572207468616e20360541b604482015290519081900360640190fd5b506000805491909103905560019056fea2646970667358221220e19238205ef93431cc51b5d02829768d3b3ab690bcc47e540289af71b7b3838664736f6c63430006060033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80638ada066e146100515780638da5cb5b1461006b5780639e80c0741461008f578063b24f03af146100ae575b600080fd5b6100596100df565b60408051918252519081900360200190f35b6100736100e5565b604080516001600160a01b039092168252519081900360200190f35b6100ac600480360360208110156100a557600080fd5b50356100f4565b005b6100cb600480360360208110156100c457600080fd5b50356100ff565b604080519115158252519081900360200190f35b60005490565b6001546001600160a01b031690565b600080549091019055565b60008160005411610150576040805162461bcd60e51b8152602060048201526016602482015275043616e6e6f74206265206c6f776572207468616e20360541b604482015290519081900360640190fd5b506000805491909103905560019056fea2646970667358221220e19238205ef93431cc51b5d02829768d3b3ab690bcc47e540289af71b7b3838664736f6c63430006060033", - "sourceMap": "36:790:0:-:0;;;161:80;5:9:-1;2:2;;;27:1;24;17:12;2:2;161:80:0;;;;;;;;;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;161:80:0;198:6;:19;;-1:-1:-1;;;;;;198:19:0;207:10;198:19;;;:6;224:11;36:790;;;;;;", - "deployedSourceMap": "36:790:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;36:790:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;341:74:0;;;:::i;:::-;;;;;;;;;;;;;;;;249:73;;;:::i;:::-;;;;-1:-1:-1;;;;;249:73:0;;;;;;;;;;;;;;452:83;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;452:83:0;;:::i;:::-;;649:172;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;649:172:0;;:::i;:::-;;;;;;;;;;;;;;;;;;341:74;384:4;404:5;341:74;:::o;249:73::-;310:6;;-1:-1:-1;;;;;310:6:0;249:73;:::o;452:83::-;515:5;;;:14;;;507:22;;452:83::o;649:172::-;706:4;735:6;727:5;;:14;719:49;;;;;-1:-1:-1;;;719:49:0;;;;;;;;;;;;-1:-1:-1;;;719:49:0;;;;;;;;;;;;;;;-1:-1:-1;783:5:0;;;:14;;;;775:22;;-1:-1:-1;;649:172:0:o", - "source": "pragma solidity >=0.5.0<= 0.7.0;\r\n\r\ncontract Counter {\r\n //it keeps a count to demonstrate stage changes\r\n uint private count;\r\n address private _owner;\r\n\r\n constructor(uint num) public {\r\n _owner = msg.sender;\r\n count = num;\r\n }\r\n\r\n\r\n function owner() public view returns (address) {\r\n return _owner;\r\n }\r\n\r\n // getter\r\n function getCounter() public view returns (uint) {\r\n return count;\r\n }\r\n\r\n //and it can add to a count\r\n function increaseCounter(uint256 amount) public {\r\n count = count + amount;\r\n }\r\n\r\n //We'll upgrade the contract with this function after deploying it\r\n //Function to decrease the counter\r\n function decreaseCounter(uint256 amount) public returns (bool) {\r\n require(count > amount, \"Cannot be lower than 0\");\r\n count = count - amount;\r\n return true;\r\n }\r\n\r\n}\r\n", - "sourcePath": "C:\\Users\\abhinavanshul\\dapp-boilerplate\\contracts\\contracts\\Counter.sol", - "ast": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Counter.sol", - "exportedSymbols": { - "Counter": [ - 72 - ] - }, - "id": 73, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - ">=", - "0.5", - ".0", - "<=", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:0" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 72, - "linearizedBaseContracts": [ - 72 - ], - "name": "Counter", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3, - "mutability": "mutable", - "name": "count", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 72, - "src": "109:18:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "109:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "private" - }, - { - "constant": false, - "id": 5, - "mutability": "mutable", - "name": "_owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 72, - "src": "132:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "132:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 19, - "nodeType": "Block", - "src": "191:50:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 10, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "198:6:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 11, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "207:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 12, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "207:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "198:19:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 14, - "nodeType": "ExpressionStatement", - "src": "198:19:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 15, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "224:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 16, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "232:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "224:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 18, - "nodeType": "ExpressionStatement", - "src": "224:11:0" - } - ] - }, - "documentation": null, - "id": 20, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "num", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 20, - "src": "173:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "173:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "172:10:0" - }, - "returnParameters": { - "id": 9, - "nodeType": "ParameterList", - "parameters": [], - "src": "191:0:0" - }, - "scope": 72, - "src": "161:80:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 27, - "nodeType": "Block", - "src": "296:26:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 25, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "310:6:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 24, - "id": 26, - "nodeType": "Return", - "src": "303:13:0" - } - ] - }, - "documentation": null, - "functionSelector": "8da5cb5b", - "id": 28, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "owner", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 21, - "nodeType": "ParameterList", - "parameters": [], - "src": "263:2:0" - }, - "returnParameters": { - "id": 24, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 28, - "src": "287:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 22, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "287:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "286:9:0" - }, - "scope": 72, - "src": "249:73:0", - "stateMutability": "view", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 35, - "nodeType": "Block", - "src": "390:25:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 33, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "404:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 32, - "id": 34, - "nodeType": "Return", - "src": "397:12:0" - } - ] - }, - "documentation": null, - "functionSelector": "8ada066e", - "id": 36, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 29, - "nodeType": "ParameterList", - "parameters": [], - "src": "360:2:0" - }, - "returnParameters": { - "id": 32, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 31, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 36, - "src": "384:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 30, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "383:6:0" - }, - "scope": 72, - "src": "341:74:0", - "stateMutability": "view", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 47, - "nodeType": "Block", - "src": "500:35:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 45, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 41, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "507:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 44, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 42, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "515:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 43, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 38, - "src": "523:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "515:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "507:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 46, - "nodeType": "ExpressionStatement", - "src": "507:22:0" - } - ] - }, - "documentation": null, - "functionSelector": "9e80c074", - "id": 48, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "increaseCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 39, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 38, - "mutability": "mutable", - "name": "amount", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 48, - "src": "477:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 37, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "477:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "476:16:0" - }, - "returnParameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [], - "src": "500:0:0" - }, - "scope": 72, - "src": "452:83:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 70, - "nodeType": "Block", - "src": "712:109:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 58, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 56, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "727:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 57, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "735:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f74206265206c6f776572207468616e2030", - "id": 59, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "743:24:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c8f849796a0a26d16cb57d2ae5436c13edea26364a66a248a9ae920af9dfae3e", - "typeString": "literal_string \"Cannot be lower than 0\"" - }, - "value": "Cannot be lower than 0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c8f849796a0a26d16cb57d2ae5436c13edea26364a66a248a9ae920af9dfae3e", - "typeString": "literal_string \"Cannot be lower than 0\"" - } - ], - "id": 55, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "719:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "719:49:0", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 61, - "nodeType": "ExpressionStatement", - "src": "719:49:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 66, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 62, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "775:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 65, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 63, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "783:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 64, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "791:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "783:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "775:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 67, - "nodeType": "ExpressionStatement", - "src": "775:22:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 54, - "id": 69, - "nodeType": "Return", - "src": "804:11:0" - } - ] - }, - "documentation": null, - "functionSelector": "b24f03af", - "id": 71, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decreaseCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 51, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 50, - "mutability": "mutable", - "name": "amount", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 71, - "src": "674:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 49, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "674:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "673:16:0" - }, - "returnParameters": { - "id": 54, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 53, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 71, - "src": "706:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 52, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "706:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "705:6:0" - }, - "scope": 72, - "src": "649:172:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 73, - "src": "36:790:0" - } - ], - "src": "0:828:0" - }, - "legacyAST": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Counter.sol", - "exportedSymbols": { - "Counter": [ - 72 - ] - }, - "id": 73, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - ">=", - "0.5", - ".0", - "<=", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:0" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 72, - "linearizedBaseContracts": [ - 72 - ], - "name": "Counter", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 3, - "mutability": "mutable", - "name": "count", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 72, - "src": "109:18:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 2, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "109:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "private" - }, - { - "constant": false, - "id": 5, - "mutability": "mutable", - "name": "_owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 72, - "src": "132:22:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 4, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "132:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "private" - }, - { - "body": { - "id": 19, - "nodeType": "Block", - "src": "191:50:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 13, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 10, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "198:6:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 11, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "207:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 12, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "207:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "198:19:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 14, - "nodeType": "ExpressionStatement", - "src": "198:19:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 17, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 15, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "224:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 16, - "name": "num", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 7, - "src": "232:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "224:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 18, - "nodeType": "ExpressionStatement", - "src": "224:11:0" - } - ] - }, - "documentation": null, - "id": 20, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 8, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 7, - "mutability": "mutable", - "name": "num", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 20, - "src": "173:8:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 6, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "173:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "172:10:0" - }, - "returnParameters": { - "id": 9, - "nodeType": "ParameterList", - "parameters": [], - "src": "191:0:0" - }, - "scope": 72, - "src": "161:80:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 27, - "nodeType": "Block", - "src": "296:26:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 25, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 5, - "src": "310:6:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 24, - "id": 26, - "nodeType": "Return", - "src": "303:13:0" - } - ] - }, - "documentation": null, - "functionSelector": "8da5cb5b", - "id": 28, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "owner", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 21, - "nodeType": "ParameterList", - "parameters": [], - "src": "263:2:0" - }, - "returnParameters": { - "id": 24, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 23, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 28, - "src": "287:7:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 22, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "287:7:0", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "286:9:0" - }, - "scope": 72, - "src": "249:73:0", - "stateMutability": "view", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 35, - "nodeType": "Block", - "src": "390:25:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 33, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "404:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 32, - "id": 34, - "nodeType": "Return", - "src": "397:12:0" - } - ] - }, - "documentation": null, - "functionSelector": "8ada066e", - "id": 36, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "getCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 29, - "nodeType": "ParameterList", - "parameters": [], - "src": "360:2:0" - }, - "returnParameters": { - "id": 32, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 31, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 36, - "src": "384:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 30, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "383:6:0" - }, - "scope": 72, - "src": "341:74:0", - "stateMutability": "view", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 47, - "nodeType": "Block", - "src": "500:35:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 45, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 41, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "507:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 44, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 42, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "515:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 43, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 38, - "src": "523:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "515:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "507:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 46, - "nodeType": "ExpressionStatement", - "src": "507:22:0" - } - ] - }, - "documentation": null, - "functionSelector": "9e80c074", - "id": 48, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "increaseCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 39, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 38, - "mutability": "mutable", - "name": "amount", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 48, - "src": "477:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 37, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "477:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "476:16:0" - }, - "returnParameters": { - "id": 40, - "nodeType": "ParameterList", - "parameters": [], - "src": "500:0:0" - }, - "scope": 72, - "src": "452:83:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 70, - "nodeType": "Block", - "src": "712:109:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 58, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 56, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "727:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 57, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "735:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "727:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616e6e6f74206265206c6f776572207468616e2030", - "id": 59, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "743:24:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c8f849796a0a26d16cb57d2ae5436c13edea26364a66a248a9ae920af9dfae3e", - "typeString": "literal_string \"Cannot be lower than 0\"" - }, - "value": "Cannot be lower than 0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_c8f849796a0a26d16cb57d2ae5436c13edea26364a66a248a9ae920af9dfae3e", - "typeString": "literal_string \"Cannot be lower than 0\"" - } - ], - "id": 55, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - -18, - -18 - ], - "referencedDeclaration": -18, - "src": "719:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 60, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "719:49:0", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 61, - "nodeType": "ExpressionStatement", - "src": "719:49:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 66, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 62, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "775:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 65, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 63, - "name": "count", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 3, - "src": "783:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "-", - "rightExpression": { - "argumentTypes": null, - "id": 64, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "791:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "783:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "775:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 67, - "nodeType": "ExpressionStatement", - "src": "775:22:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 68, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "811:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 54, - "id": 69, - "nodeType": "Return", - "src": "804:11:0" - } - ] - }, - "documentation": null, - "functionSelector": "b24f03af", - "id": 71, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "decreaseCounter", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 51, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 50, - "mutability": "mutable", - "name": "amount", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 71, - "src": "674:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 49, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "674:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "673:16:0" - }, - "returnParameters": { - "id": 54, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 53, - "mutability": "mutable", - "name": "", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 71, - "src": "706:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 52, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "706:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "705:6:0" - }, - "scope": 72, - "src": "649:172:0", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 73, - "src": "36:790:0" - } - ], - "src": "0:828:0" - }, - "compiler": { - "name": "solc", - "version": "0.6.6+commit.6c089d02.Emscripten.clang" - }, - "networks": { - "10": { - "events": {}, - "links": {}, - "address": "0x4d2dF7C984A72b3F0EB133C9FEf6D45d46280EC2", - "transactionHash": "0xa4f53811a6308cf01398b7d1936a470d6f822d266b68b2289bf7cc684afe8f4c" - } - }, - "schemaVersion": "3.0.23", - "updatedAt": "2020-05-05T07:55:37.617Z", - "networkType": "ethereum", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/contracts/Migrations.json b/src/contracts/Migrations.json deleted file mode 100644 index f6be758..0000000 --- a/src/contracts/Migrations.json +++ /dev/null @@ -1,929 +0,0 @@ -{ - "contractName": "Migrations", - "abi": [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "last_completed_migration", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "completed", - "type": "uint256" - } - ], - "name": "setCompleted", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"last_completed_migration\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"completed\",\"type\":\"uint256\"}],\"name\":\"setCompleted\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Migrations.sol\":\"Migrations\"},\"evmVersion\":\"constantinople\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Migrations.sol\":{\"keccak256\":\"0x56b40ac19ce4213579d657b19c01ebfe5e9bea11a8e4fb2f793372dadbd30fd8\",\"urls\":[\"bzz-raw://bb76098d6ddec49292f3e278fde7a78b1ae9a7601a75e16ed594d672bf5916af\",\"dweb:/ipfs/QmaYAWxrLBBBBBcNwNG1duYnqzYvH1UdRrwMhWm5ZispEZ\"]}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50600080546001600160a01b0319163317905560fd806100316000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c8063445df0ac1460415780638da5cb5b146059578063fdacd57614607b575b600080fd5b60476097565b60408051918252519081900360200190f35b605f609d565b604080516001600160a01b039092168252519081900360200190f35b609560048036036020811015608f57600080fd5b503560ac565b005b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141560c45760018190555b5056fea2646970667358221220a0ad4756eebddde3e218ce8607139f6996a6fcf015bdadb95df7e165d2948f5f64736f6c63430006060033", - "deployedBytecode": "0x6080604052348015600f57600080fd5b5060043610603c5760003560e01c8063445df0ac1460415780638da5cb5b146059578063fdacd57614607b575b600080fd5b60476097565b60408051918252519081900360200190f35b605f609d565b604080516001600160a01b039092168252519081900360200190f35b609560048036036020811015608f57600080fd5b503560ac565b005b60015481565b6000546001600160a01b031681565b6000546001600160a01b031633141560c45760018190555b5056fea2646970667358221220a0ad4756eebddde3e218ce8607139f6996a6fcf015bdadb95df7e165d2948f5f64736f6c63430006060033", - "sourceMap": "36:326:1:-:0;;;129:52;5:9:-1;2:2;;;27:1;24;17:12;2:2;-1:-1;157:5:1;:18;;-1:-1:-1;;;;;;157:18:1;165:10;157:18;;;36:326;;;;;;", - "deployedSourceMap": "36:326:1:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;36:326:1;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;86:36:1;;;:::i;:::-;;;;;;;;;;;;;;;;61:20;;;:::i;:::-;;;;-1:-1:-1;;;;;61:20:1;;;;;;;;;;;;;;254:105;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;254:105:1;;:::i;:::-;;86:36;;;;:::o;61:20::-;;;-1:-1:-1;;;;;61:20:1;;:::o;254:105::-;234:5;;-1:-1:-1;;;;;234:5:1;220:10;:19;216:26;;;317:24:::1;:36:::0;;;216:26;254:105;:::o", - "source": "pragma solidity >=0.4.21 <0.7.0;\r\n\r\ncontract Migrations {\r\n address public owner;\r\n uint public last_completed_migration;\r\n\r\n constructor() public {\r\n owner = msg.sender;\r\n }\r\n\r\n modifier restricted() {\r\n if (msg.sender == owner) _;\r\n }\r\n\r\n function setCompleted(uint completed) public restricted {\r\n last_completed_migration = completed;\r\n }\r\n}\r\n", - "sourcePath": "C:\\Users\\abhinavanshul\\dapp-boilerplate\\contracts\\contracts\\Migrations.sol", - "ast": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 109 - ] - }, - "id": 110, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 74, - "literals": [ - "solidity", - ">=", - "0.4", - ".21", - "<", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:1" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 109, - "linearizedBaseContracts": [ - 109 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "functionSelector": "8da5cb5b", - "id": 76, - "mutability": "mutable", - "name": "owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 109, - "src": "61:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 75, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "61:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "445df0ac", - "id": 78, - "mutability": "mutable", - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 109, - "src": "86:36:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 77, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "86:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 86, - "nodeType": "Block", - "src": "150:31:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 84, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 81, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "157:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 82, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "165:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "165:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "157:18:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 85, - "nodeType": "ExpressionStatement", - "src": "157:18:1" - } - ] - }, - "documentation": null, - "id": 87, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 79, - "nodeType": "ParameterList", - "parameters": [], - "src": "140:2:1" - }, - "returnParameters": { - "id": 80, - "nodeType": "ParameterList", - "parameters": [], - "src": "150:0:1" - }, - "scope": 109, - "src": "129:52:1", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 95, - "nodeType": "Block", - "src": "209:39:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 92, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 89, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "220:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "220:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 91, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "234:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "220:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 94, - "nodeType": "IfStatement", - "src": "216:26:1", - "trueBody": { - "id": 93, - "nodeType": "PlaceholderStatement", - "src": "241:1:1" - } - } - ] - }, - "documentation": null, - "id": 96, - "name": "restricted", - "nodeType": "ModifierDefinition", - "overrides": null, - "parameters": { - "id": 88, - "nodeType": "ParameterList", - "parameters": [], - "src": "206:2:1" - }, - "src": "187:61:1", - "virtual": false, - "visibility": "internal" - }, - { - "body": { - "id": 107, - "nodeType": "Block", - "src": "310:49:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 78, - "src": "317:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 104, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "344:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 106, - "nodeType": "ExpressionStatement", - "src": "317:36:1" - } - ] - }, - "documentation": null, - "functionSelector": "fdacd576", - "id": 108, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 101, - "modifierName": { - "argumentTypes": null, - "id": 100, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "299:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "299:10:1" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 99, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 98, - "mutability": "mutable", - "name": "completed", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 108, - "src": "276:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "276:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "275:16:1" - }, - "returnParameters": { - "id": 102, - "nodeType": "ParameterList", - "parameters": [], - "src": "310:0:1" - }, - "scope": 109, - "src": "254:105:1", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 110, - "src": "36:326:1" - } - ], - "src": "0:364:1" - }, - "legacyAST": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/Migrations.sol", - "exportedSymbols": { - "Migrations": [ - 109 - ] - }, - "id": 110, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 74, - "literals": [ - "solidity", - ">=", - "0.4", - ".21", - "<", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:1" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 109, - "linearizedBaseContracts": [ - 109 - ], - "name": "Migrations", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "functionSelector": "8da5cb5b", - "id": 76, - "mutability": "mutable", - "name": "owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 109, - "src": "61:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 75, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "61:7:1", - "stateMutability": "nonpayable", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "445df0ac", - "id": 78, - "mutability": "mutable", - "name": "last_completed_migration", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 109, - "src": "86:36:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 77, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "86:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 86, - "nodeType": "Block", - "src": "150:31:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 84, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 81, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "157:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 82, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "165:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 83, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "165:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "src": "157:18:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 85, - "nodeType": "ExpressionStatement", - "src": "157:18:1" - } - ] - }, - "documentation": null, - "id": 87, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 79, - "nodeType": "ParameterList", - "parameters": [], - "src": "140:2:1" - }, - "returnParameters": { - "id": 80, - "nodeType": "ParameterList", - "parameters": [], - "src": "150:0:1" - }, - "scope": 109, - "src": "129:52:1", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 95, - "nodeType": "Block", - "src": "209:39:1", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 92, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 89, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -15, - "src": "220:3:1", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 90, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "220:10:1", - "typeDescriptions": { - "typeIdentifier": "t_address_payable", - "typeString": "address payable" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 91, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 76, - "src": "234:5:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "220:19:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 94, - "nodeType": "IfStatement", - "src": "216:26:1", - "trueBody": { - "id": 93, - "nodeType": "PlaceholderStatement", - "src": "241:1:1" - } - } - ] - }, - "documentation": null, - "id": 96, - "name": "restricted", - "nodeType": "ModifierDefinition", - "overrides": null, - "parameters": { - "id": 88, - "nodeType": "ParameterList", - "parameters": [], - "src": "206:2:1" - }, - "src": "187:61:1", - "virtual": false, - "visibility": "internal" - }, - { - "body": { - "id": 107, - "nodeType": "Block", - "src": "310:49:1", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 103, - "name": "last_completed_migration", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 78, - "src": "317:24:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 104, - "name": "completed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 98, - "src": "344:9:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "317:36:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 106, - "nodeType": "ExpressionStatement", - "src": "317:36:1" - } - ] - }, - "documentation": null, - "functionSelector": "fdacd576", - "id": 108, - "implemented": true, - "kind": "function", - "modifiers": [ - { - "arguments": null, - "id": 101, - "modifierName": { - "argumentTypes": null, - "id": 100, - "name": "restricted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 96, - "src": "299:10:1", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "299:10:1" - } - ], - "name": "setCompleted", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 99, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 98, - "mutability": "mutable", - "name": "completed", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 108, - "src": "276:14:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 97, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "276:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "275:16:1" - }, - "returnParameters": { - "id": 102, - "nodeType": "ParameterList", - "parameters": [], - "src": "310:0:1" - }, - "scope": 109, - "src": "254:105:1", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 110, - "src": "36:326:1" - } - ], - "src": "0:364:1" - }, - "compiler": { - "name": "solc", - "version": "0.6.6+commit.6c089d02.Emscripten.clang" - }, - "networks": { - "10": { - "events": {}, - "links": {}, - "address": "0x627519AeF3d942bB1E190f752ab1707fcD4e5f76", - "transactionHash": "0xc38fd1e38efce5c92d241073b44acf326d39a037bd7a734ec6c74374bd62f54f" - } - }, - "schemaVersion": "3.0.23", - "updatedAt": "2020-05-05T07:55:37.624Z", - "networkType": "ethereum", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/contracts/TodoList.json b/src/contracts/TodoList.json deleted file mode 100644 index 9387e28..0000000 --- a/src/contracts/TodoList.json +++ /dev/null @@ -1,2027 +0,0 @@ -{ - "contractName": "TodoList", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "_owner", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [], - "name": "taskCounter", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "tasks", - "outputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "string", - "name": "content", - "type": "string" - }, - { - "internalType": "bool", - "name": "completed", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function", - "constant": true - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_content", - "type": "string" - } - ], - "name": "createTask", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_index", - "type": "uint256" - } - ], - "name": "toggleTask", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "metadata": "{\"compiler\":{\"version\":\"0.6.6+commit.6c089d02\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_owner\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_content\",\"type\":\"string\"}],\"name\":\"createTask\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"taskCounter\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tasks\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"content\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"completed\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"toggleTask\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/TodoList.sol\":\"TodoList\"},\"evmVersion\":\"constantinople\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/TodoList.sol\":{\"keccak256\":\"0xb487141a762bdc512c71937a6cbc51fbe447b9b72ba30e99e1c5eb29a9a98fa6\",\"urls\":[\"bzz-raw://fe72f7dc0296f049d5241709e8e93d570ba5e2c28f44a9ce9020d33b218d675b\",\"dweb:/ipfs/QmXEeSGi8zWNyad7QrcjqKs4WXugKLwnStKun7Vusbmtym\"]}},\"version\":1}", - "bytecode": "0x6080604052600060015534801561001557600080fd5b506040516107033803806107038339818101604052602081101561003857600080fd5b810190808051604051939291908464010000000082111561005857600080fd5b90830190602082018581111561006d57600080fd5b825164010000000081118282018810171561008757600080fd5b82525081516020918201929091019080838360005b838110156100b457818101518382015260200161009c565b50505050905090810190601f1680156100e15780820380516001836020036101000a031916815260200191505b50604052505081516100fb91506000906020840190610102565b505061019d565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061014357805160ff1916838001178555610170565b82800160010185558215610170579182015b82811115610170578251825591602001919060010190610155565b5061017c929150610180565b5090565b61019a91905b8082111561017c5760008155600101610186565b90565b610557806101ac6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063111002aa1461005c5780635867173014610104578063613137a41461011e5780638d9776721461013b5780638da5cb5b146101e9575b600080fd5b6101026004803603602081101561007257600080fd5b81019060208101813564010000000081111561008d57600080fd5b82018360208201111561009f57600080fd5b803590602001918460018302840111640100000000831117156100c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610266945050505050565b005b61010c6102ef565b60408051918252519081900360200190f35b6101026004803603602081101561013457600080fd5b50356102f5565b6101586004803603602081101561015157600080fd5b5035610319565b604051808581526020018060200184151515158152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156101ab578181015183820152602001610193565b50505050905090810190601f1680156101d85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b6101f16103ce565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022b578181015183820152602001610213565b50505050905090810190601f1680156102585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600180548101905561027661045c565b50604080516080810182526001805480835260208084018681526000858701819052426060870152928352600282529490912083518155935180519394859490936102c693908501920190610486565b50604082015160028201805460ff19169115159190911790556060909101516003909101555050565b60015481565b600090815260026020819052604090912001805460ff19811660ff90911615179055565b60026020818152600092835260409283902080546001808301805487519281161561010002600019011695909504601f81018590048502820185019096528581529094919390929091908301828280156103b45780601f10610389576101008083540402835291602001916103b4565b820191906000526020600020905b81548152906001019060200180831161039757829003601f168201915b505050506002830154600390930154919260ff1691905084565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104545780601f1061042957610100808354040283529160200191610454565b820191906000526020600020905b81548152906001019060200180831161043757829003601f168201915b505050505081565b60405180608001604052806000815260200160608152602001600015158152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104c757805160ff19168380011785556104f4565b828001600101855582156104f4579182015b828111156104f45782518255916020019190600101906104d9565b50610500929150610504565b5090565b61051e91905b80821115610500576000815560010161050a565b9056fea2646970667358221220eccd5360b4ca26c4cdeb75743e95c1aec5aa0ed7504e568872bf74c6e3f2b62664736f6c63430006060033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063111002aa1461005c5780635867173014610104578063613137a41461011e5780638d9776721461013b5780638da5cb5b146101e9575b600080fd5b6101026004803603602081101561007257600080fd5b81019060208101813564010000000081111561008d57600080fd5b82018360208201111561009f57600080fd5b803590602001918460018302840111640100000000831117156100c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610266945050505050565b005b61010c6102ef565b60408051918252519081900360200190f35b6101026004803603602081101561013457600080fd5b50356102f5565b6101586004803603602081101561015157600080fd5b5035610319565b604051808581526020018060200184151515158152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156101ab578181015183820152602001610193565b50505050905090810190601f1680156101d85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b6101f16103ce565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022b578181015183820152602001610213565b50505050905090810190601f1680156102585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b600180548101905561027661045c565b50604080516080810182526001805480835260208084018681526000858701819052426060870152928352600282529490912083518155935180519394859490936102c693908501920190610486565b50604082015160028201805460ff19169115159190911790556060909101516003909101555050565b60015481565b600090815260026020819052604090912001805460ff19811660ff90911615179055565b60026020818152600092835260409283902080546001808301805487519281161561010002600019011695909504601f81018590048502820185019096528581529094919390929091908301828280156103b45780601f10610389576101008083540402835291602001916103b4565b820191906000526020600020905b81548152906001019060200180831161039757829003601f168201915b505050506002830154600390930154919260ff1691905084565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104545780601f1061042957610100808354040283529160200191610454565b820191906000526020600020905b81548152906001019060200180831161043757829003601f168201915b505050505081565b60405180608001604052806000815260200160608152602001600015158152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106104c757805160ff19168380011785556104f4565b828001600101855582156104f4579182015b828111156104f45782518255916020019190600101906104d9565b50610500929150610504565b5090565b61051e91905b80821115610500576000815560010161050a565b9056fea2646970667358221220eccd5360b4ca26c4cdeb75743e95c1aec5aa0ed7504e568872bf74c6e3f2b62664736f6c63430006060033", - "sourceMap": "38:624:2:-:0;;;115:1;89:27;;268:70;5:9:-1;2:2;;;27:1;24;17:12;2:2;268:70:2;;;;;;;;;;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;268:70:2;;;;;;;;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;62:21;;;;123:4;114:14;;138:31;;;135:2;;;182:1;179;172:12;135:2;213:10;;261:11;244:29;;285:43;;;282:58;-1:-1;233:115;230:2;;;361:1;358;351:12;230:2;372:25;;-1:-1;268:70:2;;420:4:-1;411:14;;;;268:70:2;;;;;411:14:-1;268:70:2;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;268:70:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;268:70:2;;-1:-1:-1;;318:14:2;;;;-1:-1:-1;318:5:2;;:14;;;;;:::i;:::-;;268:70;38:624;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;38:624:2;;;-1:-1:-1;38:624:2;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "38:624:2:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;38:624:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;346:193:2;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;346:193:2;;;;;;;;27:11:-1;11:28;;8:2;;;52:1;49;42:12;8:2;346:193:2;;41:9:-1;34:4;18:14;14:25;11:40;8:2;;;64:1;61;54:12;8:2;346:193:2;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;346:193:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;81:16;;74:27;;;;-1:-1;346:193:2;;-1:-1:-1;346:193:2;;-1:-1:-1;;;;;346:193:2:i;:::-;;89:27;;;:::i;:::-;;;;;;;;;;;;;;;;545:108;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;545:108:2;;:::i;227:32::-;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;-1:-1;227:32:2;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;227:32:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;63:19;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:100:-1;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;63:19:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;346:193;406:11;:14;;;;;;427:16;;:::i;:::-;-1:-1:-1;446:51:2;;;;;;;;451:11;;;446:51;;;;;;;;;;-1:-1:-1;446:51:2;;;;;;481:15;446:51;;;;506:18;;;:5;:18;;;;;;:25;;;;;;;;446:51;;;;506:18;;:25;;;;;;;;;:::i;:::-;-1:-1:-1;506:25:2;;;;;;;;;-1:-1:-1;;506:25:2;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;346:193:2:o;89:27::-;;;;:::o;545:108::-;622:13;;;;:5;:13;;;;;;;;:23;;;-1:-1:-1;;594:51:2;;622:23;;;;620:25;594:51;;;545:108::o;227:32::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;227:32:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;227:32:2;;;;;;;;;;;;;;;-1:-1:-1;227:32:2;:::o;63:19::-;;;;;;;;;;;;;;;-1:-1:-1;;63:19:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;38:624::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;38:624:2;;;-1:-1:-1;38:624:2;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity >=0.5.0<= 0.7.0;\r\n\r\n\r\ncontract TodoList {\r\n\r\n string public owner;\r\n\r\n uint public taskCounter = 0;\r\n\r\n struct Task {\r\n uint index;\r\n string content;\r\n bool completed;\r\n uint timestamp;\r\n }\r\n\r\n mapping(uint=>Task) public tasks;\r\n\r\n\r\n constructor(string memory _owner) public {\r\n\r\n owner = _owner;\r\n }\r\n\r\n\r\n function createTask(string memory _content) public {\r\n\r\n taskCounter ++;\r\n Task memory task = Task(taskCounter, _content, false, block.timestamp);\r\n\r\n tasks[taskCounter] = task;\r\n\r\n }\r\n\r\n function toggleTask(uint _index) public {\r\n\r\n tasks[_index].completed = ! tasks[_index].completed;\r\n\r\n }\r\n\r\n\r\n\r\n}\r\n\r\n", - "sourcePath": "C:\\Users\\abhinavanshul\\dapp-boilerplate\\contracts\\contracts\\TodoList.sol", - "ast": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/TodoList.sol", - "exportedSymbols": { - "TodoList": [ - 182 - ] - }, - "id": 183, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 111, - "literals": [ - "solidity", - ">=", - "0.5", - ".0", - "<=", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:2" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 182, - "linearizedBaseContracts": [ - 182 - ], - "name": "TodoList", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "functionSelector": "8da5cb5b", - "id": 113, - "mutability": "mutable", - "name": "owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "63:19:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 112, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "63:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "58671730", - "id": 116, - "mutability": "mutable", - "name": "taskCounter", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "89:27:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 114, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "89:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 115, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "115:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "canonicalName": "TodoList.Task", - "id": 125, - "members": [ - { - "constant": false, - "id": 118, - "mutability": "mutable", - "name": "index", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "142:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "142:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 120, - "mutability": "mutable", - "name": "content", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "159:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 119, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "159:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "completed", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "180:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 121, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "180:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "timestamp", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "201:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "201:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Task", - "nodeType": "StructDefinition", - "scope": 182, - "src": "123:98:2", - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "8d977672", - "id": 129, - "mutability": "mutable", - "name": "tasks", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "227:32:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task)" - }, - "typeName": { - "id": 128, - "keyType": { - "id": 126, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "235:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "227:19:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task)" - }, - "valueType": { - "contractScope": null, - "id": 127, - "name": "Task", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 125, - "src": "241:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage_ptr", - "typeString": "struct TodoList.Task" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 138, - "nodeType": "Block", - "src": "309:29:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "318:5:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 135, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "326:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "318:14:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "318:14:2" - } - ] - }, - "documentation": null, - "id": 139, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "mutability": "mutable", - "name": "_owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 139, - "src": "280:20:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 130, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "280:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "279:22:2" - }, - "returnParameters": { - "id": 133, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:0:2" - }, - "scope": 182, - "src": "268:70:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 163, - "nodeType": "Block", - "src": "397:142:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "406:14:2", - "subExpression": { - "argumentTypes": null, - "id": 144, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "406:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "406:14:2" - }, - { - "assignments": [ - 148 - ], - "declarations": [ - { - "constant": false, - "id": 148, - "mutability": "mutable", - "name": "task", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 163, - "src": "427:16:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task" - }, - "typeName": { - "contractScope": null, - "id": 147, - "name": "Task", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 125, - "src": "427:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage_ptr", - "typeString": "struct TodoList.Task" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 156, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 150, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "451:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 151, - "name": "_content", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "464:8:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 152, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "474:5:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 153, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -4, - "src": "481:5:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "timestamp", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "481:15:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 149, - "name": "Task", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 125, - "src": "446:4:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Task_$125_storage_ptr_$", - "typeString": "type(struct TodoList.Task storage pointer)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "446:51:2", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "427:70:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 157, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "506:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 159, - "indexExpression": { - "argumentTypes": null, - "id": 158, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "512:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "506:18:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 160, - "name": "task", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "527:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task memory" - } - }, - "src": "506:25:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 162, - "nodeType": "ExpressionStatement", - "src": "506:25:2" - } - ] - }, - "documentation": null, - "functionSelector": "111002aa", - "id": 164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "createTask", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 142, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 141, - "mutability": "mutable", - "name": "_content", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 164, - "src": "366:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 140, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "366:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "365:24:2" - }, - "returnParameters": { - "id": 143, - "nodeType": "ParameterList", - "parameters": [], - "src": "397:0:2" - }, - "scope": 182, - "src": "346:193:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 180, - "nodeType": "Block", - "src": "585:68:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 169, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "594:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 171, - "indexExpression": { - "argumentTypes": null, - "id": 170, - "name": "_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 166, - "src": "600:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "594:13:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 172, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "completed", - "nodeType": "MemberAccess", - "referencedDeclaration": 122, - "src": "594:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "620:25:2", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 173, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "622:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 175, - "indexExpression": { - "argumentTypes": null, - "id": 174, - "name": "_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 166, - "src": "628:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "622:13:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 176, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "completed", - "nodeType": "MemberAccess", - "referencedDeclaration": 122, - "src": "622:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "594:51:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 179, - "nodeType": "ExpressionStatement", - "src": "594:51:2" - } - ] - }, - "documentation": null, - "functionSelector": "613137a4", - "id": 181, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toggleTask", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 166, - "mutability": "mutable", - "name": "_index", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 181, - "src": "565:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 165, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "565:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "564:13:2" - }, - "returnParameters": { - "id": 168, - "nodeType": "ParameterList", - "parameters": [], - "src": "585:0:2" - }, - "scope": 182, - "src": "545:108:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 183, - "src": "38:624:2" - } - ], - "src": "0:666:2" - }, - "legacyAST": { - "absolutePath": "/C/Users/abhinavanshul/dapp-boilerplate/contracts/contracts/TodoList.sol", - "exportedSymbols": { - "TodoList": [ - 182 - ] - }, - "id": 183, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 111, - "literals": [ - "solidity", - ">=", - "0.5", - ".0", - "<=", - "0.7", - ".0" - ], - "nodeType": "PragmaDirective", - "src": "0:32:2" - }, - { - "abstract": false, - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 182, - "linearizedBaseContracts": [ - 182 - ], - "name": "TodoList", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "functionSelector": "8da5cb5b", - "id": 113, - "mutability": "mutable", - "name": "owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "63:19:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string" - }, - "typeName": { - "id": 112, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "63:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "58671730", - "id": 116, - "mutability": "mutable", - "name": "taskCounter", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "89:27:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 114, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "89:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": { - "argumentTypes": null, - "hexValue": "30", - "id": 115, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "115:1:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "visibility": "public" - }, - { - "canonicalName": "TodoList.Task", - "id": 125, - "members": [ - { - "constant": false, - "id": 118, - "mutability": "mutable", - "name": "index", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "142:10:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 117, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "142:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 120, - "mutability": "mutable", - "name": "content", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "159:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - }, - "typeName": { - "id": 119, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "159:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 122, - "mutability": "mutable", - "name": "completed", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "180:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 121, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "180:4:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 124, - "mutability": "mutable", - "name": "timestamp", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 125, - "src": "201:14:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 123, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "201:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Task", - "nodeType": "StructDefinition", - "scope": 182, - "src": "123:98:2", - "visibility": "public" - }, - { - "constant": false, - "functionSelector": "8d977672", - "id": 129, - "mutability": "mutable", - "name": "tasks", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 182, - "src": "227:32:2", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task)" - }, - "typeName": { - "id": 128, - "keyType": { - "id": 126, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "235:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Mapping", - "src": "227:19:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task)" - }, - "valueType": { - "contractScope": null, - "id": 127, - "name": "Task", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 125, - "src": "241:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage_ptr", - "typeString": "struct TodoList.Task" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 138, - "nodeType": "Block", - "src": "309:29:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 136, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 134, - "name": "owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 113, - "src": "318:5:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 135, - "name": "_owner", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 131, - "src": "326:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - "src": "318:14:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage", - "typeString": "string storage ref" - } - }, - "id": 137, - "nodeType": "ExpressionStatement", - "src": "318:14:2" - } - ] - }, - "documentation": null, - "id": 139, - "implemented": true, - "kind": "constructor", - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 132, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 131, - "mutability": "mutable", - "name": "_owner", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 139, - "src": "280:20:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 130, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "280:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "279:22:2" - }, - "returnParameters": { - "id": 133, - "nodeType": "ParameterList", - "parameters": [], - "src": "309:0:2" - }, - "scope": 182, - "src": "268:70:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 163, - "nodeType": "Block", - "src": "397:142:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 145, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "406:14:2", - "subExpression": { - "argumentTypes": null, - "id": 144, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "406:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 146, - "nodeType": "ExpressionStatement", - "src": "406:14:2" - }, - { - "assignments": [ - 148 - ], - "declarations": [ - { - "constant": false, - "id": 148, - "mutability": "mutable", - "name": "task", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 163, - "src": "427:16:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task" - }, - "typeName": { - "contractScope": null, - "id": 147, - "name": "Task", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 125, - "src": "427:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage_ptr", - "typeString": "struct TodoList.Task" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 156, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 150, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "451:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 151, - "name": "_content", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 141, - "src": "464:8:2", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 152, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "474:5:2", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 153, - "name": "block", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": -4, - "src": "481:5:2", - "typeDescriptions": { - "typeIdentifier": "t_magic_block", - "typeString": "block" - } - }, - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "timestamp", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "481:15:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string memory" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 149, - "name": "Task", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 125, - "src": "446:4:2", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Task_$125_storage_ptr_$", - "typeString": "type(struct TodoList.Task storage pointer)" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "446:51:2", - "tryCall": false, - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task memory" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "427:70:2" - }, - { - "expression": { - "argumentTypes": null, - "id": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 157, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "506:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 159, - "indexExpression": { - "argumentTypes": null, - "id": 158, - "name": "taskCounter", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 116, - "src": "512:11:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "506:18:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 160, - "name": "task", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 148, - "src": "527:4:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_memory_ptr", - "typeString": "struct TodoList.Task memory" - } - }, - "src": "506:25:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 162, - "nodeType": "ExpressionStatement", - "src": "506:25:2" - } - ] - }, - "documentation": null, - "functionSelector": "111002aa", - "id": 164, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "createTask", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 142, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 141, - "mutability": "mutable", - "name": "_content", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 164, - "src": "366:22:2", - "stateVariable": false, - "storageLocation": "memory", - "typeDescriptions": { - "typeIdentifier": "t_string_memory_ptr", - "typeString": "string" - }, - "typeName": { - "id": 140, - "name": "string", - "nodeType": "ElementaryTypeName", - "src": "366:6:2", - "typeDescriptions": { - "typeIdentifier": "t_string_storage_ptr", - "typeString": "string" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "365:24:2" - }, - "returnParameters": { - "id": 143, - "nodeType": "ParameterList", - "parameters": [], - "src": "397:0:2" - }, - "scope": 182, - "src": "346:193:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - }, - { - "body": { - "id": 180, - "nodeType": "Block", - "src": "585:68:2", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 178, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 169, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "594:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 171, - "indexExpression": { - "argumentTypes": null, - "id": 170, - "name": "_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 166, - "src": "600:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "594:13:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 172, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "completed", - "nodeType": "MemberAccess", - "referencedDeclaration": 122, - "src": "594:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 177, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "620:25:2", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 173, - "name": "tasks", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 129, - "src": "622:5:2", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_uint256_$_t_struct$_Task_$125_storage_$", - "typeString": "mapping(uint256 => struct TodoList.Task storage ref)" - } - }, - "id": 175, - "indexExpression": { - "argumentTypes": null, - "id": 174, - "name": "_index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 166, - "src": "628:6:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "622:13:2", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Task_$125_storage", - "typeString": "struct TodoList.Task storage ref" - } - }, - "id": 176, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "completed", - "nodeType": "MemberAccess", - "referencedDeclaration": 122, - "src": "622:23:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "594:51:2", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 179, - "nodeType": "ExpressionStatement", - "src": "594:51:2" - } - ] - }, - "documentation": null, - "functionSelector": "613137a4", - "id": 181, - "implemented": true, - "kind": "function", - "modifiers": [], - "name": "toggleTask", - "nodeType": "FunctionDefinition", - "overrides": null, - "parameters": { - "id": 167, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 166, - "mutability": "mutable", - "name": "_index", - "nodeType": "VariableDeclaration", - "overrides": null, - "scope": 181, - "src": "565:11:2", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 165, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "565:4:2", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "564:13:2" - }, - "returnParameters": { - "id": 168, - "nodeType": "ParameterList", - "parameters": [], - "src": "585:0:2" - }, - "scope": 182, - "src": "545:108:2", - "stateMutability": "nonpayable", - "virtual": false, - "visibility": "public" - } - ], - "scope": 183, - "src": "38:624:2" - } - ], - "src": "0:666:2" - }, - "compiler": { - "name": "solc", - "version": "0.6.6+commit.6c089d02.Emscripten.clang" - }, - "networks": { - "10": { - "events": {}, - "links": {}, - "address": "0xeD1D3391FAfd8dB75864a40074E2E690F48CE7db", - "transactionHash": "0xb5f29662d76005a0dd3c65367c69d4ab8e1bac136026d4cd2c75f744c550dd7a" - } - }, - "schemaVersion": "3.0.23", - "updatedAt": "2020-05-05T07:55:37.612Z", - "networkType": "ethereum", - "devdoc": { - "methods": {} - }, - "userdoc": { - "methods": {} - } -} \ No newline at end of file diff --git a/src/hooks/useProjectCreation.js b/src/hooks/useProjectCreation.js new file mode 100644 index 0000000..fd0a986 --- /dev/null +++ b/src/hooks/useProjectCreation.js @@ -0,0 +1,34 @@ +/* eslint-disable */ +import { useEffect, useState, useCallback } from 'react' +import { useContract } from '../web3-contracts' + +import { useActivity } from '../components/Activity/ActivityProvider' + +import ProjectCreation from '../contracts/GitFundedGrantFactory.json' + +const GAS_LIMIT = 3000000 + +// Project creation contract +function useProjectCreationContract() { + return useContract( + ProjectCreation.networks['10'].address, + ProjectCreation.abi + ) +} + +export function useProjectCreationActions() { + const { addActivity } = useActivity() + const projectCreationContract = useProjectCreationContract() + + const create = useCallback( + (id, name, budget) => { + return addActivity( + projectCreationContract.newProject(id, name, budget), + 'newProject', + { id: id, name: name, budget: budget } + ) + }, + [addActivity, projectCreationContract] + ) + return { create } +}