Showing preview only (1,779K chars total). Download the full file or copy to clipboard to get everything.
Repository: RedSquirrelTech/hoscdev
Branch: master
Commit: 244df4090053
Files: 118
Total size: 1.7 MB
Directory structure:
gitextract_vendmhmg/
├── .gitignore
├── chapter-10+11/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── FundraiserCard.js
│ │ ├── Home.js
│ │ ├── NewFundraiser.js
│ │ ├── Receipts.js
│ │ ├── contracts/
│ │ │ ├── Fundraiser.json
│ │ │ ├── FundraiserFactory.json
│ │ │ ├── Migrations.json
│ │ │ ├── Ownable.json
│ │ │ └── SafeMath.json
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ ├── FundraiserFactory.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_fundraiser_factory.js
│ ├── test/
│ │ ├── TestSimpleStorage.sol
│ │ └── simplestorage.js
│ └── truffle-config.js
├── chapter-4/
│ └── greeter/
│ ├── contracts/
│ │ ├── Greeter.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_greeter.js
│ ├── test/
│ │ └── greeter_test.js
│ └── truffle-config.js
├── chapter-5/
│ └── greeter/
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── contracts/
│ │ │ ├── Context.json
│ │ │ ├── Greeter.json
│ │ │ ├── Migrations.json
│ │ │ └── Ownable.json
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Greeter.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_greeter.js
│ ├── package.json
│ ├── test/
│ │ └── greeter_test.js
│ └── truffle-config.js
├── chapter-6/
│ └── fundraiser/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ └── 1_initial_migration.js
│ ├── test/
│ │ └── fundraiser_test.js
│ └── truffle-config.js
├── chapter-7/
│ └── fundraiser/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ ├── FundraiserFactory.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_fundraiser_factory.js
│ ├── test/
│ │ ├── fundraiser_factory_test.js
│ │ └── fundraiser_test.js
│ └── truffle-config.js
└── chapter-9/
├── README.md
├── package.json
├── public/
│ ├── index.html
│ └── manifest.json
└── src/
├── App.css
├── App.js
├── App.test.js
├── FundraiserCard.js
├── Home.js
├── NewFundraiser.js
├── Receipts.js
├── contracts/
│ ├── Factory.json
│ ├── Fundraiser.json
│ ├── Migrations.json
│ └── SimpleStorage.json
├── index.css
├── index.js
├── serviceWorker.js
└── utils/
└── getWeb3.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
.DS_Store
node_modules/
build/
================================================
FILE: chapter-10+11/LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2018 Truffle
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: chapter-10+11/client/.gitignore
================================================
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: chapter-10+11/client/README.md
================================================
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br>
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br>
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br>
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
================================================
FILE: chapter-10+11/client/package.json
================================================
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.3.1",
"@openzeppelin/contracts": "^2.3.0",
"bootstrap": "^4.3.1",
"cryptocompare": "^1.0.0",
"get-eth-price": "^1.0.0",
"normalize.css": "^8.0.1",
"react": "^16.8.0",
"react-bootstrap": "^1.0.0-beta.10",
"react-dom": "^16.9.0",
"react-redux": "^7.1.1",
"react-router-dom": "^5.0.1",
"react-scripts": "2.1.1",
"redux": "^4.0.4",
"web3": "^1.2.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
================================================
FILE: chapter-10+11/client/public/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
================================================
FILE: chapter-10+11/client/public/manifest.json
================================================
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
================================================
FILE: chapter-10+11/client/src/App.css
================================================
body {
margin: 0 !important;
}
.App {
text-align: center;
}
.donation-input-container {
display: flex;
}
.withdrawal-button {
margin-left: 10px;
}
.receipt-header {
border-bottom: 1px solid gray;
}
.receipt-container {
text-align: center;
}
.receipt-info {
display: flex;
padding: 50px;
justify-content: space-between;
}
.donation-receipt-link {
color: inherit;
text-decoration: none;
}
.main-container {
margin: 20px;
}
.donation-list {
margin-top: 10px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
.fundraiser-card-container {
display: inline-flex;
width: 250px;
height: 250px;
margin: 20px;
}
.MuiTextField-root {
display: block !important;
}
.MuiInputBase-root {
width: 300px !important;
margin-left: 3px;
}
.App-logo {
animation: App-logo-spin infinite 20s linear;
height: 40vmin;
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.owner-actions-container {
button {
margin-left: 20px;
}
}
.nav-link {
color: inherit;
text-decoration: none;
margin-right: 15px;
}
.nav-link:hover,
.nav-link:active,
.nav-link:visited {
color: black;
text-decoration: none;
}
================================================
FILE: chapter-10+11/client/src/App.js
================================================
import React, { useState, useEffect } from "react";
import FactoryContract from "./contracts/FundraiserFactory.json";
import getWeb3 from "./utils/getWeb3";
import { makeStyles } from '@material-ui/core/styles';
import AppBar from '@material-ui/core/AppBar';
import Toolbar from '@material-ui/core/Toolbar';
import Typography from '@material-ui/core/Typography';
import { BrowserRouter as Router, Route, NavLink } from "react-router-dom";
import NewFundraiser from './NewFundraiser'
import Home from './Home'
import Receipts from './Receipts'
import "./App.css";
const App = () => {
const [state, setState] = useState({web3: null, accounts: null, contract: null});
useEffect(() => {
const init = async() => {
try {
// Get network provider and web3 instance.
const web3 = await getWeb3();
// Use web3 to get the user's accounts.
const accounts = await web3.eth.getAccounts();
// Get the contract instance.
const networkId = await web3.eth.net.getId();
const deployedNetwork = FactoryContract.networks[networkId];
const instance = new web3.eth.Contract(
FactoryContract.abi,
deployedNetwork && deployedNetwork.address,
);
// Set web3, accounts, and contract to the state, and then proceed with an
setState({web3, accounts, contract: instance});
} catch(error) {
// Catch any errors for any of the above operations.
alert(
`Failed to load web3, accounts, or contract. Check console for details.`,
);
console.error(error);
}
}
init();
}, []);
const useStyles = makeStyles({
root: {
flexGrow: 1,
},
});
const runExample = async () => {
const { accounts, contract } = state;
};
return (
<div>
<Router>
<AppBar position="static" color="default" style={{ margin: 0 }}>
<Toolbar>
<Typography variant="h6" color="inherit">
<NavLink className="nav-link" to="/">Home</NavLink>
</Typography>
<NavLink className="nav-link" to="/new/">New</NavLink>
</Toolbar>
</AppBar>
<Route path="/" exact component={Home} />
<Route path="/new/" component={NewFundraiser} />
<Route path="/receipts" component={Receipts} />
</Router>
</div>
)
}
export default App;
================================================
FILE: chapter-10+11/client/src/App.test.js
================================================
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
================================================
FILE: chapter-10+11/client/src/FundraiserCard.js
================================================
import React, { useEffect, useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardActions from '@material-ui/core/CardActions';
import CardContent from '@material-ui/core/CardContent';
import CardMedia from '@material-ui/core/CardMedia';
import Button from '@material-ui/core/Button';
import Typography from '@material-ui/core/Typography';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogTitle from '@material-ui/core/DialogTitle';
import FilledInput from '@material-ui/core/FilledInput';
import FormControl from '@material-ui/core/FormControl';
import FormHelperText from '@material-ui/core/FormHelperText';
import Input from '@material-ui/core/Input';
import InputLabel from '@material-ui/core/InputLabel';
import OutlinedInput from '@material-ui/core/OutlinedInput';
import getWeb3 from "./utils/getWeb3";
import FundraiserContract from "./contracts/Fundraiser.json";
import Web3 from 'web3'
import { Link } from 'react-router-dom'
const cc = require('cryptocompare')
const getModalStyle =() => {
const top = 50;
const left = 50;
return {
top,
left,
};
}
const useStyles = makeStyles(theme => ({
container: {
display: 'flex',
flexWrap: 'wrap',
},
formControl: {
margin: theme.spacing(1),
display: 'table-cell'
},
card: {
maxWidth: 450,
height: 400
},
media: {
height: 140,
},
paper: {
position: 'absolute',
width: 500,
backgroundColor: theme.palette.background.paper,
border: 'none',
boxShadow: 'none',
padding: 4,
},
}));
const FundraiserCard = (props) => {
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
const [ contract, setContract] = useState(null)
const [ accounts, setAccounts ] = useState(null)
const [ fund, setFundraiser ] = useState(null)
const [ fundName, setFundname ] = useState(null)
const [ description, setDescription ] = useState(null)
const [ totalDonations, setTotalDonations ] = useState(null)
const [ imageURL, setImageURL ] = useState(null)
const [ url, setURL ] = useState(null)
const [ open, setOpen] = React.useState(false);
const [ donationAmount, setDonationAmount] = useState(null)
const [ exchangeRate, setExchangeRate ] = useState(null)
const [ userDonations, setUserDonations ] = useState(null)
const [ isOwner, setIsOwner ] = useState(false)
const [ beneficiary, setNewBeneficiary ] = useState('')
const ethAmount = (donationAmount / exchangeRate || 0).toFixed(4)
const { fundraiser } = props
const classes = useStyles();
useEffect(() => {
if (fundraiser) {
init(fundraiser)
}
}, [fundraiser]);
const init = async (fundraiser) => {
try {
const fund = fundraiser
const networkId = await web3.eth.net.getId();
const deployedNetwork = FundraiserContract.networks[networkId];
const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(
FundraiserContract.abi,
fund
);
setContract(instance)
setAccounts(accounts)
const name = await instance.methods.name().call()
const description = await instance.methods.description().call()
const totalDonations = await instance.methods.totalDonations().call()
const imageURL = await instance.methods.imageURL().call()
const url = await instance.methods.url().call()
const exchangeRate = await cc.price('ETH', ['USD'])
setExchangeRate(exchangeRate.USD)
const eth = web3.utils.fromWei(totalDonations, 'ether')
const dollarDonationAmount = exchangeRate.USD * eth
setTotalDonations(dollarDonationAmount.toFixed(2))
setFundname(name)
setDescription(description)
setImageURL(imageURL)
setURL(url)
const userDonations = await instance.methods.myDonations().call({ from: accounts[0]})
console.log(userDonations)
setUserDonations(userDonations)
const isUser = accounts[0]
const isOwner = await instance.methods.owner().call()
if (isOwner === accounts[0]) {
setIsOwner(true)
}
}
catch(error) {
alert(
`Failed to load web3, accounts, or contract. Check console for details.`,
);
console.error(error);
}
}
window.ethereum.on('accountsChanged', function (accounts) {
window.location.reload()
})
const handleOpen = () => {
setOpen(true);
};
const handleClose = () => {
setOpen(false);
};
const submitFunds = async () => {
const fundraisercontract = contract
const ethRate = exchangeRate
const ethTotal = donationAmount / ethRate
const donation = web3.utils.toWei(ethTotal.toString())
await contract.methods.donate().send({
from: accounts[0],
value: donation,
gas: 650000
})
setOpen(false);
}
const renderDonationsList = () => {
var donations = userDonations
if (donations === null) {return null}
const totalDonations = donations.values.length
let donationList = []
var i
for (i = 0; i < totalDonations; i++) {
const ethAmount = web3.utils.fromWei(donations.values[i])
const userDonation = exchangeRate * ethAmount
const donationDate = donations.dates[i]
donationList.push({ donationAmount: userDonation.toFixed(2), date: donationDate})
}
return donationList.map((donation) => {
return (
<div className="donation-list">
<p>${donation.donationAmount}</p>
<Button variant="contained" color="primary">
<Link className="donation-receipt-link" to={{ pathname: '/receipts', state: { fund: fundName, donation: donation.donationAmount, date: donation.date} }}>
Request Receipt
</Link>
</Button>
</div>
)
})
}
const withdrawalFunds = async () => {
await contract.methods.withdraw().send({
from: accounts[0],
})
alert('Funds Withdrawn!')
}
const setBeneficiary = async () => {
await contract.methods.setBeneficiary(beneficiary).send({
from: accounts[0],
})
alert(`Fundraiser Beneficiary Changed`)
}
return (
<div className="fundraiser-card-container">
<Dialog open={open} onClose={handleClose} aria-labelledby="form-dialog-title">
<DialogTitle id="form-dialog-title">
Donate to {fundName}
</DialogTitle>
<DialogContent>
<DialogContentText>
<img src={imageURL} width='200px' height='200px' />
<p>{description}</p>
<div className="donation-input-container">
<FormControl className={classes.formControl}>
$
<Input
id="component-simple"
value={donationAmount}
onChange={(e) => setDonationAmount(e.target.value)}
placeholder="0.00"
/>
</FormControl>
<p>Eth: {ethAmount}</p>
</div>
<Button onClick={submitFunds} variant="contained" color="primary">
Donate
</Button>
<div>
<h3>My donations</h3>
{renderDonationsList()}
</div>
{isOwner &&
<div>
<FormControl className={classes.formControl}>
Beneficiary:
<Input
value={beneficiary}
onChange={(e) => setNewBeneficiary(e.target.value)}
placeholder="Set Beneficiary"
/>
</FormControl>
<Button variant="contained" style={{ marginTop: 20 }} color="primary" onClick={setBeneficiary}>
Set Beneficiary
</Button>
</div>
}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleClose} color="primary">
Cancel
</Button>
{isOwner &&
<Button
variant="contained"
color="primary"
onClick={withdrawalFunds}
>
Withdrawal
</Button>
}
</DialogActions>
</Dialog>
<Card className={classes.card} onClick={handleOpen}>
<CardActionArea>
<CardMedia
className={classes.media}
image={imageURL}
title="Fundraiser Image"
/>
<CardContent>
<Typography gutterBottom variant="h5" component="h2">
{fundName}
</Typography>
<Typography variant="body2" color="textSecondary" component="p">
<p>{description}</p>
<p>Total Donations: ${totalDonations}</p>
</Typography>
</CardContent>
</CardActionArea>
<CardActions>
<Button
onClick={handleOpen}
variant="contained"
className={classes.button}>
View More
</Button>
</CardActions>
</Card>
</div>
)
}
export default FundraiserCard;
================================================
FILE: chapter-10+11/client/src/Home.js
================================================
import React, { useState, useEffect } from "react";
import { makeStyles } from '@material-ui/core/styles';
import FundraiserCard from './FundraiserCard'
import getWeb3 from "./utils/getWeb3";
import FactoryContract from "./contracts/FundraiserFactory.json";
import Web3 from 'web3'
const useStyles = makeStyles(theme => ({
button: {
margin: theme.spacing(1),
},
input: {
display: 'none',
},
}));
const Home = () => {
const [ contract, setContract] = useState(null)
const [ accounts, setAccounts ] = useState(null)
const [ funds, setFunds ] = useState([])
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
useEffect(() => {
init()
}, []);
const init = async () => {
try {
const networkId = await web3.eth.net.getId();
const deployedNetwork = FactoryContract.networks[networkId];
const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(
FactoryContract.abi,
deployedNetwork && deployedNetwork.address,
);
setContract(instance)
setAccounts(accounts)
const funds = await instance.methods.fundraisers(10, 0).call()
setFunds(funds)
}
catch(error) {
alert(
`Failed to load web3, accounts, or contract. Check console for details.`,
);
console.error(error);
}
}
const displayFundraisers = () => {
return funds.map((fundraiser) => {
return (
<FundraiserCard
fundraiser={fundraiser}
key={fundraiser}
/>
)
})
}
return (
<div className="main-container">
{displayFundraisers()}
</div>
)
}
export default Home;
================================================
FILE: chapter-10+11/client/src/NewFundraiser.js
================================================
import React, { useState, useEffect } from "react";
import FormControl from '@material-ui/core/FormControl';
import { makeStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import MenuItem from '@material-ui/core/MenuItem';
import TextField from '@material-ui/core/TextField';
import getWeb3 from "./utils/getWeb3";
import FactoryContract from "./contracts/FundraiserFactory.json";
import Web3 from 'web3'
const useStyles = makeStyles(theme => ({
container: {
display: 'flex',
flexWrap: 'wrap',
},
textField: {
marginLeft: theme.spacing(1),
marginRight: theme.spacing(1),
},
dense: {
marginTop: theme.spacing(2),
},
menu: {
width: 200,
},
}));
const NewFundraiser = () => {
const [labelWidth, setLabelWidth] = React.useState(0);
const labelRef = React.useRef(null);
const classes = useStyles();
const [ web3, setWeb3 ] = useState(null)
useEffect(() => {
const init = async() => {
try {
const web3 = await getWeb3();
const networkId = await web3.eth.net.getId();
const deployedNetwork = FactoryContract.networks[networkId];
const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(
FactoryContract.abi,
deployedNetwork && deployedNetwork.address,
);
setWeb3(web3)
setContract(instance)
setAccounts(accounts)
} catch(error) {
alert(
`Failed to load web3, accounts, or contract. Check console for details.`,
);
console.error(error);
}
}
init();
}, []);
const [ name, setFundraiserName ] = useState(null)
const [ website, setFundraiserWebsite ] = useState(null)
const [ description, setFundraiserDescription ] = useState(null)
const [ image, setImage ] = useState(null)
const [ address, setAddress ] = useState(null)
const [ contract, setContract] = useState(null)
const [ accounts, setAccounts ] = useState(null)
const handleSubmit = async () => {
const imageURL = image
const url = website
const beneficiary = address
const currentUser = await web3.currentProvider.selectedAddress
const transaction = await contract.methods.createFundraiser(
name,
url,
imageURL,
description,
beneficiary
).send({ from: accounts[0] })
alert('Successfully created fundraiser')
}
return (
<div className="create-fundraiser-container">
<h2>Create A New Fundraiser</h2>
<label>Name</label>
<TextField
id="outlined-bare"
className={classes.textField}
placeholder="Fundraiser Name"
margin="normal"
onChange={(e) => setFundraiserName(e.target.value)}
variant="outlined"
inputProps={{ 'aria-label': 'bare' }}
/>
<label>Website</label>
<TextField
id="outlined-bare"
className={classes.textField}
placeholder="Fundraiser Website"
margin="normal"
onChange={(e) => setFundraiserWebsite(e.target.value)}
variant="outlined"
inputProps={{ 'aria-label': 'bare' }}
/>
<label>Description</label>
<TextField
id="outlined-bare"
className={classes.textField}
placeholder="Fundraiser Description"
margin="normal"
onChange={(e) => setFundraiserDescription(e.target.value)}
variant="outlined"
inputProps={{ 'aria-label': 'bare' }}
/>
<label>Image</label>
<TextField
id="outlined-bare"
className={classes.textField}
placeholder="Fundraiser Image"
margin="normal"
onChange={(e) => setImage(e.target.value)}
variant="outlined"
inputProps={{ 'aria-label': 'bare' }}
/>
<label>Address</label>
<TextField
id="outlined-bare"
className={classes.textField}
placeholder="Fundraiser Ethereum Address"
margin="normal"
onChange={(e) => setAddress(e.target.value)}
variant="outlined"
inputProps={{ 'aria-label': 'bare' }}
/>
<Button
onClick={handleSubmit}
variant="contained"
className={classes.button}>
Submit
</Button>
</div>
)
}
export default NewFundraiser;
================================================
FILE: chapter-10+11/client/src/Receipts.js
================================================
import React, { useState, useEffect } from "react";
const Receipts = (props) => {
const [ donation, setDonation ] = useState(null)
const [ fundName, setFundName ] = useState(null)
const [ date, setDate ] = useState(null)
useEffect(() => {
const { donation, date, fund } = props.location.state
const formattedDate = new Date(parseInt(date))
setDonation(donation)
setDate(formattedDate.toString())
setFundName(fund)
}, []);
return (
<div className="receipt-container">
<div className="receipt-header">
<h3>Thank you for your donation to {fundName}</h3>
</div>
<div className="receipt-info">
<div>Date of Donation: {date}</div>
<div>Donation Value: ${donation}</div>
</div>
</div>
)
}
export default Receipts;
================================================
FILE: chapter-10+11/client/src/contracts/Fundraiser.json
================================================
{
"contractName": "Fundraiser",
"abi": [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "donationsCount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "beneficiary",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "url",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "description",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isOwner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "imageURL",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalDonations",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"name": "_name",
"type": "string"
},
{
"name": "_url",
"type": "string"
},
{
"name": "_imageURL",
"type": "string"
},
{
"name": "_description",
"type": "string"
},
{
"name": "_beneficiary",
"type": "address"
},
{
"name": "_custodian",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "donor",
"type": "address"
},
{
"indexed": false,
"name": "value",
"type": "uint256"
}
],
"name": "DonationReceived",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "amount",
"type": "uint256"
}
],
"name": "Withdraw",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_beneficiary",
"type": "address"
}
],
"name": "setBeneficiary",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "myDonationsCount",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "donate",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "myDonations",
"outputs": [
{
"name": "values",
"type": "uint256[]"
},
{
"name": "dates",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"metadata": "{\"compiler\":{\"version\":\"0.5.8+commit.23d335f2\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"constant\":true,\"inputs\":[],\"name\":\"myDonationsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"myDonations\",\"outputs\":[{\"name\":\"values\",\"type\":\"uint256[]\"},{\"name\":\"dates\",\"type\":\"uint256[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_beneficiary\",\"type\":\"address\"}],\"name\":\"setBeneficiary\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"donationsCount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"beneficiary\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"url\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"description\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"imageURL\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalDonations\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"donate\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"name\":\"_name\",\"type\":\"string\"},{\"name\":\"_url\",\"type\":\"string\"},{\"name\":\"_imageURL\",\"type\":\"string\"},{\"name\":\"_description\",\"type\":\"string\"},{\"name\":\"_beneficiary\",\"type\":\"address\"},{\"name\":\"_custodian\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"donor\",\"type\":\"address\"},{\"indexed\":false,\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"DonationReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Withdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"}],\"devdoc\":{\"methods\":{\"isOwner()\":{\"details\":\"Returns true if the caller is the current owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. * > Note: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/randallkanna/Documents/dev/book/hoscdev/chapter-10+11/contracts/Fundraiser.sol\":\"Fundraiser\"},\"evmVersion\":\"petersburg\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/randallkanna/Documents/dev/book/hoscdev/chapter-10+11/contracts/Fundraiser.sol\":{\"keccak256\":\"0x4c71de6bd99f371b0ccbf390caa727bfe9429f7227ea476bef46921e7394235a\",\"urls\":[\"bzzr://e74b39014904a052c9d666edb293af447a25a9efe53b46489cbf6fa9f7c0e90e\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x4ccf2d7b51873db1ccfd54ca2adae5eac3b184f9699911ed4490438419f1c690\",\"urls\":[\"bzzr://1604f5b6d6e916c154efd8c6720cda069e5ba32dfa0a9dedf2b42e5b02d07f89\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0xf79fb10e8235770eb4aea7249034076a3cc9f9119ad944fc48705bae9c9d20dc\",\"urls\":[\"bzzr://d12a11272051eb6586de8f7e0a82c04a98c9984ce8b2a6cf1ee439f65aba29a9\"]}},\"version\":1}",
"bytecode": "0x60806040523480156200001157600080fd5b506040516200174338038062001743833981018060405260c08110156200003757600080fd5b8101908080516401000000008111156200005057600080fd5b828101905060208101848111156200006757600080fd5b81518560018202830111640100000000821117156200008557600080fd5b50509291906020018051640100000000811115620000a257600080fd5b82810190506020810184811115620000b957600080fd5b8151856001820283011164010000000082111715620000d757600080fd5b50509291906020018051640100000000811115620000f457600080fd5b828101905060208101848111156200010b57600080fd5b81518560018202830111640100000000821117156200012957600080fd5b505092919060200180516401000000008111156200014657600080fd5b828101905060208101848111156200015d57600080fd5b81518560018202830111640100000000821117156200017b57600080fd5b50509291906020018051906020019092919080519060200190929190505050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a385600290805190602001906200026e9291906200045e565b508460039080519060200190620002879291906200045e565b508360049080519060200190620002a09291906200045e565b508260059080519060200190620002b99291906200045e565b5081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200030c816200031860201b60201c565b5050505050506200050d565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415620003a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806200171d6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620004a157805160ff1916838001178555620004d2565b82800160010185558215620004d2579182015b82811115620004d1578251825591602001919060010190620004b4565b5b509050620004e19190620004e5565b5090565b6200050a91905b8082111562000506576000816000905550600101620004ec565b5090565b90565b611200806200051d6000396000f3fe6080604052600436106100f35760003560e01c8063715018a61161008a578063b90497e011610059578063b90497e014610538578063de2ed893146105c8578063ed88c68e146105f3578063f2fde38b146105fd576100f3565b8063715018a61461040b5780637284e416146104225780638da5cb5b146104b25780638f32d59b14610509576100f3565b80631f522595116100c65780631f522595146102e257806338af3eed1461030d5780633ccfd60b146103645780635600f04f1461037b576100f3565b80630180b97c1461012257806306fdde031461014d5780631a57f7b4146101dd5780631c31f71014610291575b6101083460075461064e90919063ffffffff16565b600781905550600860008154809291906001019190505550005b34801561012e57600080fd5b506101376106d6565b6040518082815260200191505060405180910390f35b34801561015957600080fd5b50610162610720565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e957600080fd5b506101f26107be565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561023957808201518184015260208101905061021e565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561027b578082015181840152602081019050610260565b5050505090500194505050505060405180910390f35b34801561029d57600080fd5b506102e0600480360360208110156102b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ef565b005b3480156102ee57600080fd5b506102f76109ad565b6040518082815260200191505060405180910390f35b34801561031957600080fd5b506103226109b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037057600080fd5b506103796109d9565b005b34801561038757600080fd5b50610390610b12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d05780820151818401526020810190506103b5565b50505050905090810190601f1680156103fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041757600080fd5b50610420610bb0565b005b34801561042e57600080fd5b50610437610ce9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047757808201518184015260208101905061045c565b50505050905090810190601f1680156104a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104be57600080fd5b506104c7610d87565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051557600080fd5b5061051e610db0565b604051808215151515815260200191505060405180910390f35b34801561054457600080fd5b5061054d610e07565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058d578082015181840152602081019050610572565b50505050905090810190601f1680156105ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d457600080fd5b506105dd610ea5565b6040518082815260200191505060405180910390f35b6105fb610eab565b005b34801561060957600080fd5b5061064c6004803603602081101561062057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fca565b005b6000808284019050838110156106cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050905090565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107b65780601f1061078b576101008083540402835291602001916107b6565b820191906000526020600020905b81548152906001019060200180831161079957829003601f168201915b505050505081565b60608060006107cb6106d6565b9050806040519080825280602002602001820160405280156107fc5781602001602082028038833980820191505090505b5092508060405190808252806020026020018201604052801561082e5781602001602082028038833980820191505090505b50915060008090505b818110156108e3576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061088b57fe5b9060005260206000209060020201905080600001548583815181106108ac57fe5b60200260200101818152505080600101548483815181106108c957fe5b602002602001018181525050508080600101915050610837565b50828292509250509091565b6108f7610db0565b610969576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e1610db0565b610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610ad7573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ba85780601f10610b7d57610100808354040283529160200191610ba8565b820191906000526020600020905b815481529060010190602001808311610b8b57829003601f168201915b505050505081565b610bb8610db0565b610c2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7f5780601f10610d5457610100808354040283529160200191610d7f565b820191906000526020600020905b815481529060010190602001808311610d6257829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e9d5780601f10610e7257610100808354040283529160200191610e9d565b820191906000526020600020905b815481529060010190602001808311610e8057829003601f168201915b505050505081565b60075481565b610eb3611194565b6040518060400160405280348152602001428152509050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010155505050610f613460075461064e90919063ffffffff16565b6007819055506008600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff167f264f630d9efa0d07053a31163641d9fcc0adafc9d9e76f1c37c2ce3a558d2c52346040518082815260200191505060405180910390a250565b610fd2610db0565b611044576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61104d81611050565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111af6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60405180604001604052806000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a165627a7a723058209fbfa484628b02babb980313ae79b77e708df8b0c46024caff44504889d7641100294f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373",
"deployedBytecode": "0x6080604052600436106100f35760003560e01c8063715018a61161008a578063b90497e011610059578063b90497e014610538578063de2ed893146105c8578063ed88c68e146105f3578063f2fde38b146105fd576100f3565b8063715018a61461040b5780637284e416146104225780638da5cb5b146104b25780638f32d59b14610509576100f3565b80631f522595116100c65780631f522595146102e257806338af3eed1461030d5780633ccfd60b146103645780635600f04f1461037b576100f3565b80630180b97c1461012257806306fdde031461014d5780631a57f7b4146101dd5780631c31f71014610291575b6101083460075461064e90919063ffffffff16565b600781905550600860008154809291906001019190505550005b34801561012e57600080fd5b506101376106d6565b6040518082815260200191505060405180910390f35b34801561015957600080fd5b50610162610720565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e957600080fd5b506101f26107be565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561023957808201518184015260208101905061021e565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561027b578082015181840152602081019050610260565b5050505090500194505050505060405180910390f35b34801561029d57600080fd5b506102e0600480360360208110156102b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108ef565b005b3480156102ee57600080fd5b506102f76109ad565b6040518082815260200191505060405180910390f35b34801561031957600080fd5b506103226109b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037057600080fd5b506103796109d9565b005b34801561038757600080fd5b50610390610b12565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d05780820151818401526020810190506103b5565b50505050905090810190601f1680156103fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041757600080fd5b50610420610bb0565b005b34801561042e57600080fd5b50610437610ce9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047757808201518184015260208101905061045c565b50505050905090810190601f1680156104a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104be57600080fd5b506104c7610d87565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051557600080fd5b5061051e610db0565b604051808215151515815260200191505060405180910390f35b34801561054457600080fd5b5061054d610e07565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058d578082015181840152602081019050610572565b50505050905090810190601f1680156105ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105d457600080fd5b506105dd610ea5565b6040518082815260200191505060405180910390f35b6105fb610eab565b005b34801561060957600080fd5b5061064c6004803603602081101561062057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fca565b005b6000808284019050838110156106cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050905090565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107b65780601f1061078b576101008083540402835291602001916107b6565b820191906000526020600020905b81548152906001019060200180831161079957829003601f168201915b505050505081565b60608060006107cb6106d6565b9050806040519080825280602002602001820160405280156107fc5781602001602082028038833980820191505090505b5092508060405190808252806020026020018201604052801561082e5781602001602082028038833980820191505090505b50915060008090505b818110156108e3576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061088b57fe5b9060005260206000209060020201905080600001548583815181106108ac57fe5b60200260200101818152505080600101548483815181106108c957fe5b602002602001018181525050508080600101915050610837565b50828292509250509091565b6108f7610db0565b610969576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e1610db0565b610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610ad7573d6000803e3d6000fd5b507f5b6b431d4476a211bb7d41c20d1aab9ae2321deee0d20be3d9fc9b1093fa6e3d816040518082815260200191505060405180910390a150565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ba85780601f10610b7d57610100808354040283529160200191610ba8565b820191906000526020600020905b815481529060010190602001808311610b8b57829003601f168201915b505050505081565b610bb8610db0565b610c2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7f5780601f10610d5457610100808354040283529160200191610d7f565b820191906000526020600020905b815481529060010190602001808311610d6257829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e9d5780601f10610e7257610100808354040283529160200191610e9d565b820191906000526020600020905b815481529060010190602001808311610e8057829003601f168201915b505050505081565b60075481565b610eb3611194565b6040518060400160405280348152602001428152509050600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000209060020201600090919290919091506000820151816000015560208201518160010155505050610f613460075461064e90919063ffffffff16565b6007819055506008600081548092919060010191905055503373ffffffffffffffffffffffffffffffffffffffff167f264f630d9efa0d07053a31163641d9fcc0adafc9d9e76f1c37c2ce3a558d2c52346040518082815260200191505060405180910390a250565b610fd2610db0565b611044576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61104d81611050565b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111af6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60405180604001604052806000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a165627a7a723058209fbfa484628b02babb980313ae79b77e708df8b0c46024caff44504889d764110029",
"sourceMap": "158:2312:0:-;;;679:420;8:9:-1;5:2;;;30:1;27;20:12;5:2;679:420:0;;;;;;;;;;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;679:420:0;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;71:11;66:3;62:21;55:28;;123:4;118:3;114:14;159:9;141:16;138:31;135:2;;;182:1;179;172:12;135:2;219:3;213:10;330:9;325:1;311:12;307:20;289:16;285:43;282:58;261:11;247:12;244:29;233:115;230:2;;;361:1;358;351:12;230:2;0:372;;679:420:0;;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;71:11;66:3;62:21;55:28;;123:4;118:3;114:14;159:9;141:16;138:31;135:2;;;182:1;179;172:12;135:2;219:3;213:10;330:9;325:1;311:12;307:20;289:16;285:43;282:58;261:11;247:12;244:29;233:115;230:2;;;361:1;358;351:12;230:2;0:372;;679:420:0;;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;71:11;66:3;62:21;55:28;;123:4;118:3;114:14;159:9;141:16;138:31;135:2;;;182:1;179;172:12;135:2;219:3;213:10;330:9;325:1;311:12;307:20;289:16;285:43;282:58;261:11;247:12;244:29;233:115;230:2;;;361:1;358;351:12;230:2;0:372;;679:420:0;;;;;;;19:11:-1;14:3;11:20;8:2;;;44:1;41;34:12;8:2;71:11;66:3;62:21;55:28;;123:4;118:3;114:14;159:9;141:16;138:31;135:2;;;182:1;179;172:12;135:2;219:3;213:10;330:9;325:1;311:12;307:20;289:16;285:43;282:58;261:11;247:12;244:29;233:115;230:2;;;361:1;358;351:12;230:2;0:372;;679:420:0;;;;;;;;;;;;;;;;;;;;;;;;;;666:10:4;657:6;;:19;;;;;;;;;;;;;;;;;;724:6;;;;;;;;;;;691:40;;720:1;691:40;;;;;;;;;;;;925:5:0;918:4;:12;;;;;;;;;;;;:::i;:::-;;946:4;940:3;:10;;;;;;;;;;;;:::i;:::-;;971:9;960:8;:20;;;;;;;;;;;;:::i;:::-;;1004:12;990:11;:26;;;;;;;;;;;;:::i;:::-;;1040:12;1026:11;;:26;;;;;;;;;;;;;;;;;;1062:30;1081:10;1062:18;;;:30;;:::i;:::-;679:420;;;;;;158:2312;;2093:225:4;2186:1;2166:22;;:8;:22;;;;2158:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2275:8;2246:38;;2267:6;;;;;;;;;;;2246:38;;;;;;;;;;;;2303:8;2294:6;;:17;;;;;;;;;;;;;;;;;;2093:225;:::o;158:2312:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "158:2312:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2406:29;2425:9;2406:14;;:18;;:29;;;;:::i;:::-;2389:14;:46;;;;2445:14;;:16;;;;;;;;;;;;;158:2312;1225:110;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1225:110:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;460:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:18:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;460:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1693:481;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1693:481:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1693:481:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1693:481:0;;;;;;;;;;;;;;;;;;;1105:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1105:114:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1105:114:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;643:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;643:29:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;567:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;567:34:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2180:164;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2180:164:0;;;:::i;:::-;;484:17;;8:9:-1;5:2;;;30:1;27;20:12;5:2;484:17:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;484:17:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1599:137:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1599:137:4;;;:::i;:::-;;535:25:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;535:25:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;535:25:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;814:77:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;814:77:4;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1165:90;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1165:90:4;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;507:22:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;507:22:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;507:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;608:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;608:29:0;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1341:346;;;:::i;:::-;;1885:107:4;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1885:107:4;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1885:107:4;;;;;;;;;;;;;;;;;;;:::i;:::-;;834:176:3;892:7;911:9;927:1;923;:5;911:17;;951:1;946;:6;;938:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1002:1;995:8;;;834:176;;;;:::o;1225:110:0:-;1273:7;1299:10;:22;1310:10;1299:22;;;;;;;;;;;;;;;:29;;;;1292:36;;1225:110;:::o;460:18::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1693:481::-;1745:23;1778:22;1821:13;1837:18;:16;:18::i;:::-;1821:34;;1888:5;1874:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;1874:20:0;;;;1865:29;;1926:5;1912:20;;;;;;;;;;;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;1912:20:0;;;;1904:28;;1948:9;1960:1;1948:13;;1943:192;1967:5;1963:1;:9;1943:192;;;1993:25;2021:10;:22;2032:10;2021:22;;;;;;;;;;;;;;;2044:1;2021:25;;;;;;;;;;;;;;;;;;1993:53;;2072:8;:14;;;2060:6;2067:1;2060:9;;;;;;;;;;;;;:26;;;;;2111:8;:13;;;2100:5;2106:1;2100:8;;;;;;;;;;;;;:24;;;;;1943:192;1974:3;;;;;;;1943:192;;;;2153:6;2161:5;2145:22;;;;;1693:481;;:::o;1105:114::-;1018:9:4;:7;:9::i;:::-;1010:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1200:12:0;1186:11;;:26;;;;;;;;;;;;;;;;;;1105:114;:::o;643:29::-;;;;:::o;567:34::-;;;;;;;;;;;;;:::o;2180:164::-;1018:9:4;:7;:9::i;:::-;1010:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2227:15:0;2253:4;2245:21;;;2227:39;;2276:11;;;;;;;;;;;:20;;:29;2297:7;2276:29;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2276:29:0;2320:17;2329:7;2320:17;;;;;;;;;;;;;;;;;;1074:1:4;2180:164:0:o;484:17::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;1599:137:4:-;1018:9;:7;:9::i;:::-;1010:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1697:1;1660:40;;1681:6;;;;;;;;;;;1660:40;;;;;;;;;;;;1727:1;1710:6;;:19;;;;;;;;;;;;;;;;;;1599:137::o;535:25:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;814:77:4:-;852:7;878:6;;;;;;;;;;;871:13;;814:77;:::o;1165:90::-;1205:4;1242:6;;;;;;;;;;;1228:20;;:10;:20;;;1221:27;;1165:90;:::o;507:22:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;608:29::-;;;;:::o;1341:346::-;1384:24;;:::i;:::-;1411:85;;;;;;;;1441:9;1411:85;;;;1470:15;1411:85;;;1384:112;;1506:10;:22;1517:10;1506:22;;;;;;;;;;;;;;;1534:8;1506:37;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;1506:37:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1570:29;1589:9;1570:14;;:18;;:29;;;;:::i;:::-;1553:14;:46;;;;1609:14;;:16;;;;;;;;;;;;;1658:10;1641:39;;;1670:9;1641:39;;;;;;;;;;;;;;;;;;1341:346;:::o;1885:107:4:-;1018:9;:7;:9::i;:::-;1010:54;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1957:28;1976:8;1957:18;:28::i;:::-;1885:107;:::o;2093:225::-;2186:1;2166:22;;:8;:22;;;;2158:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2275:8;2246:38;;2267:6;;;;;;;;;;;2246:38;;;;;;;;;;;;2303:8;2294:6;;:17;;;;;;;;;;;;;;;;;;2093:225;:::o;158:2312:0:-;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\ncontract Fundraiser is Ownable {\n using SafeMath for uint256;\n\n struct Donation {\n uint256 value;\n uint256 date;\n }\n mapping(address => Donation[]) private _donations;\n\n event DonationReceived(address indexed donor, uint256 value);\n event Withdraw(uint256 amount);\n\n string public name;\n string public url;\n string public imageURL;\n string public description;\n\n address payable public beneficiary;\n\n uint256 public totalDonations;\n uint256 public donationsCount;\n\n constructor(\n string memory _name,\n string memory _url,\n string memory _imageURL,\n string memory _description,\n address payable _beneficiary,\n address _custodian\n )\n public\n {\n name = _name;\n url = _url;\n imageURL = _imageURL;\n description = _description;\n beneficiary = _beneficiary;\n _transferOwnership(_custodian);\n }\n\n function setBeneficiary(address payable _beneficiary) public onlyOwner {\n beneficiary = _beneficiary;\n }\n\n function myDonationsCount() public view returns(uint256) {\n return _donations[msg.sender].length;\n }\n\n function donate() public payable {\n Donation memory donation = Donation({\n value: msg.value,\n date: block.timestamp\n });\n _donations[msg.sender].push(donation);\n totalDonations = totalDonations.add(msg.value);\n donationsCount++;\n\n emit DonationReceived(msg.sender, msg.value);\n }\n\n function myDonations() public view returns(\n uint256[] memory values,\n uint256[] memory dates\n )\n {\n uint256 count = myDonationsCount();\n values = new uint256[](count);\n dates = new uint256[](count);\n\n for (uint256 i = 0; i < count; i++) {\n Donation storage donation = _donations[msg.sender][i];\n values[i] = donation.value;\n dates[i] = donation.date;\n }\n\n return (values, dates);\n }\n\n function withdraw() public onlyOwner {\n uint256 balance = address(this).balance;\n beneficiary.transfer(balance);\n emit Withdraw(balance);\n }\n\n function () external payable {\n totalDonations = totalDonations.add(msg.value);\n donationsCount++;\n }\n}\n",
"sourcePath": "/Users/randallkanna/Documents/dev/book/hoscdev/chapter-10+11/contracts/Fundraiser.sol",
"ast": {
"absolutePath": "/Users/randallkanna/Documents/dev/book/hoscdev/chapter-10+11/contracts/Fundraiser.sol",
"exportedSymbols": {
"Fundraiser": [
254
]
},
"id": 255,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">",
"0.4",
".23",
"<",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:31:0"
},
{
"absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 255,
"sourceUnit": 696,
"src": "33:63:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 255,
"sourceUnit": 585,
"src": "97:59:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4,
"name": "Ownable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 695,
"src": "181:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Ownable_$695",
"typeString": "contract Ownable"
}
},
"id": 5,
"nodeType": "InheritanceSpecifier",
"src": "181:7:0"
}
],
"contractDependencies": [
695
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 254,
"linearizedBaseContracts": [
254,
695
],
"name": "Fundraiser",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 8,
"libraryName": {
"contractScope": null,
"id": 6,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 584,
"src": "201:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$584",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "195:27:0",
"typeName": {
"id": 7,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "214:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"canonicalName": "Fundraiser.Donation",
"id": 13,
"members": [
{
"constant": false,
"id": 10,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "254:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "254:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 12,
"name": "date",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "277:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "277:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Donation",
"nodeType": "StructDefinition",
"scope": 254,
"src": "228:68:0",
"visibility": "public"
},
{
"constant": false,
"id": 18,
"name": "_donations",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "301:49:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_struct$_Donation_$13_storage_$dyn_storage_$",
"typeString": "mapping(address => struct Fundraiser.Donation[])"
},
"typeName": {
"id": 17,
"keyType": {
"id": 14,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "309:7:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "301:30:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_struct$_Donation_$13_storage_$dyn_storage_$",
"typeString": "mapping(address => struct Fundraiser.Donation[])"
},
"valueType": {
"baseType": {
"contractScope": null,
"id": 15,
"name": "Donation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13,
"src": "320:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation"
}
},
"id": 16,
"length": null,
"nodeType": "ArrayTypeName",
"src": "320:10:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Donation_$13_storage_$dyn_storage_ptr",
"typeString": "struct Fundraiser.Donation[]"
}
}
},
"value": null,
"visibility": "private"
},
{
"anonymous": false,
"documentation": null,
"id": 24,
"name": "DonationReceived",
"nodeType": "EventDefinition",
"parameters": {
"id": 23,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 20,
"indexed": true,
"name": "donor",
"nodeType": "VariableDeclaration",
"scope": 24,
"src": "380:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 19,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "380:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 22,
"indexed": false,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 24,
"src": "403:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 21,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "403:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "379:38:0"
},
"src": "357:61:0"
},
{
"anonymous": false,
"documentation": null,
"id": 28,
"name": "Withdraw",
"nodeType": "EventDefinition",
"parameters": {
"id": 27,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26,
"indexed": false,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 28,
"src": "438:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 25,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "438:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "437:16:0"
},
"src": "423:31:0"
},
{
"constant": false,
"id": 30,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "460:18:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 29,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "460:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 32,
"name": "url",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "484:17:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 31,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "484:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 34,
"name": "imageURL",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "507:22:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 33,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "507:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 36,
"name": "description",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "535:25:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 35,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "535:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 38,
"name": "beneficiary",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "567:34:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 37,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "567:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 40,
"name": "totalDonations",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "608:29:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 39,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "608:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 42,
"name": "donationsCount",
"nodeType": "VariableDeclaration",
"scope": 254,
"src": "643:29:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 41,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "643:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 81,
"nodeType": "Block",
"src": "908:191:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 57,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 30,
"src": "918:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 58,
"name": "_name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "925:5:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "918:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 60,
"nodeType": "ExpressionStatement",
"src": "918:12:0"
},
{
"expression": {
"argumentTypes": null,
"id": 63,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 61,
"name": "url",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 32,
"src": "940:3:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 62,
"name": "_url",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 46,
"src": "946:4:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "940:10:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 64,
"nodeType": "ExpressionStatement",
"src": "940:10:0"
},
{
"expression": {
"argumentTypes": null,
"id": 67,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 65,
"name": "imageURL",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 34,
"src": "960:8:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 66,
"name": "_imageURL",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 48,
"src": "971:9:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "960:20:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 68,
"nodeType": "ExpressionStatement",
"src": "960:20:0"
},
{
"expression": {
"argumentTypes": null,
"id": 71,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 69,
"name": "description",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "990:11:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 70,
"name": "_description",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 50,
"src": "1004:12:0",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "990:26:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 72,
"nodeType": "ExpressionStatement",
"src": "990:26:0"
},
{
"expression": {
"argumentTypes": null,
"id": 75,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 73,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1026:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 74,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 52,
"src": "1040:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1026:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 76,
"nodeType": "ExpressionStatement",
"src": "1026:26:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 78,
"name": "_custodian",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 54,
"src": "1081:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 77,
"name": "_transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 694,
"src": "1062:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 79,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1062:30:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 80,
"nodeType": "ExpressionStatement",
"src": "1062:30:0"
}
]
},
"documentation": null,
"id": 82,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 55,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 44,
"name": "_name",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "700:19:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 43,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "700:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 46,
"name": "_url",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "729:18:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 45,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "729:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 48,
"name": "_imageURL",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "757:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 47,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "757:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 50,
"name": "_description",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "790:26:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 49,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "790:6:0",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 52,
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "826:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 51,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "826:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 54,
"name": "_custodian",
"nodeType": "VariableDeclaration",
"scope": 82,
"src": "864:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 53,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "864:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "690:198:0"
},
"returnParameters": {
"id": 56,
"nodeType": "ParameterList",
"parameters": [],
"src": "908:0:0"
},
"scope": 254,
"src": "679:420:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 93,
"nodeType": "Block",
"src": "1176:43:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 91,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 89,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "1186:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 90,
"name": "_beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 84,
"src": "1200:12:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1186:26:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 92,
"nodeType": "ExpressionStatement",
"src": "1186:26:0"
}
]
},
"documentation": null,
"id": 94,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 87,
"modifierName": {
"argumentTypes": null,
"id": 86,
"name": "onlyOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 628,
"src": "1166:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "1166:9:0"
}
],
"name": "setBeneficiary",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 85,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 84,
"name": "_beneficiary",
"nodeType": "VariableDeclaration",
"scope": 94,
"src": "1129:28:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 83,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1129:15:0",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1128:30:0"
},
"returnParameters": {
"id": 88,
"nodeType": "ParameterList",
"parameters": [],
"src": "1176:0:0"
},
"scope": 254,
"src": "1105:114:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 105,
"nodeType": "Block",
"src": "1282:53:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 99,
"name": "_donations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1299:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_struct$_Donation_$13_storage_$dyn_storage_$",
"typeString": "mapping(address => struct Fundraiser.Donation storage ref[] storage ref)"
}
},
"id": 102,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 100,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1310:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1310:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1299:22:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Donation_$13_storage_$dyn_storage",
"typeString": "struct Fundraiser.Donation storage ref[] storage ref"
}
},
"id": 103,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1299:29:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 98,
"id": 104,
"nodeType": "Return",
"src": "1292:36:0"
}
]
},
"documentation": null,
"id": 106,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "myDonationsCount",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 95,
"nodeType": "ParameterList",
"parameters": [],
"src": "1250:2:0"
},
"returnParameters": {
"id": 98,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 97,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 106,
"src": "1273:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 96,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1273:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1272:9:0"
},
"scope": 254,
"src": "1225:110:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 144,
"nodeType": "Block",
"src": "1374:313:0",
"statements": [
{
"assignments": [
110
],
"declarations": [
{
"constant": false,
"id": 110,
"name": "donation",
"nodeType": "VariableDeclaration",
"scope": 144,
"src": "1384:24:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_memory_ptr",
"typeString": "struct Fundraiser.Donation"
},
"typeName": {
"contractScope": null,
"id": 109,
"name": "Donation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13,
"src": "1384:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 117,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 112,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1441:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 113,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1441:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 114,
"name": "block",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 700,
"src": "1470:5:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_block",
"typeString": "block"
}
},
"id": 115,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "timestamp",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1470:15:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 111,
"name": "Donation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13,
"src": "1411:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_struct$_Donation_$13_storage_ptr_$",
"typeString": "type(struct Fundraiser.Donation storage pointer)"
}
},
"id": 116,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "structConstructorCall",
"lValueRequested": false,
"names": [
"value",
"date"
],
"nodeType": "FunctionCall",
"src": "1411:85:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_memory",
"typeString": "struct Fundraiser.Donation memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1384:112:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 123,
"name": "donation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 110,
"src": "1534:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_memory_ptr",
"typeString": "struct Fundraiser.Donation memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Donation_$13_memory_ptr",
"typeString": "struct Fundraiser.Donation memory"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 118,
"name": "_donations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "1506:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_struct$_Donation_$13_storage_$dyn_storage_$",
"typeString": "mapping(address => struct Fundraiser.Donation storage ref[] storage ref)"
}
},
"id": 121,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 119,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1517:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 120,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1517:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1506:22:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Donation_$13_storage_$dyn_storage",
"typeString": "struct Fundraiser.Donation storage ref[] storage ref"
}
},
"id": 122,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "push",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1506:27:0",
"typeDescriptions": {
"typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_Donation_$13_storage_$returns$_t_uint256_$",
"typeString": "function (struct Fundraiser.Donation storage ref) returns (uint256)"
}
},
"id": 124,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1506:37:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 125,
"nodeType": "ExpressionStatement",
"src": "1506:37:0"
},
{
"expression": {
"argumentTypes": null,
"id": 132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 126,
"name": "totalDonations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 40,
"src": "1553:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 129,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1589:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1589:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 127,
"name": "totalDonations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 40,
"src": "1570:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 128,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 478,
"src": "1570:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 131,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1570:29:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1553:46:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 133,
"nodeType": "ExpressionStatement",
"src": "1553:46:0"
},
{
"expression": {
"argumentTypes": null,
"id": 135,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1609:16:0",
"subExpression": {
"argumentTypes": null,
"id": 134,
"name": "donationsCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42,
"src": "1609:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 136,
"nodeType": "ExpressionStatement",
"src": "1609:16:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 138,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1658:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 139,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1658:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 140,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "1670:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1670:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 137,
"name": "DonationReceived",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 24,
"src": "1641:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,uint256)"
}
},
"id": 142,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1641:39:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 143,
"nodeType": "EmitStatement",
"src": "1636:44:0"
}
]
},
"documentation": null,
"id": 145,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "donate",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 107,
"nodeType": "ParameterList",
"parameters": [],
"src": "1356:2:0"
},
"returnParameters": {
"id": 108,
"nodeType": "ParameterList",
"parameters": [],
"src": "1374:0:0"
},
"scope": 254,
"src": "1341:346:0",
"stateMutability": "payable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 214,
"nodeType": "Block",
"src": "1811:363:0",
"statements": [
{
"assignments": [
155
],
"declarations": [
{
"constant": false,
"id": 155,
"name": "count",
"nodeType": "VariableDeclaration",
"scope": 214,
"src": "1821:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 154,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1821:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 158,
"initialValue": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 156,
"name": "myDonationsCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 106,
"src": "1837:16:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_uint256_$",
"typeString": "function () view returns (uint256)"
}
},
"id": 157,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1837:18:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1821:34:0"
},
{
"expression": {
"argumentTypes": null,
"id": 165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 159,
"name": "values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 149,
"src": "1865:6:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 163,
"name": "count",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 155,
"src": "1888:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 162,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "1874:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 160,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1878:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 161,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1878:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 164,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1874:20:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory",
"typeString": "uint256[] memory"
}
},
"src": "1865:29:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 166,
"nodeType": "ExpressionStatement",
"src": "1865:29:0"
},
{
"expression": {
"argumentTypes": null,
"id": 173,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 167,
"name": "dates",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 152,
"src": "1904:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 171,
"name": "count",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 155,
"src": "1926:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 170,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "1912:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 168,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1916:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 169,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1916:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 172,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1912:20:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory",
"typeString": "uint256[] memory"
}
},
"src": "1904:28:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 174,
"nodeType": "ExpressionStatement",
"src": "1904:28:0"
},
{
"body": {
"id": 208,
"nodeType": "Block",
"src": "1979:156:0",
"statements": [
{
"assignments": [
186
],
"declarations": [
{
"constant": false,
"id": 186,
"name": "donation",
"nodeType": "VariableDeclaration",
"scope": 208,
"src": "1993:25:0",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation"
},
"typeName": {
"contractScope": null,
"id": 185,
"name": "Donation",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 13,
"src": "1993:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 193,
"initialValue": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 187,
"name": "_donations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 18,
"src": "2021:10:0",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_array$_t_struct$_Donation_$13_storage_$dyn_storage_$",
"typeString": "mapping(address => struct Fundraiser.Donation storage ref[] storage ref)"
}
},
"id": 190,
"indexExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 188,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "2032:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2032:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2021:22:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_struct$_Donation_$13_storage_$dyn_storage",
"typeString": "struct Fundraiser.Donation storage ref[] storage ref"
}
},
"id": 192,
"indexExpression": {
"argumentTypes": null,
"id": 191,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "2044:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "2021:25:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage",
"typeString": "struct Fundraiser.Donation storage ref"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1993:53:0"
},
{
"expression": {
"argumentTypes": null,
"id": 199,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 194,
"name": "values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 149,
"src": "2060:6:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 196,
"indexExpression": {
"argumentTypes": null,
"id": 195,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "2067:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2060:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 197,
"name": "donation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "2072:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation storage pointer"
}
},
"id": 198,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": 10,
"src": "2072:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2060:26:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 200,
"nodeType": "ExpressionStatement",
"src": "2060:26:0"
},
{
"expression": {
"argumentTypes": null,
"id": 206,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 201,
"name": "dates",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 152,
"src": "2100:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 203,
"indexExpression": {
"argumentTypes": null,
"id": 202,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "2106:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "2100:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 204,
"name": "donation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 186,
"src": "2111:8:0",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Donation_$13_storage_ptr",
"typeString": "struct Fundraiser.Donation storage pointer"
}
},
"id": 205,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "date",
"nodeType": "MemberAccess",
"referencedDeclaration": 12,
"src": "2111:13:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2100:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 207,
"nodeType": "ExpressionStatement",
"src": "2100:24:0"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 181,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 179,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "1963:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 180,
"name": "count",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 155,
"src": "1967:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1963:9:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 209,
"initializationExpression": {
"assignments": [
176
],
"declarations": [
{
"constant": false,
"id": 176,
"name": "i",
"nodeType": "VariableDeclaration",
"scope": 209,
"src": "1948:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 175,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1948:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 178,
"initialValue": {
"argumentTypes": null,
"hexValue": "30",
"id": 177,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1960:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"nodeType": "VariableDeclarationStatement",
"src": "1948:13:0"
},
"loopExpression": {
"expression": {
"argumentTypes": null,
"id": 183,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "1974:3:0",
"subExpression": {
"argumentTypes": null,
"id": 182,
"name": "i",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 176,
"src": "1974:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 184,
"nodeType": "ExpressionStatement",
"src": "1974:3:0"
},
"nodeType": "ForStatement",
"src": "1943:192:0"
},
{
"expression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 210,
"name": "values",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 149,
"src": "2153:6:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
{
"argumentTypes": null,
"id": 211,
"name": "dates",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 152,
"src": "2161:5:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
}
],
"id": 212,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "2152:15:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_array$_t_uint256_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "tuple(uint256[] memory,uint256[] memory)"
}
},
"functionReturnParameters": 153,
"id": 213,
"nodeType": "Return",
"src": "2145:22:0"
}
]
},
"documentation": null,
"id": 215,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "myDonations",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 146,
"nodeType": "ParameterList",
"parameters": [],
"src": "1713:2:0"
},
"returnParameters": {
"id": 153,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 149,
"name": "values",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "1745:23:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 147,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1745:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 148,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1745:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 152,
"name": "dates",
"nodeType": "VariableDeclaration",
"scope": 215,
"src": "1778:22:0",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 150,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1778:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 151,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1778:9:0",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1735:71:0"
},
"scope": 254,
"src": "1693:481:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 237,
"nodeType": "Block",
"src": "2217:127:0",
"statements": [
{
"assignments": [
221
],
"declarations": [
{
"constant": false,
"id": 221,
"name": "balance",
"nodeType": "VariableDeclaration",
"scope": 237,
"src": "2227:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 220,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2227:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 226,
"initialValue": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 223,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 728,
"src": "2253:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Fundraiser_$254",
"typeString": "contract Fundraiser"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Fundraiser_$254",
"typeString": "contract Fundraiser"
}
],
"id": 222,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2245:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 224,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2245:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 225,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2245:21:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2227:39:0"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 230,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 221,
"src": "2297:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 227,
"name": "beneficiary",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 38,
"src": "2276:11:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 229,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "transfer",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2276:20:0",
"typeDescriptions": {
"typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 231,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2276:29:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 232,
"nodeType": "ExpressionStatement",
"src": "2276:29:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 234,
"name": "balance",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 221,
"src": "2329:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 233,
"name": "Withdraw",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28,
"src": "2320:8:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 235,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2320:17:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 236,
"nodeType": "EmitStatement",
"src": "2315:22:0"
}
]
},
"documentation": null,
"id": 238,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 218,
"modifierName": {
"argumentTypes": null,
"id": 217,
"name": "onlyOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 628,
"src": "2207:9:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2207:9:0"
}
],
"name": "withdraw",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 216,
"nodeType": "ParameterList",
"parameters": [],
"src": "2197:2:0"
},
"returnParameters": {
"id": 219,
"nodeType": "ParameterList",
"parameters": [],
"src": "2217:0:0"
},
"scope": 254,
"src": "2180:164:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 252,
"nodeType": "Block",
"src": "2379:89:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 247,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 241,
"name": "totalDonations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 40,
"src": "2389:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 244,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 710,
"src": "2425:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 245,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2425:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 242,
"name": "totalDonations",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 40,
"src": "2406:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 478,
"src": "2406:18:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 246,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2406:29:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "2389:46:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 248,
"nodeType": "ExpressionStatement",
"src": "2389:46:0"
},
{
"expression": {
"argumentTypes": null,
"id": 250,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "++",
"prefix": false,
"src": "2445:16:0",
"subExpression": {
"argumentTypes": null,
"id": 249,
"name": "donationsCount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 42,
"src": "2445:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 251,
"nodeType": "ExpressionStatement",
"src": "2445:16:0"
}
]
},
"documentation": null,
"id": 253,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 239,
"nodeType": "ParameterList",
"parameters": [],
"src": "2359:2:0"
},
"returnParameters": {
"id": 240,
"nodeType": "ParameterList",
"parameters": [],
"src": "2379:0:0"
},
"scope": 254,
"src": "2350:118:0",
"stateMutability": "payable",
"superFunction": null,
"visibility": "external"
}
],
"scope": 255,
"src": "158:2312:0"
}
],
"src": "0:2471:0"
},
"legacyAST": {
"absolutePath": "/Users/randallkanna/Documents/dev/book/hoscdev/chapter-10+11/contracts/Fundraiser.sol",
"exportedSymbols": {
"Fundraiser": [
254
]
},
"id": 255,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">",
"0.4",
".23",
"<",
"0.7",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:31:0"
},
{
"absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 255,
"sourceUnit": 696,
"src": "33:63:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 255,
"sourceUnit": 585,
"src": "97:59:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 4,
"name": "Ownable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 695,
"src": "181:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Ownable_$695",
"typeString": "contract Ownable"
}
},
"id": 5,
"nodeType": "InheritanceSpecifier",
"src": "181:7:0"
}
],
"contractDependencies": [
695
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 254,
"linearizedBaseContracts": [
254,
695
],
"name": "Fundraiser",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 8,
"libraryName": {
"contractScope": null,
"id": 6,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 584,
"src": "201:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$584",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "195:27:0",
"typeName": {
"id": 7,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "214:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"canonicalName": "Fundraiser.Donation",
"id": 13,
"members": [
{
"constant": false,
"id": 10,
"name": "value",
"nodeType": "VariableDeclaration",
"scope": 13,
"src": "254:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 9,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "254:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"cons
gitextract_vendmhmg/
├── .gitignore
├── chapter-10+11/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── FundraiserCard.js
│ │ ├── Home.js
│ │ ├── NewFundraiser.js
│ │ ├── Receipts.js
│ │ ├── contracts/
│ │ │ ├── Fundraiser.json
│ │ │ ├── FundraiserFactory.json
│ │ │ ├── Migrations.json
│ │ │ ├── Ownable.json
│ │ │ └── SafeMath.json
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ ├── FundraiserFactory.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_fundraiser_factory.js
│ ├── test/
│ │ ├── TestSimpleStorage.sol
│ │ └── simplestorage.js
│ └── truffle-config.js
├── chapter-4/
│ └── greeter/
│ ├── contracts/
│ │ ├── Greeter.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_greeter.js
│ ├── test/
│ │ └── greeter_test.js
│ └── truffle-config.js
├── chapter-5/
│ └── greeter/
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── contracts/
│ │ │ ├── Context.json
│ │ │ ├── Greeter.json
│ │ │ ├── Migrations.json
│ │ │ └── Ownable.json
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Greeter.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_greeter.js
│ ├── package.json
│ ├── test/
│ │ └── greeter_test.js
│ └── truffle-config.js
├── chapter-6/
│ └── fundraiser/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ └── 1_initial_migration.js
│ ├── test/
│ │ └── fundraiser_test.js
│ └── truffle-config.js
├── chapter-7/
│ └── fundraiser/
│ ├── LICENSE
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ └── manifest.json
│ │ └── src/
│ │ ├── App.css
│ │ ├── App.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── index.js
│ │ ├── serviceWorker.js
│ │ └── utils/
│ │ └── getWeb3.js
│ ├── contracts/
│ │ ├── Fundraiser.sol
│ │ ├── FundraiserFactory.sol
│ │ └── Migrations.sol
│ ├── migrations/
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_fundraiser_factory.js
│ ├── test/
│ │ ├── fundraiser_factory_test.js
│ │ └── fundraiser_test.js
│ └── truffle-config.js
└── chapter-9/
├── README.md
├── package.json
├── public/
│ ├── index.html
│ └── manifest.json
└── src/
├── App.css
├── App.js
├── App.test.js
├── FundraiserCard.js
├── Home.js
├── NewFundraiser.js
├── Receipts.js
├── contracts/
│ ├── Factory.json
│ ├── Fundraiser.json
│ ├── Migrations.json
│ └── SimpleStorage.json
├── index.css
├── index.js
├── serviceWorker.js
└── utils/
└── getWeb3.js
SYMBOL INDEX (28 symbols across 9 files)
FILE: chapter-10+11/client/src/serviceWorker.js
function register (line 23) | function register(config) {
function registerValidSW (line 57) | function registerValidSW(swUrl, config) {
function checkValidServiceWorker (line 101) | function checkValidServiceWorker(swUrl, config) {
function unregister (line 129) | function unregister() {
FILE: chapter-5/greeter/client/src/App.js
class App (line 7) | class App extends Component {
method render (line 55) | render() {
FILE: chapter-5/greeter/client/src/serviceWorker.js
function register (line 23) | function register(config) {
function registerValidSW (line 57) | function registerValidSW(swUrl, config) {
function checkValidServiceWorker (line 101) | function checkValidServiceWorker(swUrl, config) {
function unregister (line 129) | function unregister() {
FILE: chapter-6/fundraiser/client/src/App.js
class App (line 7) | class App extends Component {
method render (line 51) | render() {
FILE: chapter-6/fundraiser/client/src/serviceWorker.js
function register (line 23) | function register(config) {
function registerValidSW (line 57) | function registerValidSW(swUrl, config) {
function checkValidServiceWorker (line 101) | function checkValidServiceWorker(swUrl, config) {
function unregister (line 129) | function unregister() {
FILE: chapter-7/fundraiser/client/src/App.js
class App (line 7) | class App extends Component {
method render (line 51) | render() {
FILE: chapter-7/fundraiser/client/src/serviceWorker.js
function register (line 23) | function register(config) {
function registerValidSW (line 57) | function registerValidSW(swUrl, config) {
function checkValidServiceWorker (line 101) | function checkValidServiceWorker(swUrl, config) {
function unregister (line 129) | function unregister() {
FILE: chapter-7/fundraiser/test/fundraiser_factory_test.js
function createFundraiserFactory (line 60) | async function createFundraiserFactory(fundraiserCount, accounts) {
function addFundraisers (line 66) | async function addFundraisers(factory, count, accounts) {
FILE: chapter-9/src/serviceWorker.js
function register (line 23) | function register(config) {
function registerValidSW (line 57) | function registerValidSW(swUrl, config) {
function checkValidServiceWorker (line 101) | function checkValidServiceWorker(swUrl, config) {
function unregister (line 129) | function unregister() {
Condensed preview — 118 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,899K chars).
[
{
"path": ".gitignore",
"chars": 31,
"preview": ".DS_Store\nnode_modules/\nbuild/\n"
},
{
"path": "chapter-10+11/LICENSE",
"chars": 1075,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2018 Truffle\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "chapter-10+11/client/.gitignore",
"chars": 310,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
},
{
"path": "chapter-10+11/client/README.md",
"chars": 2077,
"preview": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scrip"
},
{
"path": "chapter-10+11/client/package.json",
"chars": 824,
"preview": "{\n \"name\": \"client\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"dependencies\": {\n \"@material-ui/core\": \"^4.3.1\",\n "
},
{
"path": "chapter-10+11/client/public/index.html",
"chars": 1572,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/fa"
},
{
"path": "chapter-10+11/client/public/manifest.json",
"chars": 306,
"preview": "{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n "
},
{
"path": "chapter-10+11/client/src/App.css",
"chars": 1480,
"preview": "body {\n margin: 0 !important;\n}\n\n.App {\n text-align: center;\n}\n\n.donation-input-container {\n display: flex;\n}\n\n.withd"
},
{
"path": "chapter-10+11/client/src/App.js",
"chars": 2391,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport FactoryContract from \"./contracts/FundraiserFactory.json\";\ni"
},
{
"path": "chapter-10+11/client/src/App.test.js",
"chars": 248,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
},
{
"path": "chapter-10+11/client/src/FundraiserCard.js",
"chars": 9255,
"preview": "import React, { useEffect, useState } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Card f"
},
{
"path": "chapter-10+11/client/src/Home.js",
"chars": 1693,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport { makeStyles } from '@material-ui/core/styles';\nimport Fundr"
},
{
"path": "chapter-10+11/client/src/NewFundraiser.js",
"chars": 4211,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport FormControl from '@material-ui/core/FormControl';\nimport { m"
},
{
"path": "chapter-10+11/client/src/Receipts.js",
"chars": 804,
"preview": "import React, { useState, useEffect } from \"react\";\n\nconst Receipts = (props) => {\n const [ donation, setDonation ] = u"
},
{
"path": "chapter-10+11/client/src/contracts/Fundraiser.json",
"chars": 293057,
"preview": "{\n \"contractName\": \"Fundraiser\",\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"name\",\n "
},
{
"path": "chapter-10+11/client/src/contracts/FundraiserFactory.json",
"chars": 191445,
"preview": "{\n \"contractName\": \"FundraiserFactory\",\n \"abi\": [\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n "
},
{
"path": "chapter-10+11/client/src/contracts/Migrations.json",
"chars": 54194,
"preview": "{\n \"contractName\": \"Migrations\",\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"last_compl"
},
{
"path": "chapter-10+11/client/src/contracts/Ownable.json",
"chars": 117938,
"preview": "{\n \"contractName\": \"Ownable\",\n \"abi\": [\n {\n \"inputs\": [],\n \"payable\": false,\n \"stateMutability\": \"no"
},
{
"path": "chapter-10+11/client/src/contracts/SafeMath.json",
"chars": 145400,
"preview": "{\n \"contractName\": \"SafeMath\",\n \"abi\": [],\n \"metadata\": \"{\\\"compiler\\\":{\\\"version\\\":\\\"0.5.8+commit.23d335f2\\\"},\\\"lang"
},
{
"path": "chapter-10+11/client/src/index.css",
"chars": 380,
"preview": "body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n "
},
{
"path": "chapter-10+11/client/src/index.js",
"chars": 292,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter } from 'react-router-dom'\nimport App"
},
{
"path": "chapter-10+11/client/src/serviceWorker.js",
"chars": 4948,
"preview": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the ap"
},
{
"path": "chapter-10+11/client/src/utils/getWeb3.js",
"chars": 1144,
"preview": "import Web3 from \"web3\";\n\nconst getWeb3 = () =>\n new Promise((resolve, reject) => {\n // Wait for loading completion "
},
{
"path": "chapter-10+11/contracts/Fundraiser.sol",
"chars": 2471,
"preview": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-so"
},
{
"path": "chapter-10+11/contracts/FundraiserFactory.sol",
"chars": 1382,
"preview": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"./Fundraiser.sol\";\n\ncontract FundraiserFactory {\n uint256 constant maxLimit ="
},
{
"path": "chapter-10+11/contracts/Migrations.sol",
"chars": 506,
"preview": "pragma solidity ^0.5.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifi"
},
{
"path": "chapter-10+11/migrations/1_initial_migration.js",
"chars": 129,
"preview": "var Migrations = artifacts.require(\"./Migrations.sol\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(Migrati"
},
{
"path": "chapter-10+11/migrations/2_deploy_fundraiser_factory.js",
"chars": 161,
"preview": "const FundraiserFactoryContract = artifacts.require(\"FundraiserFactory\");\n\nmodule.exports = function(deployer) {\n deplo"
},
{
"path": "chapter-10+11/test/TestSimpleStorage.sol",
"chars": 434,
"preview": "pragma solidity ^0.5.0;\n\nimport \"truffle/Assert.sol\";\nimport \"truffle/DeployedAddresses.sol\";\nimport \"../contracts/Simpl"
},
{
"path": "chapter-10+11/test/simplestorage.js",
"chars": 476,
"preview": "const SimpleStorage = artifacts.require(\"./SimpleStorage.sol\");\n\ncontract(\"SimpleStorage\", accounts => {\n it(\"...should"
},
{
"path": "chapter-10+11/truffle-config.js",
"chars": 297,
"preview": "const path = require(\"path\");\n\nmodule.exports = {\n // See <http://truffleframework.com/docs/advanced/configuration>\n /"
},
{
"path": "chapter-4/greeter/contracts/Greeter.sol",
"chars": 361,
"preview": "pragma solidity >= 0.4.0 < 0.7.0;\n\nimport \"openzeppelin-solidity/contracts/access/Ownable.sol\";\n\ncontract Greeter is Own"
},
{
"path": "chapter-4/greeter/contracts/Migrations.sol",
"chars": 515,
"preview": "pragma solidity >=0.4.21 <0.6.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n"
},
{
"path": "chapter-4/greeter/migrations/1_initial_migration.js",
"chars": 125,
"preview": "const Migrations = artifacts.require(\"Migrations\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(Migrations)"
},
{
"path": "chapter-4/greeter/migrations/2_deploy_greeter.js",
"chars": 131,
"preview": "const GreeterContract = artifacts.require(\"Greeter\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(GreeterCo"
},
{
"path": "chapter-4/greeter/test/greeter_test.js",
"chars": 2271,
"preview": "const GreeterContract = artifacts.require(\"Greeter\");\n\ncontract(\"Greeter\", (accounts) => {\n describe(\"deployment\", () ="
},
{
"path": "chapter-4/greeter/truffle-config.js",
"chars": 4233,
"preview": "/**\n * Use this file to configure your truffle project. It's seeded with some\n * common settings for different networks "
},
{
"path": "chapter-5/greeter/client/.gitignore",
"chars": 310,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
},
{
"path": "chapter-5/greeter/client/README.md",
"chars": 2077,
"preview": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scrip"
},
{
"path": "chapter-5/greeter/client/package.json",
"chars": 501,
"preview": "{\n \"name\": \"client\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"dependencies\": {\n \"react\": \"^16.6.3\",\n \"react-do"
},
{
"path": "chapter-5/greeter/client/public/index.html",
"chars": 1572,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/fa"
},
{
"path": "chapter-5/greeter/client/public/manifest.json",
"chars": 306,
"preview": "{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n "
},
{
"path": "chapter-5/greeter/client/src/App.css",
"chars": 468,
"preview": ".App {\n text-align: center;\n}\n\n.App-logo {\n animation: App-logo-spin infinite 20s linear;\n height: 40vmin;\n}\n\n.App-he"
},
{
"path": "chapter-5/greeter/client/src/App.js",
"chars": 2258,
"preview": "import React, { Component } from \"react\";\nimport GreeterContract from \"./contracts/Greeter.json\";\nimport getWeb3 from \"."
},
{
"path": "chapter-5/greeter/client/src/App.test.js",
"chars": 248,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
},
{
"path": "chapter-5/greeter/client/src/contracts/Context.json",
"chars": 20809,
"preview": "{\n \"contractName\": \"Context\",\n \"abi\": [],\n \"metadata\": \"{\\\"compiler\\\":{\\\"version\\\":\\\"0.6.12+commit.27d51765\\\"},\\\"lang"
},
{
"path": "chapter-5/greeter/client/src/contracts/Greeter.json",
"chars": 39839,
"preview": "{\n \"contractName\": \"Greeter\",\n \"abi\": [\n {\n \"constant\": false,\n \"inputs\": [],\n \"name\": \"renounceOwne"
},
{
"path": "chapter-5/greeter/client/src/contracts/Migrations.json",
"chars": 54536,
"preview": "{\n \"contractName\": \"Migrations\",\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"last_compl"
},
{
"path": "chapter-5/greeter/client/src/contracts/Ownable.json",
"chars": 117886,
"preview": "{\n \"contractName\": \"Ownable\",\n \"abi\": [\n {\n \"inputs\": [],\n \"payable\": false,\n \"stateMutability\": \"no"
},
{
"path": "chapter-5/greeter/client/src/index.css",
"chars": 380,
"preview": "body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n "
},
{
"path": "chapter-5/greeter/client/src/index.js",
"chars": 451,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as "
},
{
"path": "chapter-5/greeter/client/src/serviceWorker.js",
"chars": 4948,
"preview": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the ap"
},
{
"path": "chapter-5/greeter/client/src/utils/getWeb3.js",
"chars": 1144,
"preview": "import Web3 from \"web3\";\n\nconst getWeb3 = () =>\n new Promise((resolve, reject) => {\n // Wait for loading completion "
},
{
"path": "chapter-5/greeter/contracts/Greeter.sol",
"chars": 361,
"preview": "pragma solidity >= 0.4.0 < 0.7.0;\n\nimport \"openzeppelin-solidity/contracts/access/Ownable.sol\";\n\ncontract Greeter is Own"
},
{
"path": "chapter-5/greeter/contracts/Migrations.sol",
"chars": 515,
"preview": "pragma solidity >=0.4.21 <0.7.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n"
},
{
"path": "chapter-5/greeter/migrations/1_initial_migration.js",
"chars": 125,
"preview": "const Migrations = artifacts.require(\"Migrations\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(Migrations)"
},
{
"path": "chapter-5/greeter/migrations/2_deploy_greeter.js",
"chars": 131,
"preview": "const GreeterContract = artifacts.require(\"Greeter\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(GreeterCo"
},
{
"path": "chapter-5/greeter/package.json",
"chars": 137,
"preview": "{\n \"dependencies\": {\n \"openzeppelin-solidity\": \"^3.4.0\"\n },\n \"devDependencies\": {\n \"truffle-hdwallet-provider\":"
},
{
"path": "chapter-5/greeter/test/greeter_test.js",
"chars": 2217,
"preview": "const GreeterContract = artifacts.require(\"Greeter\");\n\ncontract(\"Greeter\", (accounts) => {\n it(\"has been deployed succe"
},
{
"path": "chapter-5/greeter/truffle-config.js",
"chars": 4848,
"preview": "const HDWallterProvider = require(\"truffle-hdwallet-provider\");\n/**\n * Use this file to configure your truffle project. "
},
{
"path": "chapter-6/fundraiser/LICENSE",
"chars": 1075,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2018 Truffle\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "chapter-6/fundraiser/client/.gitignore",
"chars": 310,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
},
{
"path": "chapter-6/fundraiser/client/README.md",
"chars": 2077,
"preview": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scrip"
},
{
"path": "chapter-6/fundraiser/client/package.json",
"chars": 509,
"preview": "{\n \"name\": \"client\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"dependencies\": {\n \"react\": \"^16.6.3\",\n \"react-do"
},
{
"path": "chapter-6/fundraiser/client/public/index.html",
"chars": 1572,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/fa"
},
{
"path": "chapter-6/fundraiser/client/public/manifest.json",
"chars": 306,
"preview": "{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n "
},
{
"path": "chapter-6/fundraiser/client/src/App.css",
"chars": 468,
"preview": ".App {\n text-align: center;\n}\n\n.App-logo {\n animation: App-logo-spin infinite 20s linear;\n height: 40vmin;\n}\n\n.App-he"
},
{
"path": "chapter-6/fundraiser/client/src/App.js",
"chars": 2294,
"preview": "import React, { Component } from \"react\";\nimport SimpleStorageContract from \"./contracts/SimpleStorage.json\";\nimport get"
},
{
"path": "chapter-6/fundraiser/client/src/App.test.js",
"chars": 248,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
},
{
"path": "chapter-6/fundraiser/client/src/index.css",
"chars": 380,
"preview": "body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n "
},
{
"path": "chapter-6/fundraiser/client/src/index.js",
"chars": 451,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as "
},
{
"path": "chapter-6/fundraiser/client/src/serviceWorker.js",
"chars": 4948,
"preview": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the ap"
},
{
"path": "chapter-6/fundraiser/client/src/utils/getWeb3.js",
"chars": 1144,
"preview": "import Web3 from \"web3\";\n\nconst getWeb3 = () =>\n new Promise((resolve, reject) => {\n // Wait for loading completion "
},
{
"path": "chapter-6/fundraiser/contracts/Fundraiser.sol",
"chars": 2488,
"preview": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-so"
},
{
"path": "chapter-6/fundraiser/contracts/Migrations.sol",
"chars": 506,
"preview": "pragma solidity ^0.5.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifi"
},
{
"path": "chapter-6/fundraiser/migrations/1_initial_migration.js",
"chars": 129,
"preview": "var Migrations = artifacts.require(\"./Migrations.sol\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(Migrati"
},
{
"path": "chapter-6/fundraiser/test/fundraiser_test.js",
"chars": 7555,
"preview": "const FundraiserContract = artifacts.require(\"Fundraiser\");\n\ncontract(\"Fundraiser\", accounts => {\n let fundraiser;\n co"
},
{
"path": "chapter-6/fundraiser/truffle-config.js",
"chars": 297,
"preview": "const path = require(\"path\");\n\nmodule.exports = {\n // See <http://truffleframework.com/docs/advanced/configuration>\n /"
},
{
"path": "chapter-7/fundraiser/LICENSE",
"chars": 1075,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2018 Truffle\n\nPermission is hereby granted, free of charge, to any person obtaining"
},
{
"path": "chapter-7/fundraiser/client/.gitignore",
"chars": 310,
"preview": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pn"
},
{
"path": "chapter-7/fundraiser/client/README.md",
"chars": 2077,
"preview": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scrip"
},
{
"path": "chapter-7/fundraiser/client/package.json",
"chars": 509,
"preview": "{\n \"name\": \"client\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"dependencies\": {\n \"react\": \"^16.6.3\",\n \"react-do"
},
{
"path": "chapter-7/fundraiser/client/public/index.html",
"chars": 1572,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/fa"
},
{
"path": "chapter-7/fundraiser/client/public/manifest.json",
"chars": 306,
"preview": "{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n "
},
{
"path": "chapter-7/fundraiser/client/src/App.css",
"chars": 468,
"preview": ".App {\n text-align: center;\n}\n\n.App-logo {\n animation: App-logo-spin infinite 20s linear;\n height: 40vmin;\n}\n\n.App-he"
},
{
"path": "chapter-7/fundraiser/client/src/App.js",
"chars": 2294,
"preview": "import React, { Component } from \"react\";\nimport SimpleStorageContract from \"./contracts/SimpleStorage.json\";\nimport get"
},
{
"path": "chapter-7/fundraiser/client/src/App.test.js",
"chars": 248,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
},
{
"path": "chapter-7/fundraiser/client/src/index.css",
"chars": 380,
"preview": "body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n "
},
{
"path": "chapter-7/fundraiser/client/src/index.js",
"chars": 451,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as "
},
{
"path": "chapter-7/fundraiser/client/src/serviceWorker.js",
"chars": 4948,
"preview": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the ap"
},
{
"path": "chapter-7/fundraiser/client/src/utils/getWeb3.js",
"chars": 1144,
"preview": "import Web3 from \"web3\";\n\nconst getWeb3 = () =>\n new Promise((resolve, reject) => {\n // Wait for loading completion "
},
{
"path": "chapter-7/fundraiser/contracts/Fundraiser.sol",
"chars": 2471,
"preview": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-so"
},
{
"path": "chapter-7/fundraiser/contracts/FundraiserFactory.sol",
"chars": 1382,
"preview": "pragma solidity >0.4.23 <0.7.0;\n\nimport \"./Fundraiser.sol\";\n\ncontract FundraiserFactory {\n uint256 constant maxLimit ="
},
{
"path": "chapter-7/fundraiser/contracts/Migrations.sol",
"chars": 506,
"preview": "pragma solidity ^0.5.0;\n\ncontract Migrations {\n address public owner;\n uint public last_completed_migration;\n\n modifi"
},
{
"path": "chapter-7/fundraiser/migrations/1_initial_migration.js",
"chars": 129,
"preview": "var Migrations = artifacts.require(\"./Migrations.sol\");\n\nmodule.exports = function(deployer) {\n deployer.deploy(Migrati"
},
{
"path": "chapter-7/fundraiser/migrations/2_deploy_fundraiser_factory.js",
"chars": 161,
"preview": "const FundraiserFactoryContract = artifacts.require(\"FundraiserFactory\");\n\nmodule.exports = function(deployer) {\n deplo"
},
{
"path": "chapter-7/fundraiser/test/fundraiser_factory_test.js",
"chars": 5300,
"preview": "const FundraiserFactoryContract = artifacts.require(\"FundraiserFactory\");\nconst FundraiserContract = artifacts.require(\""
},
{
"path": "chapter-7/fundraiser/test/fundraiser_test.js",
"chars": 7555,
"preview": "const FundraiserContract = artifacts.require(\"Fundraiser\");\n\ncontract(\"Fundraiser\", accounts => {\n let fundraiser;\n co"
},
{
"path": "chapter-7/fundraiser/truffle-config.js",
"chars": 297,
"preview": "const path = require(\"path\");\n\nmodule.exports = {\n // See <http://truffleframework.com/docs/advanced/configuration>\n /"
},
{
"path": "chapter-9/README.md",
"chars": 2077,
"preview": "This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).\n\n## Available Scrip"
},
{
"path": "chapter-9/package.json",
"chars": 824,
"preview": "{\n \"name\": \"client\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"dependencies\": {\n \"@material-ui/core\": \"^4.3.1\",\n "
},
{
"path": "chapter-9/public/index.html",
"chars": 1572,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <link rel=\"shortcut icon\" href=\"%PUBLIC_URL%/fa"
},
{
"path": "chapter-9/public/manifest.json",
"chars": 306,
"preview": "{\n \"short_name\": \"React App\",\n \"name\": \"Create React App Sample\",\n \"icons\": [\n {\n \"src\": \"favicon.ico\",\n "
},
{
"path": "chapter-9/src/App.css",
"chars": 1414,
"preview": "body {\n margin: 0 !important;\n}\n\n.App {\n text-align: center;\n}\n\n.donation-input-container {\n display: flex;\n}\n\n.withd"
},
{
"path": "chapter-9/src/App.js",
"chars": 2474,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport FactoryContract from \"./contracts/Factory.json\";\nimport getW"
},
{
"path": "chapter-9/src/App.test.js",
"chars": 248,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', ()"
},
{
"path": "chapter-9/src/FundraiserCard.js",
"chars": 8490,
"preview": "import React, { useEffect, useState } from 'react';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Card f"
},
{
"path": "chapter-9/src/Home.js",
"chars": 1708,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport { makeStyles } from '@material-ui/core/styles';\nimport Fundr"
},
{
"path": "chapter-9/src/NewFundraiser.js",
"chars": 4519,
"preview": "\nimport React, { useState, useEffect } from \"react\";\nimport FormControl from '@material-ui/core/FormControl';\nimport { m"
},
{
"path": "chapter-9/src/Receipts.js",
"chars": 804,
"preview": "import React, { useState, useEffect } from \"react\";\n\nconst Receipts = (props) => {\n const [ donation, setDonation ] = u"
},
{
"path": "chapter-9/src/contracts/Factory.json",
"chars": 147354,
"preview": "{\n \"contractName\": \"Factory\",\n \"abi\": [\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed"
},
{
"path": "chapter-9/src/contracts/Fundraiser.json",
"chars": 338318,
"preview": "{\n \"contractName\": \"Fundraiser\",\n \"abi\": [\n {\n \"constant\": false,\n \"inputs\": [],\n \"name\": \"renounceO"
},
{
"path": "chapter-9/src/contracts/Migrations.json",
"chars": 53939,
"preview": "{\n \"contractName\": \"Migrations\",\n \"abi\": [\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"last_compl"
},
{
"path": "chapter-9/src/contracts/SimpleStorage.json",
"chars": 19743,
"preview": "{\n \"contractName\": \"SimpleStorage\",\n \"abi\": [\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"na"
},
{
"path": "chapter-9/src/index.css",
"chars": 380,
"preview": "body {\n margin: 0;\n padding: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n "
},
{
"path": "chapter-9/src/index.js",
"chars": 292,
"preview": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter } from 'react-router-dom'\nimport App"
},
{
"path": "chapter-9/src/serviceWorker.js",
"chars": 4948,
"preview": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the ap"
},
{
"path": "chapter-9/src/utils/getWeb3.js",
"chars": 1144,
"preview": "import Web3 from \"web3\";\n\nconst getWeb3 = () =>\n new Promise((resolve, reject) => {\n // Wait for loading completion "
}
]
About this extraction
This page contains the full source code of the RedSquirrelTech/hoscdev GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 118 files (1.7 MB), approximately 367.5k tokens, and a symbol index with 28 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.