From a418f3d5b6f5df0d16d6837a5487eb8a25496c09 Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Tue, 13 Nov 2018 09:17:06 -0500 Subject: [PATCH 01/17] Authenticate endpoints (#193) * Add auth to endpoints. --- backend/.gitignore | 2 + backend/grant/proposal/views.py | 60 +++-- backend/grant/user/models.py | 18 +- backend/grant/user/views.py | 69 +++--- backend/grant/utils/auth.py | 61 +++-- backend/requirements/prod.txt | 2 +- backend/tests/config.py | 31 ++- backend/tests/proposal/test_api.py | 78 ++----- backend/tests/test_data.py | 21 +- .../tests/user/test_required_sm_decorator.py | 8 +- backend/tests/user/test_user_api.py | 208 ++++++++---------- frontend/client/store/configure.tsx | 20 ++ 12 files changed, 302 insertions(+), 276 deletions(-) diff --git a/backend/.gitignore b/backend/.gitignore index 9ec0f3ca..229ce318 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -68,3 +68,5 @@ dump.rdb # jetbrains .idea/ +# vscode +.vscode/ diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index 67a2de40..7213e32b 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -1,12 +1,13 @@ from datetime import datetime -from flask import Blueprint +from flask import Blueprint, g from flask_yoloapi import endpoint, parameter from sqlalchemy.exc import IntegrityError from grant.comment.models import Comment, comment_schema from grant.milestone.models import Milestone from grant.user.models import User, SocialMedia, Avatar +from grant.utils.auth import requires_sm, requires_team_member_auth from .models import Proposal, proposals_schema, proposal_schema, ProposalUpdate, proposal_update_schema, db blueprint = Blueprint("proposal", __name__, url_prefix="/api/v1/proposals") @@ -39,28 +40,22 @@ def get_proposal_comments(proposal_id): @blueprint.route("//comments", methods=["POST"]) +@requires_sm @endpoint.api( - parameter('userId', type=int, required=True), parameter('content', type=str, required=True) ) def post_proposal_comments(proposal_id, user_id, content): proposal = Proposal.query.filter_by(id=proposal_id).first() if proposal: - user = User.query.filter_by(id=user_id).first() - - if user: - comment = Comment( - proposal_id=proposal_id, - user_id=user_id, - content=content - ) - db.session.add(comment) - db.session.commit() - dumped_comment = comment_schema.dump(comment) - return dumped_comment, 201 - - else: - return {"message": "No user matching id"}, 404 + comment = Comment( + proposal_id=proposal_id, + user_id=g.current_user.id, + content=content + ) + db.session.add(comment) + db.session.commit() + dumped_comment = comment_schema.dump(comment) + return dumped_comment, 201 else: return {"message": "No proposal matching id"}, 404 @@ -73,8 +68,8 @@ def get_proposals(stage): if stage: proposals = ( Proposal.query.filter_by(stage=stage) - .order_by(Proposal.date_created.desc()) - .all() + .order_by(Proposal.date_created.desc()) + .all() ) else: proposals = Proposal.query.order_by(Proposal.date_created.desc()).all() @@ -83,6 +78,7 @@ def get_proposals(stage): @blueprint.route("/", methods=["POST"]) +@requires_sm @endpoint.api( parameter('crowdFundContractAddress', type=str, required=True), parameter('content', type=str, required=True), @@ -92,7 +88,6 @@ def get_proposals(stage): parameter('team', type=list, required=True) ) def make_proposal(crowd_fund_contract_address, content, title, milestones, category, team): - from grant.user.models import User existing_proposal = Proposal.query.filter_by(proposal_address=crowd_fund_contract_address).first() if existing_proposal: return {"message": "Oops! Something went wrong."}, 409 @@ -187,24 +182,21 @@ def get_proposal_update(proposal_id, update_id): return {"message": "No proposal matching id"}, 404 -# TODO: Add authentication to endpoint @blueprint.route("//updates", methods=["POST"]) +@requires_team_member_auth +@requires_sm @endpoint.api( parameter('title', type=str, required=True), parameter('content', type=str, required=True) ) def post_proposal_update(proposal_id, title, content): - proposal = Proposal.query.filter_by(id=proposal_id).first() - if proposal: - update = ProposalUpdate( - proposal_id=proposal.id, - title=title, - content=content - ) - db.session.add(update) - db.session.commit() + update = ProposalUpdate( + proposal_id=g.current_proposal.id, + title=title, + content=content + ) + db.session.add(update) + db.session.commit() - dumped_update = proposal_update_schema.dump(update) - return dumped_update, 201 - else: - return {"message": "No proposal matching id"}, 404 + dumped_update = proposal_update_schema.dump(update) + return dumped_update, 201 diff --git a/backend/grant/user/models.py b/backend/grant/user/models.py index f7b0aba6..b0d5968e 100644 --- a/backend/grant/user/models.py +++ b/backend/grant/user/models.py @@ -1,3 +1,4 @@ +from sqlalchemy import func from grant.comment.models import Comment from grant.email.models import EmailVerification from grant.extensions import ma, db @@ -57,7 +58,7 @@ class User(db.Model): self.title = title @staticmethod - def create(email_address=None, account_address=None, display_name=None, title=None): + def create(email_address=None, account_address=None, display_name=None, title=None, _send_email=True): user = User( account_address=account_address, email_address=email_address, @@ -72,21 +73,22 @@ class User(db.Model): db.session.add(ev) db.session.commit() - send_email(user.email_address, 'signup', { - 'display_name': user.display_name, - 'confirm_url': make_url(f'/email/verify?code={ev.code}') - }) + if send_email: + send_email(user.email_address, 'signup', { + 'display_name': user.display_name, + 'confirm_url': make_url(f'/email/verify?code={ev.code}') + }) return user @staticmethod - def get_by_email_or_account_address(email_address: str = None, account_address: str = None): + def get_by_identifier(email_address: str = None, account_address: str = None): if not email_address and not account_address: raise ValueError("Either email_address or account_address is required to get a user") return User.query.filter( - (User.account_address == account_address) | - (User.email_address == email_address) + (func.lower(User.account_address) == func.lower(account_address)) | + (func.lower(User.email_address) == func.lower(email_address)) ).first() class UserSchema(ma.Schema): diff --git a/backend/grant/user/views.py b/backend/grant/user/views.py index e81a68c7..64d3757e 100644 --- a/backend/grant/user/views.py +++ b/backend/grant/user/views.py @@ -1,10 +1,9 @@ from flask import Blueprint, g from flask_yoloapi import endpoint, parameter - -from .models import User, SocialMedia, Avatar, users_schema, user_schema, db from grant.proposal.models import Proposal, proposal_team -from grant.utils.auth import requires_sm, verify_signed_auth, BadSignatureException +from grant.utils.auth import requires_sm, requires_same_user_auth, verify_signed_auth, BadSignatureException +from .models import User, SocialMedia, Avatar, users_schema, user_schema, db blueprint = Blueprint('user', __name__, url_prefix='/api/v1/users') @@ -35,7 +34,7 @@ def get_me(): @blueprint.route("/", methods=["GET"]) @endpoint.api() def get_user(user_identity): - user = User.get_by_email_or_account_address(email_address=user_identity, account_address=user_identity) + user = User.get_by_identifier(email_address=user_identity, account_address=user_identity) if user: result = user_schema.dump(user) return result @@ -54,14 +53,14 @@ def get_user(user_identity): parameter('rawTypedData', type=str, required=True) ) def create_user( - account_address, - email_address, - display_name, - title, - signed_message, - raw_typed_data + account_address, + email_address, + display_name, + title, + signed_message, + raw_typed_data ): - existing_user = User.get_by_email_or_account_address(email_address=email_address, account_address=account_address) + existing_user = User.get_by_identifier(email_address=email_address, account_address=account_address) if existing_user: return {"message": "User with that address or email already exists"}, 409 @@ -70,11 +69,11 @@ def create_user( sig_address = verify_signed_auth(signed_message, raw_typed_data) if sig_address.lower() != account_address.lower(): return { - "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( - sig_address=sig_address, - account_address=account_address - ) - }, 400 + "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( + sig_address=sig_address, + account_address=account_address + ) + }, 400 except BadSignatureException: return {"message": "Invalid message signature"}, 400 @@ -88,6 +87,7 @@ def create_user( result = user_schema.dump(user) return result + @blueprint.route("/auth", methods=["POST"]) @endpoint.api( parameter('accountAddress', type=str, required=True), @@ -95,7 +95,7 @@ def create_user( parameter('rawTypedData', type=str, required=True) ) def auth_user(account_address, signed_message, raw_typed_data): - existing_user = User.get_by_email_or_account_address(account_address=account_address) + existing_user = User.get_by_identifier(account_address=account_address) if not existing_user: return {"message": "No user exists with that address"}, 400 @@ -103,27 +103,28 @@ def auth_user(account_address, signed_message, raw_typed_data): sig_address = verify_signed_auth(signed_message, raw_typed_data) if sig_address.lower() != account_address.lower(): return { - "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( - sig_address=sig_address, - account_address=account_address - ) - }, 400 + "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( + sig_address=sig_address, + account_address=account_address + ) + }, 400 except BadSignatureException: return {"message": "Invalid message signature"}, 400 - + return user_schema.dump(existing_user) + @blueprint.route("/", methods=["PUT"]) +@requires_sm +@requires_same_user_auth @endpoint.api( - parameter('displayName', type=str, required=False), - parameter('title', type=str, required=False), - parameter('socialMedias', type=list, required=False), - parameter('avatar', type=dict, required=False), + parameter('displayName', type=str, required=True), + parameter('title', type=str, required=True), + parameter('socialMedias', type=list, required=True), + parameter('avatar', type=dict, required=True) ) def update_user(user_identity, display_name, title, social_medias, avatar): - user = User.get_by_email_or_account_address(email_address=user_identity, account_address=user_identity) - if not user: - return {"message": "User with that address or email not found"}, 404 + user = g.current_user if display_name is not None: user.display_name = display_name @@ -132,11 +133,12 @@ def update_user(user_identity, display_name, title, social_medias, avatar): user.title = title if social_medias is not None: - sm_query = SocialMedia.query.filter_by(user_id=user.id) - sm_query.delete() + SocialMedia.query.filter_by(user_id=user.id).delete() for social_media in social_medias: sm = SocialMedia(social_media_link=social_media.get("link"), user_id=user.id) db.session.add(sm) + else: + SocialMedia.query.filter_by(user_id=user.id).delete() if avatar is not None: Avatar.query.filter_by(user_id=user.id).delete() @@ -144,8 +146,9 @@ def update_user(user_identity, display_name, title, social_medias, avatar): if avatar_link: avatar_obj = Avatar(image_url=avatar_link, user_id=user.id) db.session.add(avatar_obj) + else: + Avatar.query.filter_by(user_id=user.id).delete() db.session.commit() - result = user_schema.dump(user) return result diff --git a/backend/grant/utils/auth.py b/backend/grant/utils/auth.py index 7cf47de3..76e4cf2d 100644 --- a/backend/grant/utils/auth.py +++ b/backend/grant/utils/auth.py @@ -8,6 +8,7 @@ from itsdangerous import SignatureExpired, BadSignature from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from grant.settings import SECRET_KEY, AUTH_URL +from ..proposal.models import Proposal from ..user.models import User TWO_WEEKS = 1209600 @@ -35,6 +36,7 @@ def verify_token(token): class BadSignatureException(Exception): pass + def verify_signed_auth(signature, typed_data): loaded_typed_data = ast.literal_eval(typed_data) url = AUTH_URL + "/message/recover" @@ -43,29 +45,13 @@ def verify_signed_auth(signature, typed_data): response = requests.request("POST", url, data=payload, headers=headers) json_response = response.json() recovered_address = json_response.get('recoveredAddress') - if not recovered_address: raise BadSignatureException("Authorization signature is invalid") return recovered_address - - -def requires_auth(f): - @wraps(f) - def decorated(*args, **kwargs): - token = request.headers.get('Authorization', None) - if token: - string_token = token.encode('ascii', 'ignore') - user = verify_token(string_token) - if user: - g.current_user = user - return f(*args, **kwargs) - - return jsonify(message="Authentication is required to access this resource"), 401 - - return decorated +# Decorator that requires you to have EIP-712 message signature headers for auth def requires_sm(f): @wraps(f) def decorated(*args, **kwargs): @@ -73,13 +59,12 @@ def requires_sm(f): typed_data = request.headers.get('RawTypedData', None) if typed_data and signature: - auth_address = None try: auth_address = verify_signed_auth(signature, typed_data) except BadSignatureException: return jsonify(message="Invalid auth message signature"), 401 - user = User.get_by_email_or_account_address(account_address=auth_address) + user = User.get_by_identifier(account_address=auth_address) if not user: return jsonify(message="No user exists with address: {}".format(auth_address)), 401 @@ -89,3 +74,41 @@ def requires_sm(f): return jsonify(message="Authentication is required to access this resource"), 401 return decorated + + +# Decorator that requires you to be the user you're interacting with +def requires_same_user_auth(f): + @wraps(f) + def decorated(*args, **kwargs): + user_identity = kwargs["user_identity"] + if not user_identity: + return jsonify(message="Decorator requires_same_user_auth requires path variable "), 500 + + user = User.get_by_identifier(account_address=user_identity, email_address=user_identity) + if user.id != g.current_user.id: + return jsonify(message="You are not authorized to modify this user"), 403 + + return f(*args, **kwargs) + + return requires_sm(decorated) + + +# Decorator that requires you to be a team member of a proposal to access +def requires_team_member_auth(f): + @wraps(f) + def decorated(*args, **kwargs): + proposal_id = kwargs["proposal_id"] + if not proposal_id: + return jsonify(message="Decorator requires_team_member_auth requires path variable "), 500 + + proposal = Proposal.query.filter_by(id=proposal_id).first() + if not proposal: + return jsonify(message="No proposal exists with id: {}".format(proposal_id)), 404 + + if not g.current_user in proposal.team: + return jsonify(message="You are not authorized to modify this proposal"), 403 + + g.current_proposal = proposal + return f(*args, **kwargs) + + return requires_sm(decorated) diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 041b948b..359aeea8 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -55,4 +55,4 @@ flask-sendgrid==0.6 sendgrid==5.3.0 # input validation -flask-yolo2API \ No newline at end of file +flask-yolo2API==0.2.4 \ No newline at end of file diff --git a/backend/tests/config.py b/backend/tests/config.py index 24bfb2b6..b2013ccd 100644 --- a/backend/tests/config.py +++ b/backend/tests/config.py @@ -1,6 +1,8 @@ from flask_testing import TestCase -from grant.app import create_app, db +from grant.app import create_app +from grant.user.models import User, SocialMedia, db, Avatar +from .test_data import test_user, message class BaseTestConfig(TestCase): @@ -11,9 +13,36 @@ class BaseTestConfig(TestCase): return app def setUp(self): + db.drop_all() self.app = self.create_app().test_client() db.create_all() def tearDown(self): db.session.remove() db.drop_all() + + +class BaseUserConfig(BaseTestConfig): + headers = { + "MsgSignature": message["sig"], + "RawTypedData": message["data"] + } + + def setUp(self): + super(BaseUserConfig, self).setUp() + self.user = User.create( + account_address=test_user["accountAddress"], + email_address=test_user["emailAddress"], + display_name=test_user["displayName"], + title=test_user["title"], + _send_email=False + ) + sm = SocialMedia(social_media_link=test_user['socialMedias'][0]['link'], user_id=self.user.id) + db.session.add(sm) + avatar = Avatar(image_url=test_user["avatar"]["link"], user_id=self.user.id) + db.session.add(avatar) + db.session.commit() + + def remove_default_user(self): + User.query.filter_by(id=self.user.id).delete() + db.session.commit() diff --git a/backend/tests/proposal/test_api.py b/backend/tests/proposal/test_api.py index 1cc81c86..9c219222 100644 --- a/backend/tests/proposal/test_api.py +++ b/backend/tests/proposal/test_api.py @@ -1,81 +1,43 @@ import json -import random -from grant.proposal.models import Proposal, CATEGORIES -from grant.user.models import User, SocialMedia -from ..config import BaseTestConfig - -milestones = [ - { - "title": "All the money straightaway", - "description": "cool stuff with it", - "date": "June 2019", - "payoutPercent": "100", - "immediatePayout": False - } -] - -team = [ - { - "accountAddress": "0x1", - "displayName": 'Groot', - "emailAddress": 'iam@groot.com', - "title": 'I am Groot!', - "avatar": { - "link": 'https://avatars2.githubusercontent.com/u/1393943?s=400&v=4' - }, - "socialMedias": [ - { - "link": 'https://github.com/groot' - } - ] - } -] - -proposal = { - "team": team, - "crowdFundContractAddress": "0x20000", - "content": "## My Proposal", - "title": "Give Me Money", - "milestones": milestones, - "category": random.choice(CATEGORIES) -} +from grant.proposal.models import Proposal +from grant.user.models import SocialMedia, Avatar +from ..config import BaseUserConfig +from ..test_data import test_proposal -class TestAPI(BaseTestConfig): +class TestAPI(BaseUserConfig): def test_create_new_proposal(self): self.assertIsNone(Proposal.query.filter_by( - proposal_address=proposal["crowdFundContractAddress"] + proposal_address=test_proposal["crowdFundContractAddress"] ).first()) resp = self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), + headers=self.headers, content_type='application/json' ) + self.assertEqual(resp.status_code, 201) proposal_db = Proposal.query.filter_by( - proposal_address=proposal["crowdFundContractAddress"] + proposal_address=test_proposal["crowdFundContractAddress"] ).first() - self.assertEqual(proposal_db.title, proposal["title"]) - - # User - user_db = User.query.filter_by(email_address=team[0]["emailAddress"]).first() - self.assertEqual(user_db.display_name, team[0]["displayName"]) - self.assertEqual(user_db.title, team[0]["title"]) - self.assertEqual(user_db.account_address, team[0]["accountAddress"]) + self.assertEqual(proposal_db.title, test_proposal["title"]) # SocialMedia - social_media_db = SocialMedia.query.filter_by(social_media_link=team[0]["socialMedias"][0]["link"]).first() + social_media_db = SocialMedia.query.filter_by(user_id=self.user.id).first() self.assertTrue(social_media_db) # Avatar - self.assertEqual(user_db.avatar.image_url, team[0]["avatar"]["link"]) + avatar = Avatar.query.filter_by(user_id=self.user.id).first() + self.assertTrue(avatar) def test_create_new_proposal_comment(self): proposal_res = self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), + headers=self.headers, content_type='application/json' ) proposal_json = proposal_res.json @@ -94,15 +56,17 @@ class TestAPI(BaseTestConfig): self.assertTrue(comment_res.json) def test_create_new_proposal_duplicate(self): - proposal_res = self.app.post( + self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), + headers=self.headers, content_type='application/json' ) proposal_res2 = self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), + headers=self.headers, content_type='application/json' ) diff --git a/backend/tests/test_data.py b/backend/tests/test_data.py index cb6d5d07..3e95b3f1 100644 --- a/backend/tests/test_data.py +++ b/backend/tests/test_data.py @@ -1,5 +1,6 @@ import json import random + from grant.proposal.models import CATEGORIES message = { @@ -43,7 +44,7 @@ message = { } } -user = { +test_user = { "accountAddress": '0xcd2a3d9f938e13cd947ec05abc7fe734df8dd826', "displayName": 'Groot', "emailAddress": 'iam@groot.com', @@ -60,7 +61,7 @@ user = { "rawTypedData": json.dumps(message["data"]) } -team = [user] +test_team = [test_user] milestones = [ { @@ -72,11 +73,21 @@ milestones = [ } ] -proposal = { - "team": team, +test_proposal = { + "team": test_team, "crowdFundContractAddress": "0x20000", "content": "## My Proposal", "title": "Give Me Money", "milestones": milestones, "category": random.choice(CATEGORIES) -} \ No newline at end of file +} + +milestones = [ + { + "title": "All the money straightaway", + "description": "cool stuff with it", + "date": "June 2019", + "payoutPercent": "100", + "immediatePayout": False + } +] diff --git a/backend/tests/user/test_required_sm_decorator.py b/backend/tests/user/test_required_sm_decorator.py index edd5f2c5..9d3f2d21 100644 --- a/backend/tests/user/test_required_sm_decorator.py +++ b/backend/tests/user/test_required_sm_decorator.py @@ -1,14 +1,14 @@ import json from ..config import BaseTestConfig -from ..test_data import user, message +from ..test_data import test_user, message class TestRequiredSignedMessageDecorator(BaseTestConfig): def test_required_sm_aborts_without_data_and_sig_headers(self): self.app.post( "/api/v1/users/", - data=json.dumps(user), + data=json.dumps(test_user), content_type='application/json' ) @@ -53,7 +53,7 @@ class TestRequiredSignedMessageDecorator(BaseTestConfig): def test_required_sm_decorator_authorizes_when_recovered_address_matches_existing_user(self): self.app.post( "/api/v1/users/", - data=json.dumps(user), + data=json.dumps(test_user), content_type='application/json' ) @@ -68,4 +68,4 @@ class TestRequiredSignedMessageDecorator(BaseTestConfig): response_json = response.json self.assert200(response) - self.assertEqual(response_json["displayName"], user["displayName"]) + self.assertEqual(response_json["displayName"], test_user["displayName"]) diff --git a/backend/tests/user/test_user_api.py b/backend/tests/user/test_user_api.py index fa0b0af6..2deeae0c 100644 --- a/backend/tests/user/test_user_api.py +++ b/backend/tests/user/test_user_api.py @@ -1,84 +1,101 @@ import copy import json -from grant.proposal.models import Proposal -from grant.user.models import User -from ..config import BaseTestConfig -from ..test_data import team, proposal +from animal_case import animalify from mock import patch +from grant.proposal.models import Proposal +from grant.user.models import User, user_schema +from ..config import BaseUserConfig +from ..test_data import test_team, test_proposal, test_user -class TestAPI(BaseTestConfig): - def test_create_new_user_via_proposal_by_account_address(self): - proposal_by_account = copy.deepcopy(proposal) - del proposal_by_account["team"][0]["emailAddress"] - self.app.post( - "/api/v1/proposals/", - data=json.dumps(proposal_by_account), - content_type='application/json' - ) +class TestAPI(BaseUserConfig): + # TODO create second signed message default user + # @patch('grant.email.send.send_email') + # def test_create_new_user_via_proposal_by_account_address(self, mock_send_email): + # mock_send_email.return_value.ok = True + # self.remove_default_user() + # proposal_by_account = copy.deepcopy(test_proposal) + # del proposal_by_account["team"][0]["emailAddress"] + # + # resp = self.app.post( + # "/api/v1/proposals/", + # data=json.dumps(proposal_by_account), + # headers=self.headers, + # content_type='application/json' + # ) + # + # self.assertEqual(resp, 201) + # + # # User + # user_db = User.query.filter_by(account_address=proposal_by_account["team"][0]["accountAddress"]).first() + # self.assertEqual(user_db.display_name, proposal_by_account["team"][0]["displayName"]) + # self.assertEqual(user_db.title, proposal_by_account["team"][0]["title"]) + # self.assertEqual(user_db.account_address, proposal_by_account["team"][0]["accountAddress"]) - # User - user_db = User.query.filter_by(account_address=proposal_by_account["team"][0]["accountAddress"]).first() - self.assertEqual(user_db.display_name, proposal_by_account["team"][0]["displayName"]) - self.assertEqual(user_db.title, proposal_by_account["team"][0]["title"]) - self.assertEqual(user_db.account_address, proposal_by_account["team"][0]["accountAddress"]) - - def test_create_new_user_via_proposal_by_email(self): - proposal_by_email = copy.deepcopy(proposal) - del proposal_by_email["team"][0]["accountAddress"] - - self.app.post( - "/api/v1/proposals/", - data=json.dumps(proposal_by_email), - content_type='application/json' - ) - - # User - user_db = User.query.filter_by(email_address=proposal_by_email["team"][0]["emailAddress"]).first() - self.assertEqual(user_db.display_name, proposal_by_email["team"][0]["displayName"]) - self.assertEqual(user_db.title, proposal_by_email["team"][0]["title"]) + # TODO create second signed message default user + # def test_create_new_user_via_proposal_by_email(self): + # self.remove_default_user() + # proposal_by_email = copy.deepcopy(test_proposal) + # del proposal_by_email["team"][0]["accountAddress"] + # + # resp = self.app.post( + # "/api/v1/proposals/", + # data=json.dumps(proposal_by_email), + # headers=self.headers, + # content_type='application/json' + # ) + # + # self.assertEqual(resp, 201) + # + # # User + # user_db = User.query.filter_by(email_address=proposal_by_email["team"][0]["emailAddress"]).first() + # self.assertEqual(user_db.display_name, proposal_by_email["team"][0]["displayName"]) + # self.assertEqual(user_db.title, proposal_by_email["team"][0]["title"]) def test_associate_user_via_proposal_by_email(self): - proposal_by_email = copy.deepcopy(proposal) + proposal_by_email = copy.deepcopy(test_proposal) del proposal_by_email["team"][0]["accountAddress"] - self.app.post( + resp = self.app.post( "/api/v1/proposals/", data=json.dumps(proposal_by_email), + headers=self.headers, content_type='application/json' ) + self.assertEqual(resp.status_code, 201) # User user_db = User.query.filter_by(email_address=proposal_by_email["team"][0]["emailAddress"]).first() self.assertEqual(user_db.display_name, proposal_by_email["team"][0]["displayName"]) self.assertEqual(user_db.title, proposal_by_email["team"][0]["title"]) proposal_db = Proposal.query.filter_by( - proposal_address=proposal["crowdFundContractAddress"] + proposal_address=test_proposal["crowdFundContractAddress"] ).first() self.assertEqual(proposal_db.team[0].id, user_db.id) def test_associate_user_via_proposal_by_email_when_user_already_exists(self): - proposal_by_email = copy.deepcopy(proposal) - del proposal_by_email["team"][0]["accountAddress"] + proposal_by_user_email = copy.deepcopy(test_proposal) + del proposal_by_user_email["team"][0]["accountAddress"] - self.app.post( + resp = self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal_by_email), + data=json.dumps(proposal_by_user_email), + headers=self.headers, content_type='application/json' ) + self.assertEqual(resp.status_code, 201) # User - user_db = User.query.filter_by(email_address=proposal_by_email["team"][0]["emailAddress"]).first() - self.assertEqual(user_db.display_name, proposal_by_email["team"][0]["displayName"]) - self.assertEqual(user_db.title, proposal_by_email["team"][0]["title"]) + self.assertEqual(self.user.display_name, proposal_by_user_email["team"][0]["displayName"]) + self.assertEqual(self.user.title, proposal_by_user_email["team"][0]["title"]) proposal_db = Proposal.query.filter_by( - proposal_address=proposal["crowdFundContractAddress"] + proposal_address=test_proposal["crowdFundContractAddress"] ).first() - self.assertEqual(proposal_db.team[0].id, user_db.id) + self.assertEqual(proposal_db.team[0].id, self.user.id) - new_proposal_by_email = copy.deepcopy(proposal) + new_proposal_by_email = copy.deepcopy(test_proposal) new_proposal_by_email["crowdFundContractAddress"] = "0x2222" del new_proposal_by_email["team"][0]["accountAddress"] @@ -92,14 +109,14 @@ class TestAPI(BaseTestConfig): self.assertEqual(user_db.display_name, new_proposal_by_email["team"][0]["displayName"]) self.assertEqual(user_db.title, new_proposal_by_email["team"][0]["title"]) proposal_db = Proposal.query.filter_by( - proposal_address=proposal["crowdFundContractAddress"] + proposal_address=test_proposal["crowdFundContractAddress"] ).first() self.assertEqual(proposal_db.team[0].id, user_db.id) def test_get_all_users(self): self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), content_type='application/json' ) users_get_resp = self.app.get( @@ -107,18 +124,17 @@ class TestAPI(BaseTestConfig): ) users_json = users_get_resp.json - print(users_json) - self.assertEqual(users_json[0]["displayName"], team[0]["displayName"]) + self.assertEqual(users_json[0]["displayName"], test_team[0]["displayName"]) def test_get_user_associated_with_proposal(self): self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), content_type='application/json' ) data = { - 'proposalId': proposal["crowdFundContractAddress"] + 'proposalId': test_proposal["crowdFundContractAddress"] } users_get_resp = self.app.get( @@ -127,25 +143,25 @@ class TestAPI(BaseTestConfig): ) users_json = users_get_resp.json - self.assertEqual(users_json[0]["avatar"]["imageUrl"], team[0]["avatar"]["link"]) - self.assertEqual(users_json[0]["socialMedias"][0]["socialMediaLink"], team[0]["socialMedias"][0]["link"]) - self.assertEqual(users_json[0]["displayName"], team[0]["displayName"]) + self.assertEqual(users_json[0]["avatar"]["imageUrl"], test_team[0]["avatar"]["link"]) + self.assertEqual(users_json[0]["socialMedias"][0]["socialMediaLink"], test_team[0]["socialMedias"][0]["link"]) + self.assertEqual(users_json[0]["displayName"], test_user["displayName"]) def test_get_single_user(self): self.app.post( "/api/v1/proposals/", - data=json.dumps(proposal), + data=json.dumps(test_proposal), content_type='application/json' ) users_get_resp = self.app.get( - "/api/v1/users/{}".format(proposal["team"][0]["emailAddress"]) + "/api/v1/users/{}".format(test_proposal["team"][0]["emailAddress"]) ) users_json = users_get_resp.json - self.assertEqual(users_json["avatar"]["imageUrl"], team[0]["avatar"]["link"]) - self.assertEqual(users_json["socialMedias"][0]["socialMediaLink"], team[0]["socialMedias"][0]["link"]) - self.assertEqual(users_json["displayName"], team[0]["displayName"]) + self.assertEqual(users_json["avatar"]["imageUrl"], test_team[0]["avatar"]["link"]) + self.assertEqual(users_json["socialMedias"][0]["socialMediaLink"], test_team[0]["socialMedias"][0]["link"]) + self.assertEqual(users_json["displayName"], test_team[0]["displayName"]) @patch('grant.email.send.send_email') def test_create_user(self, mock_send_email): @@ -153,15 +169,15 @@ class TestAPI(BaseTestConfig): self.app.post( "/api/v1/users/", - data=json.dumps(team[0]), + data=json.dumps(test_team[0]), content_type='application/json' ) # User - user_db = User.get_by_email_or_account_address(account_address=team[0]["accountAddress"]) - self.assertEqual(user_db.display_name, team[0]["displayName"]) - self.assertEqual(user_db.title, team[0]["title"]) - self.assertEqual(user_db.account_address, team[0]["accountAddress"]) + user_db = User.get_by_identifier(account_address=test_team[0]["accountAddress"]) + self.assertEqual(user_db.display_name, test_team[0]["displayName"]) + self.assertEqual(user_db.title, test_team[0]["title"]) + self.assertEqual(user_db.account_address, test_team[0]["accountAddress"]) @patch('grant.email.send.send_email') def test_create_user_duplicate_400(self, mock_send_email): @@ -170,64 +186,28 @@ class TestAPI(BaseTestConfig): response = self.app.post( "/api/v1/users/", - data=json.dumps(team[0]), + data=json.dumps(test_team[0]), content_type='application/json' ) self.assertEqual(response.status_code, 409) def test_update_user_remove_social_and_avatar(self): - self.app.post( - "/api/v1/proposals/", - data=json.dumps(proposal), - content_type='application/json' - ) - - updated_user = copy.deepcopy(team[0]) - updated_user['displayName'] = 'Billy' - updated_user['title'] = 'Commander' - updated_user['socialMedias'] = [] - updated_user['avatar'] = {} + updated_user = animalify(copy.deepcopy(user_schema.dump(self.user))) + updated_user["displayName"] = 'new display name' + updated_user["avatar"] = None + updated_user["socialMedias"] = None user_update_resp = self.app.put( - "/api/v1/users/{}".format(proposal["team"][0]["accountAddress"]), + "/api/v1/users/{}".format(self.user.account_address), data=json.dumps(updated_user), + headers=self.headers, content_type='application/json' ) + self.assert200(user_update_resp) - users_json = user_update_resp.json - self.assertFalse(users_json["avatar"]) - self.assertFalse(len(users_json["socialMedias"])) - self.assertEqual(users_json["displayName"], updated_user["displayName"]) - self.assertEqual(users_json["title"], updated_user["title"]) - - def test_update_user(self): - self.app.post( - "/api/v1/proposals/", - data=json.dumps(proposal), - content_type='application/json' - ) - - updated_user = copy.deepcopy(team[0]) - updated_user['displayName'] = 'Billy' - updated_user['title'] = 'Commander' - updated_user['socialMedias'] = [ - { - "link": "https://github.com/billyman" - } - ] - updated_user['avatar'] = { - "link": "https://x.io/avatar.png" - } - - user_update_resp = self.app.put( - "/api/v1/users/{}".format(proposal["team"][0]["accountAddress"]), - data=json.dumps(updated_user), - content_type='application/json' - ) - - users_json = user_update_resp.json - self.assertEqual(users_json["avatar"]["imageUrl"], updated_user["avatar"]["link"]) - self.assertEqual(users_json["socialMedias"][0]["socialMediaLink"], updated_user["socialMedias"][0]["link"]) - self.assertEqual(users_json["displayName"], updated_user["displayName"]) - self.assertEqual(users_json["title"], updated_user["title"]) + user_json = user_update_resp.json + self.assertFalse(user_json["avatar"]) + self.assertFalse(len(user_json["socialMedias"])) + self.assertEqual(user_json["displayName"], updated_user["displayName"]) + self.assertEqual(user_json["title"], updated_user["title"]) diff --git a/frontend/client/store/configure.tsx b/frontend/client/store/configure.tsx index 09466a26..13daf97e 100644 --- a/frontend/client/store/configure.tsx +++ b/frontend/client/store/configure.tsx @@ -6,6 +6,7 @@ import { composeWithDevTools } from 'redux-devtools-extension'; import { persistStore, Persistor } from 'redux-persist'; import rootReducer, { AppState, combineInitialState } from './reducers'; import rootSaga from './sagas'; +import axios from 'api/axios'; const sagaMiddleware = createSagaMiddleware(); @@ -43,5 +44,24 @@ export function configureStore(initialState: Partial = combineInitialS } } + // Any global listeners to the store go here + let prevState = store.getState(); + store.subscribe(() => { + const state = store.getState(); + + // Setup the API with auth credentials whenever they change + const { authSignature } = state.auth; + if (authSignature !== prevState.auth.authSignature) { + axios.defaults.headers.common.MsgSignature = authSignature + ? authSignature.signedMessage + : undefined; + axios.defaults.headers.common.RawTypedData = authSignature + ? JSON.stringify(authSignature.rawTypedData) + : undefined; + } + + prevState = state; + }); + return { store, persistor }; } From 50f99dd298247f478fe1d7842dc7da2cdf472214 Mon Sep 17 00:00:00 2001 From: William O'Beirne Date: Tue, 13 Nov 2018 12:47:33 -0500 Subject: [PATCH 02/17] Add nowignore (#204) --- frontend/.nowignore | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 frontend/.nowignore diff --git a/frontend/.nowignore b/frontend/.nowignore new file mode 100644 index 00000000..849a749a --- /dev/null +++ b/frontend/.nowignore @@ -0,0 +1,4 @@ +node_modules +stories +.storybook +dist \ No newline at end of file From 3d34daba5065e76fcd23643375fd411c6fadd1da Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Tue, 13 Nov 2018 13:01:51 -0500 Subject: [PATCH 03/17] add npm command for now deployments --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index b640e0eb..3537cf85 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,6 +9,7 @@ "dev": "rm -rf ./node_modules/.cache && cross-env NODE_ENV=development BACKEND_URL=http://localhost:5000 node bin/dev.js", "lint": "tslint --project ./tsconfig.json --config ./tslint.json -e \"**/build/**\"", "start": "NODE_ENV=production node ./build/server/server.js", + "now": "npm run build && now -e BACKEND_URL=https://grant-stage.herokuapp.com", "tsc": "tsc", "link-contracts": "cd client/lib && ln -s ../../build/contracts contracts", "ganache": "ganache-cli -b 5", From 8c2e43c51b18d1dd2170f40498a1d8d6dfd207b2 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Tue, 13 Nov 2018 22:45:55 -0500 Subject: [PATCH 04/17] Update Flask-YoloAPI (#207) * Update to latest flask-yolo2api * Fix related tests --- backend/requirements/prod.txt | 2 +- backend/tests/user/test_user_api.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 359aeea8..428ccba8 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -55,4 +55,4 @@ flask-sendgrid==0.6 sendgrid==5.3.0 # input validation -flask-yolo2API==0.2.4 \ No newline at end of file +flask-yolo2API==0.2.6 \ No newline at end of file diff --git a/backend/tests/user/test_user_api.py b/backend/tests/user/test_user_api.py index 2deeae0c..fee1a74a 100644 --- a/backend/tests/user/test_user_api.py +++ b/backend/tests/user/test_user_api.py @@ -2,10 +2,10 @@ import copy import json from animal_case import animalify -from mock import patch - from grant.proposal.models import Proposal from grant.user.models import User, user_schema +from mock import patch + from ..config import BaseUserConfig from ..test_data import test_team, test_proposal, test_user @@ -195,8 +195,8 @@ class TestAPI(BaseUserConfig): def test_update_user_remove_social_and_avatar(self): updated_user = animalify(copy.deepcopy(user_schema.dump(self.user))) updated_user["displayName"] = 'new display name' - updated_user["avatar"] = None - updated_user["socialMedias"] = None + updated_user["avatar"] = {} + updated_user["socialMedias"] = [] user_update_resp = self.app.put( "/api/v1/users/{}".format(self.user.account_address), @@ -211,3 +211,15 @@ class TestAPI(BaseUserConfig): self.assertFalse(len(user_json["socialMedias"])) self.assertEqual(user_json["displayName"], updated_user["displayName"]) self.assertEqual(user_json["title"], updated_user["title"]) + + def test_update_user_400_when_required_param_not_passed(self): + updated_user = animalify(copy.deepcopy(user_schema.dump(self.user))) + updated_user["displayName"] = 'new display name' + del updated_user["avatar"] + user_update_resp = self.app.put( + "/api/v1/users/{}".format(self.user.account_address), + data=json.dumps(updated_user), + headers=self.headers, + content_type='application/json' + ) + self.assert400(user_update_resp) From 03de8c2543082fc15ae5ca32423e1f1b6be8017b Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 14 Nov 2018 08:30:18 -0600 Subject: [PATCH 05/17] Backend Proposal Reads Pt. 1 (#198) * web3 flask + read proposal * tests * use build/contracts indtead of build/abi * fail if endpoint not set * batched calls --- backend/.env.example | 5 +- backend/grant/app.py | 3 +- backend/grant/extensions.py | 2 + backend/grant/settings.py | 4 +- backend/grant/web3/__init__.py | 0 backend/grant/web3/proposal.py | 124 +++++++++++++++++++++ backend/grant/web3/util.py | 77 +++++++++++++ backend/requirements/dev.txt | 1 + backend/requirements/prod.txt | 7 +- backend/tests/settings.py | 2 + backend/tests/web3/__init__.py | 0 backend/tests/web3/test_proposal_read.py | 132 +++++++++++++++++++++++ 12 files changed, 353 insertions(+), 4 deletions(-) create mode 100644 backend/grant/web3/__init__.py create mode 100644 backend/grant/web3/proposal.py create mode 100644 backend/grant/web3/util.py create mode 100644 backend/tests/web3/__init__.py create mode 100644 backend/tests/web3/test_proposal_read.py diff --git a/backend/.env.example b/backend/.env.example index 2c0ef4a8..cde71398 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -5,4 +5,7 @@ SITE_URL="https://grant.io" # No trailing slash DATABASE_URL="sqlite:////tmp/dev.db" REDISTOGO_URL="redis://localhost:6379" SECRET_KEY="not-so-secret" -SENDGRID_API_KEY="optional, but emails won't send without it" \ No newline at end of file +SENDGRID_API_KEY="optional, but emails won't send without it" +# for ropsten use the following +# ETHEREUM_ENDPOINT_URI = "https://ropsten.infura.io/API_KEY" +ETHEREUM_ENDPOINT_URI = "http://localhost:8545" \ No newline at end of file diff --git a/backend/grant/app.py b/backend/grant/app.py index cf17fdd3..18916a25 100644 --- a/backend/grant/app.py +++ b/backend/grant/app.py @@ -4,7 +4,7 @@ from flask import Flask from flask_cors import CORS from grant import commands, proposal, user, comment, milestone, admin, email -from grant.extensions import bcrypt, migrate, db, ma, mail +from grant.extensions import bcrypt, migrate, db, ma, mail, web3 def create_app(config_object="grant.settings"): @@ -25,6 +25,7 @@ def register_extensions(app): migrate.init_app(app, db) ma.init_app(app) mail.init_app(app) + web3.init_app(app) CORS(app) return None diff --git a/backend/grant/extensions.py b/backend/grant/extensions.py index ba89d3fe..2dc1f7e9 100644 --- a/backend/grant/extensions.py +++ b/backend/grant/extensions.py @@ -5,9 +5,11 @@ from flask_marshmallow import Marshmallow from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from flask_sendgrid import SendGrid +from flask_web3 import FlaskWeb3 bcrypt = Bcrypt() db = SQLAlchemy() migrate = Migrate() ma = Marshmallow() mail = SendGrid() +web3 = FlaskWeb3() diff --git a/backend/grant/settings.py b/backend/grant/settings.py index c9f64137..a818349f 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -24,4 +24,6 @@ DEBUG_TB_INTERCEPT_REDIRECTS = False CACHE_TYPE = "simple" # Can be "memcached", "redis", etc. SQLALCHEMY_TRACK_MODIFICATIONS = False SENDGRID_API_KEY = env.str("SENDGRID_API_KEY", default="") -SENDGRID_DEFAULT_FROM = "noreply@grant.io" \ No newline at end of file +SENDGRID_DEFAULT_FROM = "noreply@grant.io" +ETHEREUM_PROVIDER = "http" +ETHEREUM_ENDPOINT_URI = env.str("ETHEREUM_ENDPOINT_URI") diff --git a/backend/grant/web3/__init__.py b/backend/grant/web3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/grant/web3/proposal.py b/backend/grant/web3/proposal.py new file mode 100644 index 00000000..5102a40a --- /dev/null +++ b/backend/grant/web3/proposal.py @@ -0,0 +1,124 @@ +import json +import time +from flask_web3 import current_web3 +from .util import batch_call, call_array + + +crowd_fund_abi = None + + +def get_crowd_fund_abi(): + global crowd_fund_abi + if crowd_fund_abi: + return crowd_fund_abi + with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: + crowd_fund_abi = json.load(read_file)['abi'] + return crowd_fund_abi + + +def read_proposal(address): + crowd_fund_abi = get_crowd_fund_abi() + contract = current_web3.eth.contract(address=address, abi=crowd_fund_abi) + + crowd_fund = {} + methods = [ + "immediateFirstMilestonePayout", + "raiseGoal", + "amountVotingForRefund", + "beneficiary", + "deadline", + "milestoneVotingPeriod", + "frozen", + "isRaiseGoalReached", + ] + + # batched + calls = list(map(lambda x: [x, None], methods)) + crowd_fund = batch_call(current_web3, address, crowd_fund_abi, calls, contract) + + # balance (sync) + crowd_fund['balance'] = current_web3.eth.getBalance(address) + + # arrays (sync) + crowd_fund['milestones'] = call_array(contract.functions.milestones) + crowd_fund['trustees'] = call_array(contract.functions.trustees) + contributor_list = call_array(contract.functions.contributorList) + + # make milestones + def make_ms(enum_ms): + index = enum_ms[0] + ms = enum_ms[1] + is_immediate = index == 0 and crowd_fund['immediateFirstMilestonePayout'] + deadline = ms[2] * 1000 + amount_against = ms[1] + pct_against = round(amount_against * 100 / crowd_fund['raiseGoal']) + paid = ms[3] + state = 'WAITING' + if crowd_fund["isRaiseGoalReached"] and deadline > 0: + if paid: + state = 'PAID' + elif deadline > time.time() * 1000: + state = 'ACTIVE' + elif pct_against >= 50: + state = 'REJECTED' + else: + state = 'PAID' + return { + "index": index, + "state": state, + "amount": str(ms[0]), + "amountAgainstPayout": str(amount_against), + "percentAgainstPayout": pct_against, + "payoutRequestVoteDeadline": deadline, + "isPaid": paid, + "isImmediatePayout": is_immediate + } + + crowd_fund['milestones'] = list(map(make_ms, enumerate(crowd_fund['milestones']))) + + # contributor calls (batched) + contributors_calls = list(map(lambda c_addr: ['contributors', (c_addr,)], contributor_list)) + contrib_votes_calls = [] + for c_addr in contributor_list: + for msi in range(len(crowd_fund['milestones'])): + contrib_votes_calls.append(['getContributorMilestoneVote', (c_addr, msi)]) + derived_calls = contributors_calls + contrib_votes_calls + derived_results = batch_call(current_web3, address, crowd_fund_abi, derived_calls, contract) + + # make contributors + contributors = [] + for contrib_address in contributor_list: + contrib_raw = derived_results['contributors' + contrib_address] + + def get_no_vote(i): + return derived_results['getContributorMilestoneVote' + contrib_address + str(i)] + no_votes = list(map(get_no_vote, range(len(crowd_fund['milestones'])))) + + contrib = { + "address": contrib_address, + "contributionAmount": str(contrib_raw[0]), + "refundVote": contrib_raw[1], + "refunded": contrib_raw[2], + "milestoneNoVotes": no_votes, + } + contributors.append(contrib) + crowd_fund['contributors'] = contributors + + # massage names and numbers + crowd_fund['target'] = crowd_fund.pop('raiseGoal') + crowd_fund['isFrozen'] = crowd_fund.pop('frozen') + crowd_fund['deadline'] = crowd_fund['deadline'] * 1000 + crowd_fund['milestoneVotingPeriod'] = crowd_fund['milestoneVotingPeriod'] * 60 * 1000 + if crowd_fund['isRaiseGoalReached']: + crowd_fund['funded'] = crowd_fund['target'] + crowd_fund['percentFunded'] = 100 + else: + crowd_fund['funded'] = crowd_fund['balance'] + crowd_fund['percentFunded'] = round(crowd_fund['balance'] * 100 / crowd_fund['target']) + crowd_fund['percentVotingForRefund'] = round(crowd_fund['amountVotingForRefund'] * 100 / crowd_fund['target']) + + bn_keys = ['amountVotingForRefund', 'balance', 'funded', 'target'] + for k in bn_keys: + crowd_fund[k] = str(crowd_fund[k]) + + return crowd_fund diff --git a/backend/grant/web3/util.py b/backend/grant/web3/util.py new file mode 100644 index 00000000..1844f8d3 --- /dev/null +++ b/backend/grant/web3/util.py @@ -0,0 +1,77 @@ +import requests +from web3.providers.base import JSONBaseProvider +from web3.utils.contracts import prepare_transaction, find_matching_fn_abi +from web3 import EthereumTesterProvider +from grant.settings import ETHEREUM_ENDPOINT_URI +from hexbytes import HexBytes +from eth_abi import decode_abi +from web3.utils.abi import get_abi_output_types, map_abi_data +from web3.utils.normalizers import BASE_RETURN_NORMALIZERS + + +def call_array(fn): + results = [] + no_error = True + index = 0 + while no_error: + try: + results.append(fn(index).call()) + index += 1 + except Exception: + no_error = False + return results + + +def make_key(method, args): + return method + "".join(list(map(lambda z: str(z), args))) if args else method + + +def tester_batch(calls, contract): + # fallback to sync calls for eth-tester instead of implementing batching + results = {} + for call in calls: + method, args = call + args = args if args else () + results[make_key(method, args)] = contract.functions[method](*args).call() + return results + + +def batch(node_address, params): + base_provider = JSONBaseProvider() + request_data = b'[' + b','.join( + [base_provider.encode_rpc_request('eth_call', p) for p in params] + ) + b']' + r = requests.post(node_address, data=request_data, headers={'Content-Type': 'application/json'}) + responses = base_provider.decode_rpc_response(r.content) + return responses + + +def batch_call(w3, address, abi, calls, contract): + # TODO: use web3py batching once its added + # this implements batched rpc calls using web3py helper methods + # web3py doesn't support this out-of-box yet + # issue: https://github.com/ethereum/web3.py/issues/832 + if type(w3.providers[0]) is EthereumTesterProvider: + return tester_batch(calls, contract) + inputs = [] + for c in calls: + name, args = c + tx = {"from": w3.eth.defaultAccount, "to": address} + prepared = prepare_transaction(address, w3, name, abi, None, tx, args) + inputs.append([prepared, 'latest']) + responses = batch(ETHEREUM_ENDPOINT_URI, inputs) + results = {} + for r in zip(calls, responses): + result = HexBytes(r[1]['result']) + fn_id, args = r[0] + fn_abi = find_matching_fn_abi(abi, fn_id, args) + output_types = get_abi_output_types(fn_abi) + output_data = decode_abi(output_types, result) + normalized_data = map_abi_data(BASE_RETURN_NORMALIZERS, output_types, output_data) + key = make_key(fn_id, args) + if len(normalized_data) == 1: + results[key] = normalized_data[0] + else: + results[key] = normalized_data + + return results diff --git a/backend/requirements/dev.txt b/backend/requirements/dev.txt index 6c3da7e4..533f62c8 100644 --- a/backend/requirements/dev.txt +++ b/backend/requirements/dev.txt @@ -5,6 +5,7 @@ pytest==3.7.1 WebTest==2.0.30 factory-boy==2.11.1 +eth-tester[py-evm]==0.1.0b33 # Lint and code style flake8==3.5.0 diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 428ccba8..140120bd 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -55,4 +55,9 @@ flask-sendgrid==0.6 sendgrid==5.3.0 # input validation -flask-yolo2API==0.2.6 \ No newline at end of file +flask-yolo2API==0.2.6 + +#web3 +flask-web3==0.1.1 +web3==4.8.1 + diff --git a/backend/tests/settings.py b/backend/tests/settings.py index 0a298ac4..0e2ee7e3 100644 --- a/backend/tests/settings.py +++ b/backend/tests/settings.py @@ -8,3 +8,5 @@ DEBUG_TB_ENABLED = False CACHE_TYPE = 'simple' # Can be "memcached", "redis", etc. SQLALCHEMY_TRACK_MODIFICATIONS = False WTF_CSRF_ENABLED = False # Allows form testing +ETHEREUM_PROVIDER = "test" +ETHEREUM_ENDPOINT_URI = "" diff --git a/backend/tests/web3/__init__.py b/backend/tests/web3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/tests/web3/test_proposal_read.py b/backend/tests/web3/test_proposal_read.py new file mode 100644 index 00000000..22528221 --- /dev/null +++ b/backend/tests/web3/test_proposal_read.py @@ -0,0 +1,132 @@ +import copy +import json +import time + +from grant.extensions import web3 +from ..config import BaseTestConfig +from grant.web3.proposal import read_proposal +from flask_web3 import current_web3 +import eth_tester.backends.pyevm.main as py_evm_main + +# increase gas limit on eth-tester +# https://github.com/ethereum/web3.py/issues/1013 +# https://gitter.im/ethereum/py-evm?at=5b7eb68c4be56c5918854337 +py_evm_main.GENESIS_GAS_LIMIT = 10000000 + + +class TestWeb3ProposalRead(BaseTestConfig): + def create_app(self): + self.real_app = BaseTestConfig.create_app(self) + return self.real_app + + def setUp(self): + BaseTestConfig.setUp(self) + # the following will properly configure web3 with test config + web3.init_app(self.real_app) + with open("../contract/build/contracts/CrowdFundFactory.json", "r") as read_file: + crowd_fund_factory_json = json.load(read_file) + with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: + self.crowd_fund_json = json.load(read_file) + current_web3.eth.defaultAccount = current_web3.eth.accounts[0] + CrowdFundFactory = current_web3.eth.contract( + abi=crowd_fund_factory_json['abi'], bytecode=crowd_fund_factory_json['bytecode']) + tx_hash = CrowdFundFactory.constructor().transact() + tx_receipt = current_web3.eth.waitForTransactionReceipt(tx_hash) + self.crowd_fund_factory = current_web3.eth.contract( + address=tx_receipt.contractAddress, + abi=crowd_fund_factory_json['abi'] + ) + + def get_mock_proposal_read(self, contributors=[]): + mock_proposal_read = { + "immediateFirstMilestonePayout": True, + "amountVotingForRefund": "0", + "beneficiary": current_web3.eth.accounts[0], + # "deadline": 1541706179000, + "milestoneVotingPeriod": 3600000, + "isRaiseGoalReached": False, + "balance": "0", + "milestones": [ + { + "index": 0, + "state": "WAITING", + "amount": "5000000000000000000", + "amountAgainstPayout": "0", + "percentAgainstPayout": 0, + "payoutRequestVoteDeadline": 0, + "isPaid": False, + "isImmediatePayout": True + } + ], + "trustees": [ + current_web3.eth.accounts[0] + ], + "contributors": [], + "target": "5000000000000000000", + "isFrozen": False, + "funded": "0", + "percentFunded": 0, + "percentVotingForRefund": 0 + } + for c in contributors: + mock_proposal_read['contributors'].append({ + "address": current_web3.eth.accounts[c[0]], + "contributionAmount": str(c[1] * 1000000000000000000), + "refundVote": False, + "refunded": False, + "milestoneNoVotes": [ + False + ] + }) + return mock_proposal_read + + def create_crowd_fund(self): + tx_hash = self.crowd_fund_factory.functions.createCrowdFund( + 5000000000000000000, # ethAmount + current_web3.eth.accounts[0], # payout + [current_web3.eth.accounts[0]], # trustees + [5000000000000000000], # milestone amounts + 60, # duration (minutes) + 60, # voting period (minutes) + True # immediate first milestone payout + ).transact() + tx_receipt = current_web3.eth.waitForTransactionReceipt(tx_hash) + tx_events = self.crowd_fund_factory.events.ContractCreated().processReceipt(tx_receipt) + contract_address = tx_events[0]['args']['newAddress'] + return contract_address + + def fund_crowd_fund(self, address): + contract = current_web3.eth.contract(address=address, abi=self.crowd_fund_json['abi']) + accts = current_web3.eth.accounts + for c in [[5, 1], [6, 1], [7, 3]]: + tx_hash = contract.functions.contribute().transact({ + "from": accts[c[0]], + "value": c[1] * 1000000000000000000 + }) + current_web3.eth.waitForTransactionReceipt(tx_hash) + + def test_proposal_read_new(self): + contract_address = self.create_crowd_fund() + proposal_read = read_proposal(contract_address) + deadline = proposal_read.pop('deadline') + deadline_diff = deadline - time.time() * 1000 + self.assertGreater(60000, deadline_diff) + self.assertGreater(deadline_diff, 58000) + self.maxDiff = None + self.assertEqual(proposal_read, self.get_mock_proposal_read()) + + def test_proposal_funded(self): + contract_address = self.create_crowd_fund() + self.fund_crowd_fund(contract_address) + proposal_read = read_proposal(contract_address) + expected = self.get_mock_proposal_read([[5, 1], [6, 1], [7, 3]]) + expected['funded'] = expected['target'] + expected['balance'] = expected['target'] + expected['isRaiseGoalReached'] = True + expected['percentFunded'] = 100 + deadline = proposal_read.pop('deadline') + deadline_diff = deadline - time.time() * 1000 + self.assertGreater(60000, deadline_diff) + self.assertGreater(deadline_diff, 50000) + self.maxDiff = None + self.assertEqual(proposal_read, expected) From b177e7efa97555efe7a625a2d79ca967602556a5 Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 14 Nov 2018 16:24:56 -0600 Subject: [PATCH 06/17] Backend Proposal Reads Pt. 2 (#209) * web3 flask + read proposal * tests * use build/contracts indtead of build/abi * fail if endpoint not set * batched calls * add web3 read to GET proposal(s) endpoints * basic integration of BE crowdFund data into FE * handle dead contracts & omit on FE * allow web3-free viewing & move crowdFundContract out of redux store * upgrade flask-yolo2API to 0.2.6 * MetaMaskRequiredButton + use it in CampaignBlock * convert to tuples * farewell tuples * flter dead proposals on BE * give test_proposal_funded deadline more time --- backend/grant/proposal/views.py | 15 +- backend/grant/web3/proposal.py | 9 +- backend/grant/web3/util.py | 9 ++ backend/requirements/prod.txt | 1 - backend/tests/web3/test_proposal_read.py | 10 +- frontend/client/Routes.tsx | 4 +- frontend/client/api/api.ts | 11 +- .../MetaMaskRequiredButton/index.less | 32 ++++ .../MetaMaskRequiredButton/index.tsx | 82 +++++++++++ .../Proposal/CampaignBlock/index.tsx | 106 +++++++------- frontend/client/components/Proposal/index.tsx | 30 +--- .../Proposals/ProposalCard/index.tsx | 138 +++++++----------- .../client/components/Proposals/index.tsx | 7 +- frontend/client/lib/crowdFundContracts.ts | 24 +++ frontend/client/lib/getWeb3.ts | 5 - frontend/client/modules/create/utils.ts | 1 - frontend/client/modules/proposals/actions.ts | 64 +------- frontend/client/modules/web3/actions.ts | 41 +++++- frontend/client/utils/api.ts | 35 ++++- frontend/stories/props.tsx | 2 +- frontend/types/proposal.ts | 1 - 21 files changed, 365 insertions(+), 262 deletions(-) create mode 100644 frontend/client/components/MetaMaskRequiredButton/index.less create mode 100644 frontend/client/components/MetaMaskRequiredButton/index.tsx create mode 100644 frontend/client/lib/crowdFundContracts.ts diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index 7213e32b..bafc9caa 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -8,6 +8,7 @@ from grant.comment.models import Comment, comment_schema from grant.milestone.models import Milestone from grant.user.models import User, SocialMedia, Avatar from grant.utils.auth import requires_sm, requires_team_member_auth +from grant.web3.proposal import read_proposal from .models import Proposal, proposals_schema, proposal_schema, ProposalUpdate, proposal_update_schema, db blueprint = Blueprint("proposal", __name__, url_prefix="/api/v1/proposals") @@ -19,6 +20,10 @@ def get_proposal(proposal_id): proposal = Proposal.query.filter_by(id=proposal_id).first() if proposal: dumped_proposal = proposal_schema.dump(proposal) + proposal_contract = read_proposal(dumped_proposal['proposal_address']) + if not proposal_contract: + return {"message": "Proposal retired"}, 404 + dumped_proposal['crowd_fund'] = proposal_contract return dumped_proposal else: return {"message": "No proposal matching id"}, 404 @@ -68,13 +73,17 @@ def get_proposals(stage): if stage: proposals = ( Proposal.query.filter_by(stage=stage) - .order_by(Proposal.date_created.desc()) - .all() + .order_by(Proposal.date_created.desc()) + .all() ) else: proposals = Proposal.query.order_by(Proposal.date_created.desc()).all() dumped_proposals = proposals_schema.dump(proposals) - return dumped_proposals + for p in dumped_proposals: + proposal_contract = read_proposal(p['proposal_address']) + p['crowd_fund'] = proposal_contract + filtered_proposals = list(filter(lambda p: p['crowd_fund'] is not None, dumped_proposals)) + return filtered_proposals @blueprint.route("/", methods=["POST"]) diff --git a/backend/grant/web3/proposal.py b/backend/grant/web3/proposal.py index 5102a40a..13859163 100644 --- a/backend/grant/web3/proposal.py +++ b/backend/grant/web3/proposal.py @@ -1,7 +1,7 @@ import json import time from flask_web3 import current_web3 -from .util import batch_call, call_array +from .util import batch_call, call_array, RpcError crowd_fund_abi = None @@ -17,6 +17,7 @@ def get_crowd_fund_abi(): def read_proposal(address): + current_web3.eth.defaultAccount = current_web3.eth.accounts[0] crowd_fund_abi = get_crowd_fund_abi() contract = current_web3.eth.contract(address=address, abi=crowd_fund_abi) @@ -34,7 +35,11 @@ def read_proposal(address): # batched calls = list(map(lambda x: [x, None], methods)) - crowd_fund = batch_call(current_web3, address, crowd_fund_abi, calls, contract) + try: + crowd_fund = batch_call(current_web3, address, crowd_fund_abi, calls, contract) + # catch dead contracts here + except RpcError: + return None # balance (sync) crowd_fund['balance'] = current_web3.eth.getBalance(address) diff --git a/backend/grant/web3/util.py b/backend/grant/web3/util.py index 1844f8d3..b7674972 100644 --- a/backend/grant/web3/util.py +++ b/backend/grant/web3/util.py @@ -9,6 +9,10 @@ from web3.utils.abi import get_abi_output_types, map_abi_data from web3.utils.normalizers import BASE_RETURN_NORMALIZERS +class RpcError(Exception): + pass + + def call_array(fn): results = [] no_error = True @@ -51,6 +55,8 @@ def batch_call(w3, address, abi, calls, contract): # this implements batched rpc calls using web3py helper methods # web3py doesn't support this out-of-box yet # issue: https://github.com/ethereum/web3.py/issues/832 + if not calls: + return [] if type(w3.providers[0]) is EthereumTesterProvider: return tester_batch(calls, contract) inputs = [] @@ -60,6 +66,9 @@ def batch_call(w3, address, abi, calls, contract): prepared = prepare_transaction(address, w3, name, abi, None, tx, args) inputs.append([prepared, 'latest']) responses = batch(ETHEREUM_ENDPOINT_URI, inputs) + if 'error' in responses[0]: + message = responses[0]['error']['message'] if 'message' in responses[0]['error'] else 'No error message found.' + raise RpcError("rpc error: {0}".format(message)) results = {} for r in zip(calls, responses): result = HexBytes(r[1]['result']) diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 140120bd..6e59c149 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -60,4 +60,3 @@ flask-yolo2API==0.2.6 #web3 flask-web3==0.1.1 web3==4.8.1 - diff --git a/backend/tests/web3/test_proposal_read.py b/backend/tests/web3/test_proposal_read.py index 22528221..1d532b62 100644 --- a/backend/tests/web3/test_proposal_read.py +++ b/backend/tests/web3/test_proposal_read.py @@ -58,9 +58,7 @@ class TestWeb3ProposalRead(BaseTestConfig): "isImmediatePayout": True } ], - "trustees": [ - current_web3.eth.accounts[0] - ], + "trustees": [current_web3.eth.accounts[0]], "contributors": [], "target": "5000000000000000000", "isFrozen": False, @@ -74,9 +72,7 @@ class TestWeb3ProposalRead(BaseTestConfig): "contributionAmount": str(c[1] * 1000000000000000000), "refundVote": False, "refunded": False, - "milestoneNoVotes": [ - False - ] + "milestoneNoVotes": [False] }) return mock_proposal_read @@ -111,7 +107,7 @@ class TestWeb3ProposalRead(BaseTestConfig): deadline = proposal_read.pop('deadline') deadline_diff = deadline - time.time() * 1000 self.assertGreater(60000, deadline_diff) - self.assertGreater(deadline_diff, 58000) + self.assertGreater(deadline_diff, 50000) self.maxDiff = None self.assertEqual(proposal_read, self.get_mock_proposal_read()) diff --git a/frontend/client/Routes.tsx b/frontend/client/Routes.tsx index 18cb731c..b714be64 100644 --- a/frontend/client/Routes.tsx +++ b/frontend/client/Routes.tsx @@ -74,7 +74,7 @@ const routeConfigs: RouteConfig[] = [ }, template: { title: 'Browse proposals', - requiresWeb3: true, + requiresWeb3: false, }, }, { @@ -85,7 +85,7 @@ const routeConfigs: RouteConfig[] = [ }, template: { title: 'Proposal', - requiresWeb3: true, + requiresWeb3: false, }, }, { diff --git a/frontend/client/api/api.ts b/frontend/client/api/api.ts index 9e7b05b4..79df6f12 100644 --- a/frontend/client/api/api.ts +++ b/frontend/client/api/api.ts @@ -3,25 +3,20 @@ import { Proposal, TeamMember, Update } from 'types'; import { formatTeamMemberForPost, formatTeamMemberFromGet, - generateProposalUrl, + formatProposalFromGet, } from 'utils/api'; import { PROPOSAL_CATEGORY } from './constants'; export function getProposals(): Promise<{ data: Proposal[] }> { return axios.get('/api/v1/proposals/').then(res => { - res.data = res.data.map((proposal: any) => { - proposal.team = proposal.team.map(formatTeamMemberFromGet); - proposal.proposalUrlId = generateProposalUrl(proposal.proposalId, proposal.title); - return proposal; - }); + res.data = res.data.map(formatProposalFromGet); return res; }); } export function getProposal(proposalId: number | string): Promise<{ data: Proposal }> { return axios.get(`/api/v1/proposals/${proposalId}`).then(res => { - res.data.team = res.data.team.map(formatTeamMemberFromGet); - res.data.proposalUrlId = generateProposalUrl(res.data.proposalId, res.data.title); + res.data = formatProposalFromGet(res.data); return res; }); } diff --git a/frontend/client/components/MetaMaskRequiredButton/index.less b/frontend/client/components/MetaMaskRequiredButton/index.less new file mode 100644 index 00000000..3ec2b1b1 --- /dev/null +++ b/frontend/client/components/MetaMaskRequiredButton/index.less @@ -0,0 +1,32 @@ +.MetaMaskRequiredButton { + display: block; + text-align: center; + padding: 0; + height: 3rem; + line-height: 3rem; + font-size: 1.2rem; + color: #fff; + background: #f88500; + border-radius: 4px; + + &:hover { + color: #fff; + opacity: 0.8; + } + + &-logo { + display: inline-block; + vertical-align: middle; + height: 2rem; + width: 2rem; + padding: 0.4rem; + border-radius: 1.25rem; + background: rgba(255, 255, 255, 0.6); + margin: 0 1rem 0 0; + + & > img { + display: block; + height: 1.2rem; + } + } +} diff --git a/frontend/client/components/MetaMaskRequiredButton/index.tsx b/frontend/client/components/MetaMaskRequiredButton/index.tsx new file mode 100644 index 00000000..253433f9 --- /dev/null +++ b/frontend/client/components/MetaMaskRequiredButton/index.tsx @@ -0,0 +1,82 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { AppState } from 'store/reducers'; +import { web3Actions } from 'modules/web3'; +import { Alert } from 'antd'; +import metaMaskImgSrc from 'static/images/metamask.png'; +import './index.less'; + +interface OwnProps { + message: React.ReactNode; +} + +interface StateProps { + isMissingWeb3: boolean; + isWeb3Locked: boolean; + isWrongNetwork: boolean; +} + +interface DispatchProps { + setAccounts: typeof web3Actions['setAccounts']; +} + +type Props = OwnProps & StateProps & DispatchProps; + +class MetaMaskRequiredButton extends React.PureComponent { + render() { + const { isMissingWeb3, isWeb3Locked, isWrongNetwork, children, message } = this.props; + const displayMessage = + ((isMissingWeb3 || isWeb3Locked || isWrongNetwork) && message) || null; + return ( + <> + {displayMessage} + {isMissingWeb3 ? ( + +
+ +
+ MetaMask required +
+ ) : isWeb3Locked ? ( + + It looks like your MetaMask account is locked. Please unlock it and{' '} + click here to continue. + + } + /> + ) : isWrongNetwork ? ( + + The Grant.io smart contract is currently only supported on the{' '} + Ropsten network. Please change your network to continue. + + } + /> + ) : ( + children + )} + + ); + } +} + +export default connect( + state => ({ + isMissingWeb3: state.web3.isMissingWeb3, + isWeb3Locked: state.web3.isWeb3Locked, + isWrongNetwork: state.web3.isWrongNetwork, + }), + { + setAccounts: web3Actions.setAccounts, + }, +)(MetaMaskRequiredButton); diff --git a/frontend/client/components/Proposal/CampaignBlock/index.tsx b/frontend/client/components/Proposal/CampaignBlock/index.tsx index 4e8958df..7fd07f9c 100644 --- a/frontend/client/components/Proposal/CampaignBlock/index.tsx +++ b/frontend/client/components/Proposal/CampaignBlock/index.tsx @@ -4,17 +4,17 @@ import { Spin, Form, Input, Button, Icon } from 'antd'; import { ProposalWithCrowdFund } from 'types'; import './style.less'; import classnames from 'classnames'; - +import { fromWei } from 'utils/units'; import { connect } from 'react-redux'; import { compose } from 'recompose'; import { AppState } from 'store/reducers'; import { web3Actions } from 'modules/web3'; import { withRouter } from 'react-router'; -import Web3Container, { Web3RenderProps } from 'lib/Web3Container'; import ShortAddress from 'components/ShortAddress'; import UnitDisplay from 'components/UnitDisplay'; import { getAmountError } from 'utils/validators'; import { CATEGORY_UI } from 'api/constants'; +import MetaMaskRequiredButton from 'components/MetaMaskRequiredButton'; interface OwnProps { proposal: ProposalWithCrowdFund; @@ -29,11 +29,7 @@ interface ActionProps { fundCrowdFund: typeof web3Actions['fundCrowdFund']; } -interface Web3Props { - web3: Web3RenderProps['web3']; -} - -type Props = OwnProps & StateProps & ActionProps & Web3Props; +type Props = OwnProps & StateProps & ActionProps; interface State { amountToRaise: string; @@ -58,7 +54,7 @@ export class ProposalCampaignBlock extends React.Component { return; } - const { proposal, web3 } = this.props; + const { proposal } = this.props; const { crowdFund } = proposal; const remainingTarget = crowdFund.target.sub(crowdFund.funded); const amount = parseFloat(value); @@ -67,7 +63,7 @@ export class ProposalCampaignBlock extends React.Component { if (Number.isNaN(amount)) { // They're entering some garbage, they’ll work it out } else { - const remainingEthNum = parseFloat(web3.utils.fromWei(remainingTarget, 'ether')); + const remainingEthNum = parseFloat(fromWei(remainingTarget, 'ether')); amountError = getAmountError(amount, remainingEthNum); } @@ -82,7 +78,7 @@ export class ProposalCampaignBlock extends React.Component { }; render() { - const { proposal, sendLoading, web3, isPreview } = this.props; + const { proposal, sendLoading, isPreview } = this.props; const { amountToRaise, amountError } = this.state; const amountFloat = parseFloat(amountToRaise) || 0; let content; @@ -94,7 +90,7 @@ export class ProposalCampaignBlock extends React.Component { crowdFund.isFrozen; const isDisabled = isFundingOver || !!amountError || !amountFloat || isPreview; const remainingEthNum = parseFloat( - web3.utils.fromWei(crowdFund.target.sub(crowdFund.funded), 'ether'), + fromWei(crowdFund.target.sub(crowdFund.funded), 'ether'), ); content = ( @@ -166,37 +162,51 @@ export class ProposalCampaignBlock extends React.Component { }} /> -
- - - - + + + + +
)} @@ -226,21 +236,9 @@ const withConnect = connect( { fundCrowdFund: web3Actions.fundCrowdFund }, ); -const ConnectedProposalCampaignBlock = compose( +const ConnectedProposalCampaignBlock = compose( withRouter, withConnect, )(ProposalCampaignBlock); -export default (props: OwnProps) => ( - ( -
-

Campaign

-
- -
-
- )} - render={({ web3 }) => } - /> -); +export default ConnectedProposalCampaignBlock; diff --git a/frontend/client/components/Proposal/index.tsx b/frontend/client/components/Proposal/index.tsx index d79d1039..283e3823 100644 --- a/frontend/client/components/Proposal/index.tsx +++ b/frontend/client/components/Proposal/index.tsx @@ -18,12 +18,11 @@ import ContributorsTab from './Contributors'; // import CommunityTab from './Community'; import UpdateModal from './UpdateModal'; import CancelModal from './CancelModal'; -import './style.less'; import classnames from 'classnames'; import { withRouter } from 'react-router'; -import Web3Container from 'lib/Web3Container'; import { web3Actions } from 'modules/web3'; import SocialShare from 'components/SocialShare'; +import './style.less'; interface OwnProps { proposalId: number; @@ -32,17 +31,14 @@ interface OwnProps { interface StateProps { proposal: ProposalWithCrowdFund | null; + account: string | null; } interface DispatchProps { fetchProposal: proposalActions.TFetchProposal; } -interface Web3Props { - account: string; -} - -type Props = StateProps & DispatchProps & Web3Props & OwnProps; +type Props = StateProps & DispatchProps & OwnProps; interface State { isBodyExpanded: boolean; @@ -95,7 +91,7 @@ export class ProposalDetail extends React.Component { return ; } else { const { crowdFund } = proposal; - const isTrustee = crowdFund.trustees.includes(account); + const isTrustee = !!account && crowdFund.trustees.includes(account); const isContributor = !!crowdFund.contributors.find(c => c.address === account); const hasBeenFunded = crowdFund.isRaiseGoalReached; const isProposalActive = !hasBeenFunded && crowdFund.deadline > Date.now(); @@ -251,6 +247,7 @@ export class ProposalDetail extends React.Component { function mapStateToProps(state: AppState, ownProps: OwnProps) { return { proposal: getProposal(state, ownProps.proposalId), + account: (state.web3.accounts.length && state.web3.accounts[0]) || null, }; } @@ -263,22 +260,9 @@ const withConnect = connect( mapDispatchToProps, ); -const ConnectedProposal = compose( +const ConnectedProposal = compose( withRouter, withConnect, )(ProposalDetail); -export default (props: OwnProps) => ( - ( -
-
-
- -
-
-
- )} - render={({ accounts }) => } - /> -); +export default ConnectedProposal; diff --git a/frontend/client/components/Proposals/ProposalCard/index.tsx b/frontend/client/components/Proposals/ProposalCard/index.tsx index da0e99d1..9235988f 100644 --- a/frontend/client/components/Proposals/ProposalCard/index.tsx +++ b/frontend/client/components/Proposals/ProposalCard/index.tsx @@ -1,23 +1,15 @@ import React from 'react'; import classnames from 'classnames'; -import { Progress, Icon, Spin } from 'antd'; +import { Progress, Icon } from 'antd'; import moment from 'moment'; import { Redirect } from 'react-router-dom'; import { CATEGORY_UI } from 'api/constants'; import { ProposalWithCrowdFund } from 'types'; -import './style.less'; -import { Dispatch, bindActionCreators } from 'redux'; -import * as web3Actions from 'modules/web3/actions'; -import { AppState } from 'store/reducers'; -import { connect } from 'react-redux'; import UserAvatar from 'components/UserAvatar'; import UnitDisplay from 'components/UnitDisplay'; +import './style.less'; -interface Props extends ProposalWithCrowdFund { - web3: AppState['web3']['web3']; -} - -export class ProposalCard extends React.Component { +export class ProposalCard extends React.Component { state = { redirect: '' }; render() { if (this.state.redirect) { @@ -29,84 +21,66 @@ export class ProposalCard extends React.Component { proposalUrlId, category, dateCreated, - web3, crowdFund, team, } = this.props; - if (!web3) { - return ; - } else { - return ( -
this.setState({ redirect: `/proposals/${proposalUrlId}` })} - > -

{title}

-
-
- raised{' '} - of goal -
-
= 100, - })} - > - {crowdFund.percentFunded}% -
+ return ( +
this.setState({ redirect: `/proposals/${proposalUrlId}` })} + > +

{title}

+
+
+ raised of{' '} + goal
- = 100 ? 'success' : 'active'} - showInfo={false} - /> - -
-
- {team[0].name} {team.length > 1 && +{team.length - 1} other} -
-
- {[...team].reverse().map((u, idx) => ( - - ))} -
-
-
{proposalAddress}
- -
-
- {CATEGORY_UI[category].label} -
-
- {moment(dateCreated * 1000).fromNow()} -
+
= 100, + })} + > + {crowdFund.percentFunded}%
- ); - } + = 100 ? 'success' : 'active'} + showInfo={false} + /> + +
+
+ {team[0].name} {team.length > 1 && +{team.length - 1} other} +
+
+ {[...team].reverse().map((u, idx) => ( + + ))} +
+
+
{proposalAddress}
+ +
+
+ {CATEGORY_UI[category].label} +
+
+ {moment(dateCreated * 1000).fromNow()} +
+
+
+ ); } } -function mapDispatchToProps(dispatch: Dispatch) { - return bindActionCreators(web3Actions, dispatch); -} - -function mapStateToProps(state: AppState) { - return { - web3: state.web3.web3, - }; -} - -export default connect( - mapStateToProps, - mapDispatchToProps, -)(ProposalCard); +export default ProposalCard; diff --git a/frontend/client/components/Proposals/index.tsx b/frontend/client/components/Proposals/index.tsx index f14d70ae..1887154f 100644 --- a/frontend/client/components/Proposals/index.tsx +++ b/frontend/client/components/Proposals/index.tsx @@ -5,11 +5,10 @@ import { getProposals } from 'modules/proposals/selectors'; import { ProposalWithCrowdFund } from 'types'; import { bindActionCreators, Dispatch } from 'redux'; import { AppState } from 'store/reducers'; -import { Input, Divider, Spin, Drawer, Icon, Button } from 'antd'; +import { Input, Divider, Drawer, Icon, Button } from 'antd'; import ProposalResults from './Results'; import ProposalFilters, { Filters } from './Filters'; import { PROPOSAL_SORT } from 'api/constants'; -import Web3Container from 'lib/Web3Container'; import './style.less'; type ProposalSortFn = (p1: ProposalWithCrowdFund, p2: ProposalWithCrowdFund) => number; @@ -246,6 +245,4 @@ const ConnectedProposals = connect( mapDispatchToProps, )(Proposals); -export default () => ( - } render={() => } /> -); +export default ConnectedProposals; diff --git a/frontend/client/lib/crowdFundContracts.ts b/frontend/client/lib/crowdFundContracts.ts new file mode 100644 index 00000000..58b9bc52 --- /dev/null +++ b/frontend/client/lib/crowdFundContracts.ts @@ -0,0 +1,24 @@ +import Web3 from 'web3'; +import getContractInstance from './getContract'; +import CrowdFund from 'lib/contracts/CrowdFund.json'; + +const contractCache = {} as { [key: string]: any }; + +export async function getCrowdFundContract(web3: Web3 | null, deployedAddress: string) { + if (!web3) { + throw new Error('getCrowdFundAddress: web3 was null but is required!'); + } + if (!contractCache[deployedAddress]) { + try { + contractCache[deployedAddress] = await getContractInstance( + web3, + CrowdFund, + deployedAddress, + ); + } catch (e) { + console.error(`Could not lookup crowdFund contract @ ${deployedAddress}: `, e); + return null; + } + } + return contractCache[deployedAddress]; +} diff --git a/frontend/client/lib/getWeb3.ts b/frontend/client/lib/getWeb3.ts index 44350b40..1b410595 100644 --- a/frontend/client/lib/getWeb3.ts +++ b/frontend/client/lib/getWeb3.ts @@ -10,7 +10,6 @@ const resolveWeb3 = (resolve: (web3: Web3) => void, reject: (err: Error) => void } let { web3 } = window as Web3Window; - const localProvider = `http://localhost:8545`; // To test what it's like to not have web3, uncomment the reject. Otherwise // localProvider will always kick in. @@ -19,10 +18,6 @@ const resolveWeb3 = (resolve: (web3: Web3) => void, reject: (err: Error) => void if (typeof web3 !== 'undefined') { console.info(`Injected web3 detected.`); web3 = new Web3(web3.currentProvider); - } else if (process.env.NODE_ENV !== 'production') { - console.info(`No web3 instance injected, using Local web3.`); - const provider = new Web3.providers.HttpProvider(localProvider); - web3 = new Web3(provider); } else { return reject(new Error('No web3 instance available')); } diff --git a/frontend/client/modules/create/utils.ts b/frontend/client/modules/create/utils.ts index ceac1788..9925f82f 100644 --- a/frontend/client/modules/create/utils.ts +++ b/frontend/client/modules/create/utils.ts @@ -254,6 +254,5 @@ export function makeProposalPreviewFromForm( isFrozen: false, isRaiseGoalReached: false, }, - crowdFundContract: null, }; } diff --git a/frontend/client/modules/proposals/actions.ts b/frontend/client/modules/proposals/actions.ts index b061d2b8..089dee49 100644 --- a/frontend/client/modules/proposals/actions.ts +++ b/frontend/client/modules/proposals/actions.ts @@ -6,64 +6,16 @@ import { getProposalUpdates, } from 'api/api'; import { Dispatch } from 'redux'; -import Web3 from 'web3'; -import { ProposalWithCrowdFund, Proposal, Comment } from 'types'; +import { ProposalWithCrowdFund, Comment } from 'types'; import { signData } from 'modules/web3/actions'; -import getContract from 'lib/getContract'; -import CrowdFund from 'lib/contracts/CrowdFund.json'; -import { getCrowdFundState } from 'web3interact/crowdFund'; - -async function getMergedCrowdFundProposal( - proposal: Proposal, - web3: Web3, - account: string, -) { - const crowdFundContract = await getContract(web3, CrowdFund, proposal.proposalAddress); - const crowdFundData = { - crowdFundContract, - crowdFund: await getCrowdFundState(crowdFundContract, account, web3), - }; - - for (let i = 0; i < crowdFundData.crowdFund.milestones.length; i++) { - proposal.milestones[i] = { - ...proposal.milestones[i], - ...crowdFundData.crowdFund.milestones[i], - }; - } - - return { - ...crowdFundData, - ...proposal, - }; -} - -// valid as defined by crowdFund contract existing on current network -export async function getValidProposals( - proposals: { data: Proposal[] }, - web3: Web3, - account: string, -) { - return (await Promise.all( - proposals.data.map(async (proposal: Proposal) => { - try { - return await getMergedCrowdFundProposal(proposal, web3, account); - } catch (e) { - console.error('Could not lookup crowdFund contract', e); - } - }), - // remove proposals that except since they cannot be retrieved via getContract - )).filter(Boolean); -} export type TFetchProposals = typeof fetchProposals; export function fetchProposals() { - return (dispatch: Dispatch, getState: any) => { - const state = getState(); + return (dispatch: Dispatch) => { return dispatch({ type: types.PROPOSALS_DATA, payload: async () => { - const proposals = await getProposals(); - return getValidProposals(proposals, state.web3.web3, state.web3.accounts[0]); + return (await getProposals()).data; }, }); }; @@ -71,17 +23,11 @@ export function fetchProposals() { export type TFetchProposal = typeof fetchProposal; export function fetchProposal(proposalId: ProposalWithCrowdFund['proposalId']) { - return (dispatch: Dispatch, getState: any) => { - const state = getState(); + return (dispatch: Dispatch) => { dispatch({ type: types.PROPOSAL_DATA, payload: async () => { - const proposal = await getProposal(proposalId); - return await getMergedCrowdFundProposal( - proposal.data, - state.web3.web3, - state.web3.accounts[0], - ); + return (await getProposal(proposalId)).data; }, }); }; diff --git a/frontend/client/modules/web3/actions.ts b/frontend/client/modules/web3/actions.ts index 21aa67fc..cb1d7257 100644 --- a/frontend/client/modules/web3/actions.ts +++ b/frontend/client/modules/web3/actions.ts @@ -9,6 +9,7 @@ import { fetchProposal, fetchProposals } from 'modules/proposals/actions'; import { PROPOSAL_CATEGORY } from 'api/constants'; import { AppState } from 'store/reducers'; import { Wei } from 'utils/units'; +import { getCrowdFundContract } from 'lib/crowdFundContracts'; import { TeamMember, AuthSignatureData, ProposalWithCrowdFund } from 'types'; type GetState = () => AppState; @@ -201,7 +202,12 @@ export function requestMilestonePayout(proposal: ProposalWithCrowdFund, index: n }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); + try { await crowdFundContract.methods .requestMilestonePayout(index) @@ -231,7 +237,11 @@ export function payMilestonePayout(proposal: ProposalWithCrowdFund, index: numbe }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); try { await crowdFundContract.methods @@ -265,7 +275,8 @@ export function fundCrowdFund(proposal: ProposalWithCrowdFund, value: number | s const state = getState(); const web3 = state.web3.web3; const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract(web3, proposalAddress); try { if (!web3) { @@ -301,7 +312,11 @@ export function voteMilestonePayout( dispatch({ type: types.VOTE_AGAINST_MILESTONE_PAYOUT_PENDING }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); try { await crowdFundContract.methods @@ -328,7 +343,11 @@ export function voteRefund(proposal: ProposalWithCrowdFund, vote: boolean) { dispatch({ type: types.VOTE_REFUND_PENDING }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); try { await crowdFundContract.methods @@ -377,7 +396,11 @@ export function triggerRefund(proposal: ProposalWithCrowdFund) { dispatch({ type: types.WITHDRAW_REFUND_PENDING }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); try { await freezeContract(crowdFundContract, account); @@ -398,7 +421,11 @@ export function withdrawRefund(proposal: ProposalWithCrowdFund, address: string) dispatch({ type: types.WITHDRAW_REFUND_PENDING }); const state = getState(); const account = state.web3.accounts[0]; - const { crowdFundContract, proposalId } = proposal; + const { proposalAddress, proposalId } = proposal; + const crowdFundContract = await getCrowdFundContract( + state.web3.web3, + proposalAddress, + ); try { await freezeContract(crowdFundContract, account); diff --git a/frontend/client/utils/api.ts b/frontend/client/utils/api.ts index c4d30672..72af1486 100644 --- a/frontend/client/utils/api.ts +++ b/frontend/client/utils/api.ts @@ -1,4 +1,5 @@ -import { TeamMember } from 'types'; +import BN from 'bn.js'; +import { TeamMember, CrowdFund, ProposalWithCrowdFund } from 'types'; import { socialAccountsToUrls, socialUrlsToAccounts } from 'utils/social'; export function formatTeamMemberForPost(user: TeamMember) { @@ -27,6 +28,38 @@ export function formatTeamMemberFromGet(user: any): TeamMember { }; } +export function formatCrowdFundFromGet(crowdFund: CrowdFund): CrowdFund { + const bnKeys = ['amountVotingForRefund', 'balance', 'funded', 'target'] as Array< + keyof CrowdFund + >; + bnKeys.forEach(k => { + crowdFund[k] = new BN(crowdFund[k] as string); + }); + crowdFund.milestones = crowdFund.milestones.map(ms => { + ms.amount = new BN(ms.amount); + ms.amountAgainstPayout = new BN(ms.amountAgainstPayout); + return ms; + }); + crowdFund.contributors = crowdFund.contributors.map(c => { + c.contributionAmount = new BN(c.contributionAmount); + return c; + }); + return crowdFund; +} + +export function formatProposalFromGet(proposal: ProposalWithCrowdFund) { + for (let i = 0; i < proposal.crowdFund.milestones.length; i++) { + proposal.milestones[i] = { + ...proposal.milestones[i], + ...proposal.crowdFund.milestones[i], + }; + } + proposal.team = proposal.team.map(formatTeamMemberFromGet); + proposal.proposalUrlId = generateProposalUrl(proposal.proposalId, proposal.title); + proposal.crowdFund = formatCrowdFundFromGet(proposal.crowdFund); + return proposal; +} + // TODO: i18n on case-by-case basis export function generateProposalUrl(id: number, title: string) { const slug = title diff --git a/frontend/stories/props.tsx b/frontend/stories/props.tsx index 1a005461..608fb6f5 100644 --- a/frontend/stories/props.tsx +++ b/frontend/stories/props.tsx @@ -212,13 +212,13 @@ export function getProposalWithCrowdFund({ amountVotingForRefund: new BN(0), percentVotingForRefund: 0, }, - crowdFundContract: {}, }; const props = { sendLoading: false, fundCrowdFund, web3: new Web3(), + isMissingWeb3: false, proposal, ...proposal, // yeah... }; diff --git a/frontend/types/proposal.ts b/frontend/types/proposal.ts index 02b24aa6..065671e1 100644 --- a/frontend/types/proposal.ts +++ b/frontend/types/proposal.ts @@ -46,7 +46,6 @@ export interface Proposal { export interface ProposalWithCrowdFund extends Proposal { crowdFund: CrowdFund; - crowdFundContract: any; } export interface ProposalComments { From 52f1f54442769129b4f5c9619b9505e9e9c69156 Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 16 Nov 2018 21:33:25 -0600 Subject: [PATCH 07/17] avatar upload & download --- backend/.env.example | 4 +- backend/grant/settings.py | 3 + backend/grant/user/views.py | 54 +++++- backend/grant/utils/upload.py | 52 ++++++ .../client/components/Profile/AvatarEdit.less | 74 ++++++++ .../client/components/Profile/AvatarEdit.tsx | 174 ++++++++++++++++++ .../components/Profile/ProfileEdit.less | 75 +------- .../client/components/Profile/ProfileEdit.tsx | 46 ++--- frontend/client/modules/auth/reducers.ts | 9 + frontend/client/utils/blob.ts | 35 ++++ frontend/package.json | 2 + frontend/yarn.lock | 22 +++ 12 files changed, 441 insertions(+), 109 deletions(-) create mode 100644 backend/grant/utils/upload.py create mode 100644 frontend/client/components/Profile/AvatarEdit.less create mode 100644 frontend/client/components/Profile/AvatarEdit.tsx create mode 100644 frontend/client/utils/blob.ts diff --git a/backend/.env.example b/backend/.env.example index cde71398..94f350b2 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -8,4 +8,6 @@ SECRET_KEY="not-so-secret" SENDGRID_API_KEY="optional, but emails won't send without it" # for ropsten use the following # ETHEREUM_ENDPOINT_URI = "https://ropsten.infura.io/API_KEY" -ETHEREUM_ENDPOINT_URI = "http://localhost:8545" \ No newline at end of file +ETHEREUM_ENDPOINT_URI = "http://localhost:8545" +UPLOAD_DIRECTORY = "/tmp" +UPLOAD_URL = "http://localhost:5000" # for constructing download url \ No newline at end of file diff --git a/backend/grant/settings.py b/backend/grant/settings.py index a818349f..c23f1e60 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -27,3 +27,6 @@ SENDGRID_API_KEY = env.str("SENDGRID_API_KEY", default="") SENDGRID_DEFAULT_FROM = "noreply@grant.io" ETHEREUM_PROVIDER = "http" ETHEREUM_ENDPOINT_URI = env.str("ETHEREUM_ENDPOINT_URI") +UPLOAD_DIRECTORY = env.str("UPLOAD_DIRECTORY") +UPLOAD_URL = env.str("UPLOAD_URL") +MAX_CONTENT_LENGTH = 5 * 1024 * 1024 # 5MB (limits file uploads, raises RequestEntityTooLarge) diff --git a/backend/grant/user/views.py b/backend/grant/user/views.py index 64d3757e..a7e5ae00 100644 --- a/backend/grant/user/views.py +++ b/backend/grant/user/views.py @@ -1,8 +1,10 @@ -from flask import Blueprint, g +from flask import Blueprint, g, request from flask_yoloapi import endpoint, parameter from grant.proposal.models import Proposal, proposal_team from grant.utils.auth import requires_sm, requires_same_user_auth, verify_signed_auth, BadSignatureException +from grant.utils.upload import save_avatar, send_upload, remove_avatar +from grant.settings import UPLOAD_URL from .models import User, SocialMedia, Avatar, users_schema, user_schema, db blueprint = Blueprint('user', __name__, url_prefix='/api/v1/users') @@ -69,11 +71,11 @@ def create_user( sig_address = verify_signed_auth(signed_message, raw_typed_data) if sig_address.lower() != account_address.lower(): return { - "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( + "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( sig_address=sig_address, account_address=account_address - ) - }, 400 + ) + }, 400 except BadSignatureException: return {"message": "Invalid message signature"}, 400 @@ -103,17 +105,49 @@ def auth_user(account_address, signed_message, raw_typed_data): sig_address = verify_signed_auth(signed_message, raw_typed_data) if sig_address.lower() != account_address.lower(): return { - "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( + "message": "Message signature address ({sig_address}) doesn't match account_address ({account_address})".format( sig_address=sig_address, account_address=account_address - ) - }, 400 + ) + }, 400 except BadSignatureException: return {"message": "Invalid message signature"}, 400 return user_schema.dump(existing_user) +@blueprint.route("/avatar", methods=["POST"]) +@requires_sm +@endpoint.api() +def upload_avatar(): + user = g.current_user + if 'file' not in request.files: + return {"message": "No file in post"}, 400 + file = request.files['file'] + if file.filename == '': + return {"message": "No selected file"}, 400 + try: + filename = save_avatar(file, user.id) + return {"url": "{0}/api/v1/users/avatar/{1}".format(UPLOAD_URL, filename)} + except Exception as e: + return {"message": str(e)}, 400 + + +@blueprint.route("/avatar/", methods=["GET"]) +def get_avatar(filename): + return send_upload(filename) + + +@blueprint.route("/avatar", methods=["DELETE"]) +@requires_sm +@endpoint.api( + parameter('url', type=str, required=True) +) +def delete_avatar(url): + user = g.current_user + remove_avatar(url, user.id) + + @blueprint.route("/", methods=["PUT"]) @requires_sm @requires_same_user_auth @@ -140,6 +174,7 @@ def update_user(user_identity, display_name, title, social_medias, avatar): else: SocialMedia.query.filter_by(user_id=user.id).delete() + old_avatar = Avatar.query.filter_by(user_id=user.id).first() if avatar is not None: Avatar.query.filter_by(user_id=user.id).delete() avatar_link = avatar.get('link') @@ -149,6 +184,11 @@ def update_user(user_identity, display_name, title, social_medias, avatar): else: Avatar.query.filter_by(user_id=user.id).delete() + old_avatar_url = old_avatar and old_avatar.image_url + new_avatar_url = avatar and avatar['link'] + if old_avatar_url and old_avatar_url != new_avatar_url: + remove_avatar(old_avatar_url, user.id) + db.session.commit() result = user_schema.dump(user) return result diff --git a/backend/grant/utils/upload.py b/backend/grant/utils/upload.py new file mode 100644 index 00000000..3ac27612 --- /dev/null +++ b/backend/grant/utils/upload.py @@ -0,0 +1,52 @@ +import os +import re +from hashlib import md5 +from werkzeug.utils import secure_filename +from flask import send_from_directory +from grant.settings import UPLOAD_DIRECTORY + +IMAGE_MIME_TYPES = set(['image/png', 'image/jpg', 'image/gif']) +AVATAR_MAX_SIZE = 2 * 1024 * 1024 # 2MB + + +class FileValidationException(Exception): + pass + + +def allowed_avatar_file(file): + if file.mimetype not in IMAGE_MIME_TYPES: + raise FileValidationException("Unacceptable file type: {0}".format(file.mimetype)) + file.seek(0, os.SEEK_END) + size = file.tell() + file.seek(0) + if size > AVATAR_MAX_SIZE: + raise FileValidationException("File size is too large ({0}KB), max size is 2000KB".format(size / 1024)) + return True + + +def hash_file(file): + hasher = md5() + buf = file.read() + hasher.update(buf) + file.seek(0) + return hasher.hexdigest() + + +def save_avatar(file, user_id): + if file and allowed_avatar_file(file): + ext = file.mimetype.replace('image/', '') + filename = "{0}.{1}.{2}".format(user_id, hash_file(file), ext) + file.save(os.path.join(UPLOAD_DIRECTORY, filename)) + return filename + + +def remove_avatar(url, user_id): + match = re.search(r'/api/v1/users/avatar/(\d+.\w+.\w+)', url) + if match: + filename = match.group(1) + if filename.startswith(str(user_id) + '.'): + os.remove(os.path.join(UPLOAD_DIRECTORY, filename)) + + +def send_upload(filename): + return send_from_directory(UPLOAD_DIRECTORY, secure_filename(filename)) diff --git a/frontend/client/components/Profile/AvatarEdit.less b/frontend/client/components/Profile/AvatarEdit.less new file mode 100644 index 00000000..b8bc82f8 --- /dev/null +++ b/frontend/client/components/Profile/AvatarEdit.less @@ -0,0 +1,74 @@ +@small-query: ~'(max-width: 500px)'; + +.AvatarEdit { + &-avatar { + position: relative; + height: 10.5rem; + width: 10.5rem; + margin-right: 1.25rem; + align-self: start; + + @media @small-query { + margin-bottom: 1rem; + } + + &-img { + height: 100%; + width: 100%; + border-radius: 1rem; + } + + &-change { + position: absolute; + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; + color: #ffffff; + font-size: 1.2rem; + font-weight: 600; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.4); + border-radius: 1rem; + border: none; + cursor: pointer; + + &:hover, + &:hover:focus { + background: rgba(0, 0, 0, 0.6); + color: #ffffff; + border: none; + } + + &:focus { + background: rgba(0, 0, 0, 0.4); + color: #ffffff; + border: none; + } + + &-icon { + font-size: 2rem; + } + } + + &-delete { + position: absolute; + top: 0.2rem; + right: 0.2rem; + cursor: pointer; + color: #ffffff; + background: transparent; + border: none; + + &:hover, + &:hover:focus { + background: rgba(0, 0, 0, 0.4); + color: #ffffff; + border: none; + } + } + } +} diff --git a/frontend/client/components/Profile/AvatarEdit.tsx b/frontend/client/components/Profile/AvatarEdit.tsx new file mode 100644 index 00000000..f0deab0c --- /dev/null +++ b/frontend/client/components/Profile/AvatarEdit.tsx @@ -0,0 +1,174 @@ +import React from 'react'; +import axios from 'api/axios'; +import { Upload, Icon, Modal, Button, Alert } from 'antd'; +import Cropper from 'react-cropper'; +import 'cropperjs/dist/cropper.css'; +import { UploadFile } from 'antd/lib/upload/interface'; +import { TeamMember } from 'types'; +import { getBase64 } from 'utils/blob'; +import UserAvatar from 'components/UserAvatar'; +import './AvatarEdit.less'; + +const FILE_TYPES = ['image/jpeg', 'image/png', 'image/gif']; +const FILE_MAX_LOAD_MB = 10; + +interface OwnProps { + user: TeamMember; + onDelete(): void; + onDone(url: string): void; +} + +const initialState = { + isUploading: false, + showModal: false, + newAvatarUrl: '', + loadError: '', + uploadError: '', +}; +type State = typeof initialState; + +type Props = OwnProps; + +export default class AvatarEdit extends React.PureComponent { + state = initialState; + cropperRef: React.RefObject; + constructor(props: Props) { + super(props); + this.cropperRef = React.createRef(); + } + + render() { + const { newAvatarUrl, showModal, loadError, uploadError, isUploading } = this.state; + const { + user, + user: { avatarUrl }, + } = this.props; + return ( + <> + {' '} +
+ + + + + {avatarUrl && ( +
+ + Cancel + , + , + ]} + > + + {uploadError && ( + + )} + + + ); + } + + private handleClose = () => { + this.setState({ + isUploading: false, + showModal: false, + newAvatarUrl: '', + uploadError: '', + }); + }; + + private handleLoadChange = (info: any) => { + if (info.file.status === 'done') { + getBase64(info.file.originFileObj, newAvatarUrl => + this.setState({ + newAvatarUrl, + }), + ); + } + }; + + private beforeLoad = (file: UploadFile) => { + this.setState({ loadError: '' }); + const isTypeOk = !!FILE_TYPES.find(t => t === file.type); + if (!isTypeOk) { + this.setState({ loadError: 'File must be a jpg, png or gif' }); + } + const isSizeOk = file.size / 1024 / 1024 < FILE_MAX_LOAD_MB; + if (!isSizeOk) { + this.setState({ + loadError: `File size must be less than ${FILE_MAX_LOAD_MB}MB`, + }); + } + return isTypeOk && isSizeOk; + }; + + private handleLoad = () => { + this.setState({ showModal: true }); + return Promise.resolve(); + }; + + private handleUpload = () => { + this.cropperRef.current + .getCroppedCanvas({ width: 400, height: 400 }) + .toBlob((blob: Blob) => { + const formData = new FormData(); + formData.append('file', blob); + this.setState({ isUploading: true }); + axios + .post('/api/v1/users/avatar', formData, { + headers: { + 'Content-Type': 'multipart/form-data', + }, + }) + .then(res => { + this.props.onDone(res.data.url); + this.handleClose(); + }) + .catch(err => { + this.setState({ isUploading: false, uploadError: err.message }); + }); + }); + }; +} diff --git a/frontend/client/components/Profile/ProfileEdit.less b/frontend/client/components/Profile/ProfileEdit.less index 728700f7..3f421e9c 100644 --- a/frontend/client/components/Profile/ProfileEdit.less +++ b/frontend/client/components/Profile/ProfileEdit.less @@ -7,12 +7,12 @@ bottom: 0; left: 0; background: rgba(0, 0, 0, 0.3); - z-index: 1000; + z-index: 900; } .ProfileEdit { position: relative; - z-index: 1001; + z-index: 901; display: flex; align-items: center; padding: 1rem; @@ -28,77 +28,6 @@ align-items: flex-start; } - &-avatar { - position: relative; - height: 10.5rem; - width: 10.5rem; - margin-right: 1.25rem; - align-self: start; - - @media @small-query { - margin-bottom: 1rem; - } - - &-img { - height: 100%; - width: 100%; - border-radius: 1rem; - } - - &-change { - position: absolute; - display: flex; - flex-flow: column; - justify-content: center; - align-items: center; - color: #ffffff; - font-size: 1.2rem; - font-weight: 600; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.4); - border-radius: 1rem; - border: none; - cursor: pointer; - - &:hover, - &:hover:focus { - background: rgba(0, 0, 0, 0.6); - color: #ffffff; - border: none; - } - - &:focus { - background: rgba(0, 0, 0, 0.4); - color: #ffffff; - border: none; - } - - &-icon { - font-size: 2rem; - } - } - - &-delete { - position: absolute; - top: 0.2rem; - right: 0.2rem; - cursor: pointer; - color: #ffffff; - background: transparent; - border: none; - - &:hover, - &:hover:focus { - background: rgba(0, 0, 0, 0.4); - color: #ffffff; - border: none; - } - } - } - &-info { flex: 1; diff --git a/frontend/client/components/Profile/ProfileEdit.tsx b/frontend/client/components/Profile/ProfileEdit.tsx index 974b2a1b..d22609f7 100644 --- a/frontend/client/components/Profile/ProfileEdit.tsx +++ b/frontend/client/components/Profile/ProfileEdit.tsx @@ -1,11 +1,12 @@ import React from 'react'; import lodash from 'lodash'; -import { Input, Form, Col, Row, Button, Icon, Alert } from 'antd'; +import axios from 'api/axios'; +import { Input, Form, Col, Row, Button, Alert } from 'antd'; import { SOCIAL_INFO } from 'utils/social'; import { SOCIAL_TYPE, TeamMember } from 'types'; import { UserState } from 'modules/users/reducers'; import { getCreateTeamMemberError } from 'modules/create/utils'; -import UserAvatar from 'components/UserAvatar'; +import AvatarEdit from './AvatarEdit'; import './ProfileEdit.less'; interface Props { @@ -54,27 +55,12 @@ export default class ProfileEdit extends React.PureComponent { return ( <>
-
- - - {fields.avatarUrl && ( -
+ +
{ }; private handleCancel = () => { + const { avatarUrl } = this.state.fields; + // cleanup uploaded file if we cancel + if (this.props.user.avatarUrl !== avatarUrl && avatarUrl) { + axios.delete('/api/v1/users/avatar', { + params: { url: avatarUrl }, + }); + } this.props.onDone(); }; @@ -226,13 +219,10 @@ export default class ProfileEdit extends React.PureComponent { }); }; - private handleChangePhoto = () => { - // TODO: Actual file uploading - const gender = ['men', 'women'][Math.floor(Math.random() * 2)]; - const num = Math.floor(Math.random() * 80); + private handleChangePhoto = (url: string) => { const fields = { ...this.state.fields, - avatarUrl: `https://randomuser.me/api/portraits/${gender}/${num}.jpg`, + avatarUrl: url, }; const isChanged = this.isChangedCheck(fields); this.setState({ diff --git a/frontend/client/modules/auth/reducers.ts b/frontend/client/modules/auth/reducers.ts index 4bfa9085..874fbe09 100644 --- a/frontend/client/modules/auth/reducers.ts +++ b/frontend/client/modules/auth/reducers.ts @@ -1,4 +1,5 @@ import types from './types'; +import usersTypes from 'modules/users/types'; // TODO: Use a common User type instead of this import { TeamMember, AuthSignatureData } from 'types'; @@ -56,6 +57,14 @@ export default function createReducer( authSignatureAddress: action.payload.user.ethAddress, isAuthingUser: false, }; + case usersTypes.UPDATE_USER_FULFILLED: + return { + ...state, + user: + state.user && state.user.ethAddress === action.payload.user.ethAddress + ? action.payload.user + : action.payload.user, + }; case types.AUTH_USER_REJECTED: return { ...state, diff --git a/frontend/client/utils/blob.ts b/frontend/client/utils/blob.ts new file mode 100644 index 00000000..94965702 --- /dev/null +++ b/frontend/client/utils/blob.ts @@ -0,0 +1,35 @@ +export function getBase64(img: Blob, callback: (base64: string) => void) { + const reader = new FileReader(); + reader.addEventListener('load', () => callback(reader.result as string)); + reader.readAsDataURL(img); +} + +export function dataUrlToBlob(dataUrl: string) { + const base64ImageContent = dataUrl.replace(/^data:[a-z]+\/[a-z]+;base64,/, ''); + const mimeSearch = dataUrl.match(/^data:([a-z]+\/[a-z]+)(;base64,)/); + if (!mimeSearch || mimeSearch.length !== 3) { + throw new Error( + 'dataUrlToBlob could not find mime type, or base64 was missing: ' + + dataUrl.substring(0, 200), + ); + } else { + return base64ToBlob(base64ImageContent, mimeSearch[1]); + } +} + +export function base64ToBlob(base64: string, mime: string) { + mime = mime || ''; + const sliceSize = 1024; + const byteChars = window.atob(base64); + const byteArrays = []; + for (let offset = 0, len = byteChars.length; offset < len; offset += sliceSize) { + const slice = byteChars.slice(offset, offset + sliceSize); + const byteNumbers = new Array(slice.length); + for (let i = 0; i < slice.length; i++) { + byteNumbers[i] = slice.charCodeAt(i); + } + const byteArray = new Uint8Array(byteNumbers); + byteArrays.push(byteArray); + } + return new Blob(byteArrays, { type: mime }); +} diff --git a/frontend/package.json b/frontend/package.json index 3537cf85..5322e8ee 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -55,6 +55,7 @@ "@types/node": "^10.3.1", "@types/numeral": "^0.0.25", "@types/react": "16.4.18", + "@types/react-cropper": "^0.10.3", "@types/react-dom": "16.0.9", "@types/react-helmet": "^5.0.7", "@types/react-redux": "^6.0.2", @@ -118,6 +119,7 @@ "prettier-package-json": "^1.6.0", "query-string": "6.1.0", "react": "16.5.2", + "react-cropper": "^1.0.1", "react-dev-utils": "^5.0.2", "react-dom": "16.5.2", "react-helmet": "^5.2.0", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 06200a59..1ad8dd0f 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1858,6 +1858,10 @@ dependencies: "@types/express" "*" +"@types/cropperjs@*": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@types/cropperjs/-/cropperjs-1.1.3.tgz#8b2264fb45e933c3eda149cbd08a4f1926dfd8e2" + "@types/dotenv@^4.0.3": version "4.0.3" resolved "https://registry.yarnpkg.com/@types/dotenv/-/dotenv-4.0.3.tgz#ebcfc40da7bc0728b705945b7db48485ec5b4b67" @@ -1967,6 +1971,13 @@ version "1.2.2" resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.2.tgz#fa8e1ad1d474688a757140c91de6dace6f4abc8d" +"@types/react-cropper@^0.10.3": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@types/react-cropper/-/react-cropper-0.10.3.tgz#d7ca18667d9cdad9469d3de6469104924d8217d5" + dependencies: + "@types/cropperjs" "*" + "@types/react" "*" + "@types/react-dom@16.0.9": version "16.0.9" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.0.9.tgz#73ceb7abe6703822eab6600e65c5c52efd07fb91" @@ -4765,6 +4776,10 @@ create-react-context@0.2.3: fbjs "^0.8.0" gud "^1.0.0" +cropperjs@v1.0.0-rc.3: + version "1.0.0-rc.3" + resolved "https://registry.yarnpkg.com/cropperjs/-/cropperjs-1.0.0-rc.3.tgz#50a7c7611befc442702f845ede77d7df4572e82b" + cross-env@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2" @@ -12512,6 +12527,13 @@ react-copy-to-clipboard@^5.0.1: copy-to-clipboard "^3" prop-types "^15.5.8" +react-cropper@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/react-cropper/-/react-cropper-1.0.1.tgz#6e5595abb8576088ab3e51ecfdcfe5f865d0340f" + dependencies: + cropperjs v1.0.0-rc.3 + prop-types "^15.5.8" + react-dev-utils@6.0.0-next.3e165448: version "6.0.0-next.3e165448" resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-6.0.0-next.3e165448.tgz#d573ed0ba692f6cee23166f99204e5761df0897c" From 866be8e62c7d26defbaea9fcd277d6703ff7df4b Mon Sep 17 00:00:00 2001 From: Aaron Date: Fri, 16 Nov 2018 21:56:43 -0600 Subject: [PATCH 08/17] alert margin --- frontend/client/components/Profile/AvatarEdit.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/client/components/Profile/AvatarEdit.tsx b/frontend/client/components/Profile/AvatarEdit.tsx index f0deab0c..eab710d6 100644 --- a/frontend/client/components/Profile/AvatarEdit.tsx +++ b/frontend/client/components/Profile/AvatarEdit.tsx @@ -71,7 +71,9 @@ export default class AvatarEdit extends React.PureComponent { onClick={this.props.onDelete} /> )} - {loadError && } + {loadError && ( + + )}
Date: Fri, 16 Nov 2018 22:24:41 -0600 Subject: [PATCH 09/17] fix reducer logic mistake --- frontend/client/modules/auth/reducers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/client/modules/auth/reducers.ts b/frontend/client/modules/auth/reducers.ts index 874fbe09..c23aed2b 100644 --- a/frontend/client/modules/auth/reducers.ts +++ b/frontend/client/modules/auth/reducers.ts @@ -63,7 +63,7 @@ export default function createReducer( user: state.user && state.user.ethAddress === action.payload.user.ethAddress ? action.payload.user - : action.payload.user, + : state.user, }; case types.AUTH_USER_REJECTED: return { From cd2bd8f0b7fd179065748f165adfec5187a2171f Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 19 Nov 2018 17:58:30 -0600 Subject: [PATCH 10/17] interpolate AVATAR_MAX_SIZE into error message --- backend/grant/utils/upload.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/grant/utils/upload.py b/backend/grant/utils/upload.py index 3ac27612..24cb368c 100644 --- a/backend/grant/utils/upload.py +++ b/backend/grant/utils/upload.py @@ -20,7 +20,9 @@ def allowed_avatar_file(file): size = file.tell() file.seek(0) if size > AVATAR_MAX_SIZE: - raise FileValidationException("File size is too large ({0}KB), max size is 2000KB".format(size / 1024)) + raise FileValidationException( + "File size is too large ({0}KB), max size is {1}KB".format(size / 1024, AVATAR_MAX_SIZE / 1024) + ) return True From f8910b1e095a65aefd8d21c3cb3bdd247b69d0c2 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Wed, 21 Nov 2018 17:24:33 -0600 Subject: [PATCH 11/17] Contract Build Improvements (#215) --- .gitignore | 1 + .travis.yml | 12 +- backend/.env.example | 5 +- backend/.travis.yml | 20 - backend/grant/settings.py | 2 + backend/grant/web3/proposal.py | 9 + backend/tests/web3/test_proposal_read.py | 38 +- contract/.gitignore | 3 +- contract/build/contracts/CrowdFund.json | 28921 ---------------- .../build/contracts/CrowdFundFactory.json | 1566 - frontend/.envexample | 5 +- frontend/.nvmrc | 2 +- frontend/Procfile | 1 + frontend/client/api/api.ts | 12 +- frontend/client/lib/crowdFundContracts.ts | 8 +- frontend/client/modules/web3/sagas.ts | 10 +- frontend/config/env.js | 29 +- frontend/package.json | 6 +- 18 files changed, 107 insertions(+), 30543 deletions(-) delete mode 100644 backend/.travis.yml delete mode 100644 contract/build/contracts/CrowdFund.json delete mode 100644 contract/build/contracts/CrowdFundFactory.json create mode 100644 frontend/Procfile diff --git a/.gitignore b/.gitignore index 485dee64..721ac915 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea +contract/build \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 28f6cc0d..762c72c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ matrix: include: # Frontend - language: node_js - node_js: 8.11.4 + node_js: 8.13.0 before_install: - cd frontend/ install: yarn @@ -15,17 +15,23 @@ matrix: before_install: - cd backend/ - cp .env.example .env + env: + - FLASK_APP=app.py FLASK_DEBUG=1 CROWD_FUND_URL=https://eip-712.herokuapp.com/contract/crowd-fund + CROWD_FUND_FACTORY_URL=https://eip-712.herokuapp.com/contract/factory install: pip install -r requirements/dev.txt script: - flask test # Contracts - language: node_js - node_js: 8.11.4 + node_js: 8.13.0 before_install: - cd contract/ - install: yarn && yarn add global truffle ganache-cli + install: yarn && yarn add global truffle ganache-cli@6.1.8 before_script: - ganache-cli > /dev/null & - sleep 10 script: - yarn run test + env: + - CROWD_FUND_URL=https://eip-712.herokuapp.com/contract/crowd-fund + CROWD_FUND_FACTORY_URL=https://eip-712.herokuapp.com/contract/factory diff --git a/backend/.env.example b/backend/.env.example index 94f350b2..46e54c35 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -9,5 +9,8 @@ SENDGRID_API_KEY="optional, but emails won't send without it" # for ropsten use the following # ETHEREUM_ENDPOINT_URI = "https://ropsten.infura.io/API_KEY" ETHEREUM_ENDPOINT_URI = "http://localhost:8545" +CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" +CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" UPLOAD_DIRECTORY = "/tmp" -UPLOAD_URL = "http://localhost:5000" # for constructing download url \ No newline at end of file +UPLOAD_URL = "http://localhost:5000" # for constructing download url + diff --git a/backend/.travis.yml b/backend/.travis.yml deleted file mode 100644 index 992020bc..00000000 --- a/backend/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Config file for automatic testing at travis-ci.org -sudo: false # http://docs.travis-ci.com/user/migrating-from-legacy/ -language: python -env: -- FLASK_APP=app.py FLASK_DEBUG=1 -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 -install: - - pip install -r requirements/dev.txt - - nvm install 6.10 - - nvm use 6.10 - - npm install -before_script: - - npm run lint - - npm run build - - flask lint -script: flask test diff --git a/backend/grant/settings.py b/backend/grant/settings.py index c23f1e60..96b481c3 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -15,6 +15,8 @@ ENV = env.str("FLASK_ENV", default="production") DEBUG = ENV == "development" SITE_URL = env.str('SITE_URL', default='https://grant.io') AUTH_URL = env.str('AUTH_URL', default='https://eip-712.herokuapp.com') +CROWD_FUND_FACTORY_URL = env.str('CROWD_FUND_FACTORY_URL', default=None) +CROWD_FUND_URL = env.str('CROWD_FUND_URL', default=None) SQLALCHEMY_DATABASE_URI = env.str("DATABASE_URL") QUEUES = ["default"] SECRET_KEY = env.str("SECRET_KEY") diff --git a/backend/grant/web3/proposal.py b/backend/grant/web3/proposal.py index 13859163..7eb105a0 100644 --- a/backend/grant/web3/proposal.py +++ b/backend/grant/web3/proposal.py @@ -2,6 +2,8 @@ import json import time from flask_web3 import current_web3 from .util import batch_call, call_array, RpcError +import requests +from grant.settings import CROWD_FUND_URL crowd_fund_abi = None @@ -11,11 +13,18 @@ def get_crowd_fund_abi(): global crowd_fund_abi if crowd_fund_abi: return crowd_fund_abi + + if CROWD_FUND_URL: + crowd_fund_json = requests.get(CROWD_FUND_URL).json() + crowd_fund_abi = crowd_fund_json['abi'] + return crowd_fund_abi + with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: crowd_fund_abi = json.load(read_file)['abi'] return crowd_fund_abi + def read_proposal(address): current_web3.eth.defaultAccount = current_web3.eth.accounts[0] crowd_fund_abi = get_crowd_fund_abi() diff --git a/backend/tests/web3/test_proposal_read.py b/backend/tests/web3/test_proposal_read.py index 1d532b62..344d5282 100644 --- a/backend/tests/web3/test_proposal_read.py +++ b/backend/tests/web3/test_proposal_read.py @@ -1,13 +1,14 @@ -import copy import json import time -from grant.extensions import web3 -from ..config import BaseTestConfig -from grant.web3.proposal import read_proposal -from flask_web3 import current_web3 import eth_tester.backends.pyevm.main as py_evm_main +from flask_web3 import current_web3 +from grant.extensions import web3 +from grant.settings import CROWD_FUND_URL, CROWD_FUND_FACTORY_URL +from grant.web3.proposal import read_proposal +from ..config import BaseTestConfig +import requests # increase gas limit on eth-tester # https://github.com/ethereum/web3.py/issues/1013 # https://gitter.im/ethereum/py-evm?at=5b7eb68c4be56c5918854337 @@ -23,10 +24,17 @@ class TestWeb3ProposalRead(BaseTestConfig): BaseTestConfig.setUp(self) # the following will properly configure web3 with test config web3.init_app(self.real_app) - with open("../contract/build/contracts/CrowdFundFactory.json", "r") as read_file: - crowd_fund_factory_json = json.load(read_file) - with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: - self.crowd_fund_json = json.load(read_file) + if CROWD_FUND_FACTORY_URL: + crowd_fund_factory_json = requests.get(CROWD_FUND_FACTORY_URL).json() + else: + with open("../frontend/client/lib/contracts/CrowdFundFactory.json", "r") as read_file: + crowd_fund_factory_json = json.load(read_file) + + if CROWD_FUND_URL: + self.crowd_fund_json = requests.get(CROWD_FUND_URL).json() + else: + with open("../frontend/client/lib/contracts/CrowdFund.json", "r") as read_file: + self.crowd_fund_json = json.load(read_file) current_web3.eth.defaultAccount = current_web3.eth.accounts[0] CrowdFundFactory = current_web3.eth.contract( abi=crowd_fund_factory_json['abi'], bytecode=crowd_fund_factory_json['bytecode']) @@ -78,13 +86,13 @@ class TestWeb3ProposalRead(BaseTestConfig): def create_crowd_fund(self): tx_hash = self.crowd_fund_factory.functions.createCrowdFund( - 5000000000000000000, # ethAmount - current_web3.eth.accounts[0], # payout + 5000000000000000000, # ethAmount + current_web3.eth.accounts[0], # payout [current_web3.eth.accounts[0]], # trustees - [5000000000000000000], # milestone amounts - 60, # duration (minutes) - 60, # voting period (minutes) - True # immediate first milestone payout + [5000000000000000000], # milestone amounts + 60, # duration (minutes) + 60, # voting period (minutes) + True # immediate first milestone payout ).transact() tx_receipt = current_web3.eth.waitForTransactionReceipt(tx_hash) tx_events = self.crowd_fund_factory.events.ContractCreated().processReceipt(tx_receipt) diff --git a/contract/.gitignore b/contract/.gitignore index 24ad64be..16c4f657 100644 --- a/contract/.gitignore +++ b/contract/.gitignore @@ -2,5 +2,4 @@ node_modules .idea/ yarn-error.log .env -build/abi -build/typedefs +build diff --git a/contract/build/contracts/CrowdFund.json b/contract/build/contracts/CrowdFund.json deleted file mode 100644 index 86613203..00000000 --- a/contract/build/contracts/CrowdFund.json +++ /dev/null @@ -1,28921 +0,0 @@ -{ - "contractName": "CrowdFund", - "abi": [ - { - "constant": true, - "inputs": [], - "name": "frozen", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "amountVotingForRefund", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "address" - } - ], - "name": "contributors", - "outputs": [ - { - "name": "contributionAmount", - "type": "uint256" - }, - { - "name": "refundVote", - "type": "bool" - }, - { - "name": "refunded", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "frozenBalance", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "deadline", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "minimumContributionAmount", - "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": "", - "type": "uint256" - } - ], - "name": "trustees", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "amountRaised", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "milestoneVotingPeriod", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "contributorList", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "raiseGoal", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isRaiseGoalReached", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "immediateFirstMilestonePayout", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "", - "type": "uint256" - } - ], - "name": "milestones", - "outputs": [ - { - "name": "amount", - "type": "uint256" - }, - { - "name": "amountVotingAgainstPayout", - "type": "uint256" - }, - { - "name": "payoutRequestVoteDeadline", - "type": "uint256" - }, - { - "name": "paid", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "name": "_raiseGoal", - "type": "uint256" - }, - { - "name": "_beneficiary", - "type": "address" - }, - { - "name": "_trustees", - "type": "address[]" - }, - { - "name": "_milestones", - "type": "uint256[]" - }, - { - "name": "_deadline", - "type": "uint256" - }, - { - "name": "_milestoneVotingPeriod", - "type": "uint256" - }, - { - "name": "_immediateFirstMilestonePayout", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "payee", - "type": "address" - }, - { - "indexed": false, - "name": "weiAmount", - "type": "uint256" - } - ], - "name": "Deposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "name": "payee", - "type": "address" - }, - { - "indexed": false, - "name": "weiAmount", - "type": "uint256" - } - ], - "name": "Withdrawn", - "type": "event" - }, - { - "constant": false, - "inputs": [], - "name": "contribute", - "outputs": [], - "payable": true, - "stateMutability": "payable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "index", - "type": "uint256" - } - ], - "name": "requestMilestonePayout", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "index", - "type": "uint256" - }, - { - "name": "vote", - "type": "bool" - } - ], - "name": "voteMilestonePayout", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "index", - "type": "uint256" - } - ], - "name": "payMilestonePayout", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "vote", - "type": "bool" - } - ], - "name": "voteRefund", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "refund", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "name": "refundAddress", - "type": "address" - } - ], - "name": "withdraw", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "destroy", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "valueVoting", - "type": "uint256" - } - ], - "name": "isMajorityVoting", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isCallerTrustee", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isFailed", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "contributorAddress", - "type": "address" - }, - { - "name": "milestoneIndex", - "type": "uint256" - } - ], - "name": "getContributorMilestoneVote", - "outputs": [ - { - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "name": "contributorAddress", - "type": "address" - } - ], - "name": "getContributorContributionAmount", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getFreezeReason", - "outputs": [ - { - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b50604051620032ee380380620032ee833981018060405281019080805190602001909291908051906020019092919080518201929190602001805182019291906020018051906020019092919080519060200190929190805190602001909291905050506000806000670de0b6b3a76400008a1015151562000121576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f526169736520676f616c20697320736d616c6c6572207468616e20312065746881526020017f657200000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001885110158015620001365750600a885111155b1515620001d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260398152602001807f5472757374656520616464726573736573206d757374206265206174206c656181526020017f7374203120616e64206e6f74206d6f7265207468616e2031300000000000000081525060400191505060405180910390fd5b6001875110158015620001e65750600a875111155b151562000281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f4d696c6573746f6e6573206d757374206265206174206c65617374203120616e81526020017f64206e6f74206d6f7265207468616e203130000000000000000000000000000081525060400191505060405180910390fd5b60009250600091505b865182101562000416578682815181101515620002a357fe5b9060200190602002015190506000811115156200034e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f4d696c6573746f6e6520616d6f756e74206d757374206265206772656174657281526020017f207468616e20300000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6200037181846200059b6401000000000262002ae5179091906401000000009004565b9250600c6080604051908101604052808381526020016000815260200160008152602001600015158152509080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555050505081806001019250506200028a565b8983141515620004b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4d696c6573746f6e6520746f74616c206d75737420657175616c20726169736581526020017f20676f616c00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60016006819055508960038190555088600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600b90805190602001906200051c929190620005b8565b508542016002819055508460018190555083600060036101000a81548160ff02191690831515021790555060008060026101000a81548160ff021916908315150217905550600060078190555060008060016101000a81548160ff0219169083151502179055506000600481905550505050505050505050506200068d565b60008183019050828110151515620005af57fe5b80905092915050565b82805482825590600052602060002090810192821562000634579160200282015b82811115620006335782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620005d9565b5b50905062000643919062000647565b5090565b6200068a91905b808211156200068657600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016200064e565b5090565b90565b612c51806200069d6000396000f300608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461017a57806318329822146101a95780631f6d4942146101d45780631fe4d9dd1461024157806326e6074b1461027057806329dcb0cf1461029b5780632b99d7e4146102c657806337b028ef146102ff57806338af3eed1461032a57806347680fca1461038157806351cff8d9146103c6578063590e1ae31461040957806369d596fc14610420578063717d63a41461044f5780637923de2a146104bc5780637b3e5e7b1461051357806383197ef01461053e578063966778061461055557806396b6a34e146105ba5780639d5b06f7146105e75780639ec45bbe146106125780639f5557981461063f578063a3e9436c146106ac578063d6383230146106d7578063d7bb99ba14610702578063d9a992431461070c578063e88329691461073b578063e89e4ed61461076a578063f4163340146107c4575b600080fd5b34801561018657600080fd5b5061018f6107f3565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610806565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b50610215600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061080c565b604051808481526020018315151515815260200182151515158152602001935050505060405180910390f35b34801561024d57600080fd5b50610256610850565b604051808215151515815260200191505060405180910390f35b34801561027c57600080fd5b506102856108f1565b6040518082815260200191505060405180910390f35b3480156102a757600080fd5b506102b06108f7565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102fd600480360381019080803590602001909291908035151590602001909291905050506108fd565b005b34801561030b57600080fd5b50610314610e6f565b6040518082815260200191505060405180910390f35b34801561033657600080fd5b5061033f610e75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038d57600080fd5b506103ac60048036038101908080359060200190929190505050610e9b565b604051808215151515815260200191505060405180910390f35b3480156103d257600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebc565b005b34801561041557600080fd5b5061041e611231565b005b34801561042c57600080fd5b5061044d600480360381019080803515159060200190929190505050611445565b005b34801561045b57600080fd5b5061047a6004803603810190808035906020019092919050505061182a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c857600080fd5b506104fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611868565b6040518082815260200191505060405180910390f35b34801561051f57600080fd5b506105286118b4565b6040518082815260200191505060405180910390f35b34801561054a57600080fd5b506105536118ba565b005b34801561056157600080fd5b506105a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b3d565b604051808215151515815260200191505060405180910390f35b3480156105c657600080fd5b506105e560048036038101908080359060200190929190505050611bb6565b005b3480156105f357600080fd5b506105fc61206b565b6040518082815260200191505060405180910390f35b34801561061e57600080fd5b5061063d60048036038101908080359060200190929190505050612071565b005b34801561064b57600080fd5b5061066a6004803603810190808035906020019092919050505061244a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1612488565b6040518082815260200191505060405180910390f35b3480156106e357600080fd5b506106ec61248e565b6040518082815260200191505060405180910390f35b61070a6124af565b005b34801561071857600080fd5b50610721612a34565b604051808215151515815260200191505060405180910390f35b34801561074757600080fd5b50610750612a47565b604051808215151515815260200191505060405180910390f35b34801561077657600080fd5b5061079560048036038101908080359060200190929190505050612a5a565b604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390f35b3480156107d057600080fd5b506107d9612aa6565b604051808215151515815260200191505060405180910390f35b600060019054906101000a900460ff1681565b60075481565b60096020528060005260406000206000915090508060000154908060020160009054906101000a900460ff16908060020160019054906101000a900460ff16905083565b600080600090505b600b805490508110156108e857600b8181548110151561087457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156108db57600191506108ed565b8080600101915050610858565b600091505b5090565b60055481565b60025481565b6000806000806000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141515156109be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515610a42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010186815481101515610b1657fe5b90600052602060002090602091828204019190069054906101000a900460ff16935084151584151514151515610bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f566f74652076616c7565206d75737420626520646966666572656e742074686181526020017f6e206578697374696e6720766f7465207374617465000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515610beb57fe5b90600052602060002090600402016002015411925042600c87815481101515610c1057fe5b90600052602060002090600402016002015411159150828015610c31575081155b9050801515610ca8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d696c6573746f6e6520766f74696e67206d757374206265206f70656e00000081525060200191505060405180910390fd5b84600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010187815481101515610cf857fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550841515610dc657610d9d600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610d7d57fe5b906000526020600020906004020160010154612acc90919063ffffffff16565b600c87815481101515610dac57fe5b906000526020600020906004020160010181905550610e67565b8415610e6657610e41600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610e2157fe5b906000526020600020906004020160010154612ae590919063ffffffff16565b600c87815481101515610e5057fe5b9060005260206000209060040201600101819055505b5b505050505050565b60065481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454610eb4600284612b0190919063ffffffff16565b119050919050565b60008060008060019054906101000a900460ff161515610f44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515610fc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff169250821515156110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f537065636966696564206164647265737320697320616c72656164792072656681526020017f756e64656400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160016101000a81548160ff021916908315150217905550600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015491506111946005546111863073ffffffffffffffffffffffffffffffffffffffff163185612b0190919063ffffffff16565b612b3990919063ffffffff16565b90508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156111dc573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a250505050565b60008060008060019054906101000a900460ff161515156112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6112c2610850565b92506112cc612aa6565b91506112d9600754610e9b565b905082806112e45750815b806112ec5750805b1515611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f526571756972656420636f6e646974696f6e7320666f7220726566756e64206181526020017f7265206e6f74206d65740000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82156113b45760008060006101000a81548160ff021916908360028111156113aa57fe5b0217905550611407565b81156113e25760016000806101000a81548160ff021916908360028111156113d857fe5b0217905550611406565b60026000806101000a81548160ff0219169083600281111561140057fe5b02179055505b5b6001600060016101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff1631600581905550505050565b600080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414151515611501576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611585576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615151561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff169050801515821515141515156116fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4578697374696e6720766f7465207374617465206973206964656e746963616c81526020017f20746f20766f74652076616c756500000000000000000000000000000000000081525060400191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff0219169083151502179055508115156117c1576117b6600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612acc90919063ffffffff16565b600781905550611826565b81156118255761181e600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612ae590919063ffffffff16565b6007819055505b5b5050565b600b8181548110151561183957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b60045481565b6000806118c5610850565b1515611939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615156119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600091505b600a80549050821015611b0257600a828154811015156119de57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff161515611af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f7481526020017f2079657420726566756e6465640000000000000000000000000000000000000081525060400191505060405180910390fd5b81806001019250506119c2565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515611b8e57fe5b90600052602060002090602091828204019190069054906101000a900460ff16905092915050565b6000806000806000611bc6610850565b1515611c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600c86815481101515611d5257fe5b906000526020600020906004020160030160009054906101000a900460ff16945042600c87815481101515611d8357fe5b906000526020600020906004020160020154119350611dc1600c87815481101515611daa57fe5b906000526020600020906004020160010154610e9b565b925084151515611e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4d696c6573746f6e6520616c726561647920706169640000000000000000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150600090505b600c80549050811015611eb257600c81815481101515611e7d57fe5b906000526020600020906004020160030160009054906101000a900460ff1615611ea5578091505b8080600101915050611e61565b6001820186141515611f52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f4d696c6573746f6e652072657175657374206d75737420626520666f7220666981526020017f72737420756e70616964206d696c6573746f6e6500000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515611f6357fe5b906000526020600020906004020160020154141561200657600086148015611f975750600060039054906101000a900460ff165b15611fc7576001600c87815481101515611fad57fe5b906000526020600020906004020160020181905550612001565b611fdc60015442612ae590919063ffffffff16565b600c87815481101515611feb57fe5b9060005260206000209060040201600201819055505b612063565b8380156120105750825b156120625761203d61202e6002600154612b0190919063ffffffff16565b42612ae590919063ffffffff16565b600c8781548110151561204c57fe5b9060005260206000209060040201600201819055505b5b505050505050565b60015481565b600080600080600060029054906101000a900460ff1615156120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515612180576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b42600c8681548110151561219057fe5b9060005260206000209060040201600201541093506121ce600c868154811015156121b757fe5b906000526020600020906004020160010154610e9b565b9250600c858154811015156121df57fe5b906000526020600020906004020160030160009054906101000a900460ff16915083801561220b575082155b8015612215575081155b156123af576001600c8681548110151561222b57fe5b906000526020600020906004020160030160006101000a81548160ff021916908315150217905550600c8581548110151561226257fe5b9060005260206000209060040201600001549050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122de573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2600161236986600c80549050612acc90919063ffffffff16565b14156123aa57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b612443565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f726571756972656420636f6e646974696f6e732077657265206e6f742073617481526020017f697366696564000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5050505050565b600a8181548110151561245957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60008060009054906101000a900460ff1660028111156124aa57fe5b905090565b600080600060025442111580156124d35750600060029054906101000a900460ff16155b1515612547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43726f776446756e64206973206e6f74206f6e676f696e67000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515156125cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6125e134600454612ae590919063ffffffff16565b92506003548311151515612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f436f6e747269627574696f6e206578636565647320746865207261697365206781526020017f6f616c2e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600654341015915060035483149050818061269b5750805b151561275b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604d8152602001807f6d73672e76616c75652067726561746572207468616e206d696e696d756d2c2081526020017f6f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7481526020017f20746f206265207261697365640000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141561291657608060405190810160405280348152602001600c805490506040519080825280602002602001820160405280156127ec5781602001602082028038833980820191505090505b50815260200160001515815260200160001515815250600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001019080519060200190612867929190612b4f565b5060408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff021916908315150217905550905050600a3390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506129b2565b61296b34600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612ae590919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b8260048190555060035460045414156129e1576001600060026101000a81548160ff0219169083151502179055505b3373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4346040518082815260200191505060405180910390a2505050565b600060029054906101000a900460ff1681565b600060039054906101000a900460ff1681565b600c81815481101515612a6957fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60006002544210158015612ac75750600060029054906101000a900460ff16155b905090565b6000828211151515612ada57fe5b818303905092915050565b60008183019050828110151515612af857fe5b80905092915050565b600080831415612b145760009050612b33565b8183029050818382811515612b2557fe5b04141515612b2f57fe5b8090505b92915050565b60008183811515612b4657fe5b04905092915050565b82805482825590600052602060002090601f01602090048101928215612be45791602002820160005b83821115612bb557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612b78565b8015612be25782816101000a81549060ff0219169055600101602081600001049283019260010302612bb5565b505b509050612bf19190612bf5565b5090565b612c2291905b80821115612c1e57600081816101000a81549060ff021916905550600101612bfb565b5090565b905600a165627a7a72305820b725d6ed533ba3c21fcb343e8c393171f8c562c1668224983554c10c88ce87060029", - "deployedBytecode": "0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461017a57806318329822146101a95780631f6d4942146101d45780631fe4d9dd1461024157806326e6074b1461027057806329dcb0cf1461029b5780632b99d7e4146102c657806337b028ef146102ff57806338af3eed1461032a57806347680fca1461038157806351cff8d9146103c6578063590e1ae31461040957806369d596fc14610420578063717d63a41461044f5780637923de2a146104bc5780637b3e5e7b1461051357806383197ef01461053e578063966778061461055557806396b6a34e146105ba5780639d5b06f7146105e75780639ec45bbe146106125780639f5557981461063f578063a3e9436c146106ac578063d6383230146106d7578063d7bb99ba14610702578063d9a992431461070c578063e88329691461073b578063e89e4ed61461076a578063f4163340146107c4575b600080fd5b34801561018657600080fd5b5061018f6107f3565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610806565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b50610215600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061080c565b604051808481526020018315151515815260200182151515158152602001935050505060405180910390f35b34801561024d57600080fd5b50610256610850565b604051808215151515815260200191505060405180910390f35b34801561027c57600080fd5b506102856108f1565b6040518082815260200191505060405180910390f35b3480156102a757600080fd5b506102b06108f7565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102fd600480360381019080803590602001909291908035151590602001909291905050506108fd565b005b34801561030b57600080fd5b50610314610e6f565b6040518082815260200191505060405180910390f35b34801561033657600080fd5b5061033f610e75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038d57600080fd5b506103ac60048036038101908080359060200190929190505050610e9b565b604051808215151515815260200191505060405180910390f35b3480156103d257600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebc565b005b34801561041557600080fd5b5061041e611231565b005b34801561042c57600080fd5b5061044d600480360381019080803515159060200190929190505050611445565b005b34801561045b57600080fd5b5061047a6004803603810190808035906020019092919050505061182a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c857600080fd5b506104fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611868565b6040518082815260200191505060405180910390f35b34801561051f57600080fd5b506105286118b4565b6040518082815260200191505060405180910390f35b34801561054a57600080fd5b506105536118ba565b005b34801561056157600080fd5b506105a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b3d565b604051808215151515815260200191505060405180910390f35b3480156105c657600080fd5b506105e560048036038101908080359060200190929190505050611bb6565b005b3480156105f357600080fd5b506105fc61206b565b6040518082815260200191505060405180910390f35b34801561061e57600080fd5b5061063d60048036038101908080359060200190929190505050612071565b005b34801561064b57600080fd5b5061066a6004803603810190808035906020019092919050505061244a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1612488565b6040518082815260200191505060405180910390f35b3480156106e357600080fd5b506106ec61248e565b6040518082815260200191505060405180910390f35b61070a6124af565b005b34801561071857600080fd5b50610721612a34565b604051808215151515815260200191505060405180910390f35b34801561074757600080fd5b50610750612a47565b604051808215151515815260200191505060405180910390f35b34801561077657600080fd5b5061079560048036038101908080359060200190929190505050612a5a565b604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390f35b3480156107d057600080fd5b506107d9612aa6565b604051808215151515815260200191505060405180910390f35b600060019054906101000a900460ff1681565b60075481565b60096020528060005260406000206000915090508060000154908060020160009054906101000a900460ff16908060020160019054906101000a900460ff16905083565b600080600090505b600b805490508110156108e857600b8181548110151561087457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156108db57600191506108ed565b8080600101915050610858565b600091505b5090565b60055481565b60025481565b6000806000806000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141515156109be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515610a42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010186815481101515610b1657fe5b90600052602060002090602091828204019190069054906101000a900460ff16935084151584151514151515610bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f566f74652076616c7565206d75737420626520646966666572656e742074686181526020017f6e206578697374696e6720766f7465207374617465000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515610beb57fe5b90600052602060002090600402016002015411925042600c87815481101515610c1057fe5b90600052602060002090600402016002015411159150828015610c31575081155b9050801515610ca8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d696c6573746f6e6520766f74696e67206d757374206265206f70656e00000081525060200191505060405180910390fd5b84600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010187815481101515610cf857fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550841515610dc657610d9d600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610d7d57fe5b906000526020600020906004020160010154612acc90919063ffffffff16565b600c87815481101515610dac57fe5b906000526020600020906004020160010181905550610e67565b8415610e6657610e41600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610e2157fe5b906000526020600020906004020160010154612ae590919063ffffffff16565b600c87815481101515610e5057fe5b9060005260206000209060040201600101819055505b5b505050505050565b60065481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454610eb4600284612b0190919063ffffffff16565b119050919050565b60008060008060019054906101000a900460ff161515610f44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515610fc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff169250821515156110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f537065636966696564206164647265737320697320616c72656164792072656681526020017f756e64656400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160016101000a81548160ff021916908315150217905550600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015491506111946005546111863073ffffffffffffffffffffffffffffffffffffffff163185612b0190919063ffffffff16565b612b3990919063ffffffff16565b90508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156111dc573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a250505050565b60008060008060019054906101000a900460ff161515156112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6112c2610850565b92506112cc612aa6565b91506112d9600754610e9b565b905082806112e45750815b806112ec5750805b1515611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f526571756972656420636f6e646974696f6e7320666f7220726566756e64206181526020017f7265206e6f74206d65740000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82156113b45760008060006101000a81548160ff021916908360028111156113aa57fe5b0217905550611407565b81156113e25760016000806101000a81548160ff021916908360028111156113d857fe5b0217905550611406565b60026000806101000a81548160ff0219169083600281111561140057fe5b02179055505b5b6001600060016101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff1631600581905550505050565b600080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414151515611501576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611585576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615151561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff169050801515821515141515156116fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4578697374696e6720766f7465207374617465206973206964656e746963616c81526020017f20746f20766f74652076616c756500000000000000000000000000000000000081525060400191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff0219169083151502179055508115156117c1576117b6600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612acc90919063ffffffff16565b600781905550611826565b81156118255761181e600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612ae590919063ffffffff16565b6007819055505b5b5050565b600b8181548110151561183957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b60045481565b6000806118c5610850565b1515611939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615156119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600091505b600a80549050821015611b0257600a828154811015156119de57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff161515611af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f7481526020017f2079657420726566756e6465640000000000000000000000000000000000000081525060400191505060405180910390fd5b81806001019250506119c2565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515611b8e57fe5b90600052602060002090602091828204019190069054906101000a900460ff16905092915050565b6000806000806000611bc6610850565b1515611c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600c86815481101515611d5257fe5b906000526020600020906004020160030160009054906101000a900460ff16945042600c87815481101515611d8357fe5b906000526020600020906004020160020154119350611dc1600c87815481101515611daa57fe5b906000526020600020906004020160010154610e9b565b925084151515611e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4d696c6573746f6e6520616c726561647920706169640000000000000000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150600090505b600c80549050811015611eb257600c81815481101515611e7d57fe5b906000526020600020906004020160030160009054906101000a900460ff1615611ea5578091505b8080600101915050611e61565b6001820186141515611f52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f4d696c6573746f6e652072657175657374206d75737420626520666f7220666981526020017f72737420756e70616964206d696c6573746f6e6500000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515611f6357fe5b906000526020600020906004020160020154141561200657600086148015611f975750600060039054906101000a900460ff165b15611fc7576001600c87815481101515611fad57fe5b906000526020600020906004020160020181905550612001565b611fdc60015442612ae590919063ffffffff16565b600c87815481101515611feb57fe5b9060005260206000209060040201600201819055505b612063565b8380156120105750825b156120625761203d61202e6002600154612b0190919063ffffffff16565b42612ae590919063ffffffff16565b600c8781548110151561204c57fe5b9060005260206000209060040201600201819055505b5b505050505050565b60015481565b600080600080600060029054906101000a900460ff1615156120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515612180576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b42600c8681548110151561219057fe5b9060005260206000209060040201600201541093506121ce600c868154811015156121b757fe5b906000526020600020906004020160010154610e9b565b9250600c858154811015156121df57fe5b906000526020600020906004020160030160009054906101000a900460ff16915083801561220b575082155b8015612215575081155b156123af576001600c8681548110151561222b57fe5b906000526020600020906004020160030160006101000a81548160ff021916908315150217905550600c8581548110151561226257fe5b9060005260206000209060040201600001549050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122de573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2600161236986600c80549050612acc90919063ffffffff16565b14156123aa57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b612443565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f726571756972656420636f6e646974696f6e732077657265206e6f742073617481526020017f697366696564000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5050505050565b600a8181548110151561245957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60008060009054906101000a900460ff1660028111156124aa57fe5b905090565b600080600060025442111580156124d35750600060029054906101000a900460ff16155b1515612547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43726f776446756e64206973206e6f74206f6e676f696e67000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515156125cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6125e134600454612ae590919063ffffffff16565b92506003548311151515612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f436f6e747269627574696f6e206578636565647320746865207261697365206781526020017f6f616c2e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600654341015915060035483149050818061269b5750805b151561275b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604d8152602001807f6d73672e76616c75652067726561746572207468616e206d696e696d756d2c2081526020017f6f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7481526020017f20746f206265207261697365640000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141561291657608060405190810160405280348152602001600c805490506040519080825280602002602001820160405280156127ec5781602001602082028038833980820191505090505b50815260200160001515815260200160001515815250600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001019080519060200190612867929190612b4f565b5060408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff021916908315150217905550905050600a3390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506129b2565b61296b34600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612ae590919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b8260048190555060035460045414156129e1576001600060026101000a81548160ff0219169083151502179055505b3373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4346040518082815260200191505060405180910390a2505050565b600060029054906101000a900460ff1681565b600060039054906101000a900460ff1681565b600c81815481101515612a6957fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60006002544210158015612ac75750600060029054906101000a900460ff16155b905090565b6000828211151515612ada57fe5b818303905092915050565b60008183019050828110151515612af857fe5b80905092915050565b600080831415612b145760009050612b33565b8183029050818382811515612b2557fe5b04141515612b2f57fe5b8090505b92915050565b60008183811515612b4657fe5b04905092915050565b82805482825590600052602060002090601f01602090048101928215612be45791602002820160005b83821115612bb557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612b78565b8015612be25782816101000a81549060ff0219169055600101602081600001049283019260010302612bb5565b505b509050612bf19190612bf5565b5090565b612c2291905b80821115612c1e57600081816101000a81549060ff021916905550600101612bfb565b5090565b905600a165627a7a72305820b725d6ed533ba3c21fcb343e8c393171f8c562c1668224983554c10c88ce87060029", - "sourceMap": "87:12715:0:-;;;1437:1931;8:9:-1;5:2;;;30:1;27;20:12;5:2;1437:1931:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2194:19;2232:6;2287:20;1711:7;1697:10;:21;;1689:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1795:1;1775:9;:16;:21;;:47;;;;;1820:2;1800:9;:16;:22;;1775:47;1767:117;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1924:1;1902:11;:18;:23;;:51;;;;;1951:2;1929:11;:18;:24;;1902:51;1894:114;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2216:1;2194:23;;2241:1;2232:10;;2227:477;2248:11;:18;2244:1;:22;2227:477;;;2310:11;2322:1;2310:14;;;;;;;;;;;;;;;;;;2287:37;;2364:1;2346:15;:19;2338:71;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2440:35;2459:15;2440:14;:18;;;;;;:35;;;;;:::i;:::-;2423:52;;2489:10;2505:187;;;;;;;;;2541:15;2505:187;;;;2647:1;2505:187;;;;2601:1;2505:187;;;;2672:5;2505:187;;;;;2489:204;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;2489:204:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2268:3;;;;;;;2227:477;;;2739:10;2721:14;:28;2713:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2906:1;2878:25;:29;;;;2929:10;2917:9;:22;;;;2963:12;2949:11;;:26;;;;;;;;;;;;;;;;;;2996:9;2985:8;:20;;;;;;;;;;;;:::i;:::-;;3032:9;3026:3;:15;3015:8;:26;;;;3075:22;3051:21;:46;;;;3139:30;3107:29;;:62;;;;;;;;;;;;;;;;;;3200:5;3179:18;;:26;;;;;;;;;;;;;;;;;;3239:1;3215:21;:25;;;;3259:5;3250:6;;:14;;;;;;;;;;;;;;;;;;3360:1;3345:12;:16;;;;1437:1931;;;;;;;;;;87:12715;;1238:128:2;1298:9;1324:2;1319;:7;1315:11;;1344:2;1339:1;:7;;1332:15;;;;;;1360:1;1353:8;;1238:128;;;;:::o;87:12715:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;", - "deployedSourceMap": "87:12715:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;776:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;776:18:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1079:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1079:33:0;;;;;;;;;;;;;;;;;;;;;;;1150:51;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1150:51:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11263:234;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11263:234:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1005:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1005:25:0;;;;;;;;;;;;;;;;;;;;;;;922:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;922:20:0;;;;;;;;;;;;;;;;;;;;;;;6712:1039;;8:9:-1;5:2;;;30:1;27;20:12;5:2;6712:1039:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1036:37;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1036:37:0;;;;;;;;;;;;;;;;;;;;;;;1118:26;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1118:26:0;;;;;;;;;;;;;;;;;;;;;;;;;;;11129:128;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11129:128:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10068:587;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10068:587:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;9299:693;;8:9:-1;5:2;;;30:1;27;20:12;5:2;9299:693:0;;;;;;8724:569;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8724:569:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;1302:25;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1302:25:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11827:172;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11827:172:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;975:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;975:24:0;;;;;;;;;;;;;;;;;;;;;;;10752:371;;8:9:-1;5:2;;;30:1;27;20:12;5:2;10752:371:0;;;;;;11618:203;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11618:203:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5068:1638;;8:9:-1;5:2;;;30:1;27;20:12;5:2;5068:1638:0;;;;;;;;;;;;;;;;;;;;;;;;;;883:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;883:33:0;;;;;;;;;;;;;;;;;;;;;;;7757:961;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7757:961:0;;;;;;;;;;;;;;;;;;;;;;;;;;1207:32;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1207:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;948:21;;8:9:-1;5:2;;;30:1;27;20:12;5:2;948:21:0;;;;;;;;;;;;;;;;;;;;;;;12005:96;;8:9:-1;5:2;;;30:1;27;20:12;5:2;12005:96:0;;;;;;;;;;;;;;;;;;;;;;;3374:1688;;;;;;800:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;800:30:0;;;;;;;;;;;;;;;;;;;;;;;;;;;836:41;;8:9:-1;5:2;;;30:1;27;20:12;5:2;836:41:0;;;;;;;;;;;;;;;;;;;;;;;;;;;1401:29;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1401:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11503:109;;8:9:-1;5:2;;;30:1;27;20:12;5:2;11503:109:0;;;;;;;;;;;;;;;;;;;;;;;;;;;776:18;;;;;;;;;;;;;:::o;1079:33::-;;;;:::o;1150:51::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;11263:234::-;11311:4;11332:6;11341:1;11332:10;;11327:142;11348:8;:15;;;;11344:1;:19;11327:142;;;11402:8;11411:1;11402:11;;;;;;;;;;;;;;;;;;;;;;;;;;;11388:25;;:10;:25;;;11384:75;;;11440:4;11433:11;;;;11384:75;11365:3;;;;;;;11327:142;;;11485:5;11478:12;;11263:234;;;:::o;1005:25::-;;;;:::o;922:20::-;;;;:::o;6712:1039::-;6821:28;7017:27;7104:23;7190:16;12638:1;12591:12;:24;12604:10;12591:24;;;;;;;;;;;;;;;:43;;;:48;;12583:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12342:18;;;;;;;;;;;12334:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6852:12;:24;6865:10;6852:24;;;;;;;;;;;;;;;:41;;6894:5;6852:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6821:79;;6945:4;6918:31;;:23;:31;;;;6910:97;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7093:1;7047:10;7058:5;7047:17;;;;;;;;;;;;;;;;;;;;:43;;;:47;7017:77;;7177:3;7130:10;7141:5;7130:17;;;;;;;;;;;;;;;;;;;;:43;;;:50;;7104:76;;7209:22;:45;;;;;7236:18;7235:19;7209:45;7190:64;;7272:11;7264:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7378:4;7327:12;:24;7340:10;7327:24;;;;;;;;;;;;;;;:41;;7369:5;7327:48;;;;;;;;;;;;;;;;;;;;;;;;;;:55;;;;;;;;;;;;;;;;;;7397:4;7396:5;7392:353;;;7463:92;7511:12;:24;7524:10;7511:24;;;;;;;;;;;;;;;:43;;;7463:10;7474:5;7463:17;;;;;;;;;;;;;;;;;;;;:43;;;:47;;:92;;;;:::i;:::-;7417:10;7428:5;7417:17;;;;;;;;;;;;;;;;;;;;:43;;:138;;;;7392:353;;;7576:4;7572:173;;;7642:92;7690:12;:24;7703:10;7690:24;;;;;;;;;;;;;;;:43;;;7642:10;7653:5;7642:17;;;;;;;;;;;;;;;;;;;;:43;;;:47;;:92;;;;:::i;:::-;7596:10;7607:5;7596:17;;;;;;;;;;;;;;;;;;;;:43;;:138;;;;7572:173;7392:353;6712:1039;;;;;;:::o;1036:37::-;;;;:::o;1118:26::-;;;;;;;;;;;;;:::o;11129:128::-;11194:4;11238:12;;11217:18;11233:1;11217:11;:15;;:18;;;;:::i;:::-;:33;11210:40;;11129:128;;;:::o;10068:587::-;10189:15;10377:23;10459:19;12147:6;;;;;;;;;;;12139:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10145:6;;;;;;;;;;;10137:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10207:12;:27;10220:13;10207:27;;;;;;;;;;;;;;;:36;;;;;;;;;;;;10189:54;;10262:10;10261:11;10253:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10363:4;10324:12;:27;10337:13;10324:27;;;;;;;;;;;;;;;:36;;;:43;;;;;;;;;;;;;;;;;;10403:12;:27;10416:13;10403:27;;;;;;;;;;;;;;;:46;;;10377:72;;10481:64;10531:13;;10481:45;10512:4;10504:21;;;10481:18;:22;;:45;;;;:::i;:::-;:49;;:64;;;;:::i;:::-;10459:86;;10555:13;:22;;:38;10578:14;10555:38;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10555:38:0;10618:13;10608:40;;;10633:14;10608:40;;;;;;;;;;;;;;;;;;10068:587;;;;:::o;9299:693::-;9347:20;9397;9440:27;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9370:17;:15;:17::i;:::-;9347:40;;9420:10;:8;:10::i;:::-;9397:33;;9470:39;9487:21;;9470:16;:39::i;:::-;9440:69;;9527:15;:34;;;;9546:15;9527:34;:60;;;;9565:22;9527:60;9519:115;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9648:15;9644:272;;;9694:30;9679:12;;:45;;;;;;;;;;;;;;;;;;;;;;;;9644:272;;;9745:15;9741:175;;;9791:30;9776:12;;:45;;;;;;;;;;;;;;;;;;;;;;;;9741:175;;;9867:38;9852:12;;:53;;;;;;;;;;;;;;;;;;;;;;;;9741:175;9644:272;9934:4;9925:6;;:13;;;;;;;;;;;;;;;;;;9972:4;9964:21;;;9948:13;:37;;;;9299:693;;;:::o;8724:569::-;8812:15;12638:1;12591:12;:24;12604:10;12591:24;;;;;;;;;;;;;;;:43;;;:48;;12583:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12342:18;;;;;;;;;;;12334:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8830:12;:24;8843:10;8830:24;;;;;;;;;;;;;;;:35;;;;;;;;;;;;8812:53;;8891:10;8883:18;;:4;:18;;;;8875:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9000:4;8962:12;:24;8975:10;8962:24;;;;;;;;;;;;;;;:35;;;:42;;;;;;;;;;;;;;;;;;9019:4;9018:5;9014:273;;;9063:70;9089:12;:24;9102:10;9089:24;;;;;;;;;;;;;;;:43;;;9063:21;;:25;;:70;;;;:::i;:::-;9039:21;:94;;;;9014:273;;;9162:4;9158:129;;;9206:70;9232:12;:24;9245:10;9232:24;;;;;;;;;;;;;;;:43;;;9206:21;;:25;;:70;;;;:::i;:::-;9182:21;:94;;;;9158:129;9014:273;8724:569;;:::o;1302:25::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;11827:172::-;11918:4;11941:12;:32;11954:18;11941:32;;;;;;;;;;;;;;;:51;;;11934:58;;11827:172;;;:::o;975:24::-;;;;:::o;10752:371::-;10816:6;10875:26;12736:17;:15;:17::i;:::-;12728:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12147:6;;;;;;;;;;;12139:42;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10825:1;10816:10;;10811:271;10832:15;:22;;;;10828:1;:26;10811:271;;;10904:15;10920:1;10904:18;;;;;;;;;;;;;;;;;;;;;;;;;;;10875:47;;10941:12;:32;10954:18;10941:32;;;;;;;;;;;;;;;:41;;;;;;;;;;;;10940:42;10936:136;;;11002:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10936:136;10856:3;;;;;;;10811:271;;;11104:11;;;;;;;;;;;11091:25;;;11618:203;11725:4;11749:12;:32;11762:18;11749:32;;;;;;;;;;;;;;;:49;;11799:14;11749:65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11742:72;;11618:203;;;;:::o;5068:1638::-;5166:25;5226:26;5314;5527:19;5566:6;12736:17;:15;:17::i;:::-;12728:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12342:18;;;;;;;;;;;12334:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5194:10;5205:5;5194:17;;;;;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;5166:50;;5301:3;5255:10;5266:5;5255:17;;;;;;;;;;;;;;;;;;;;:43;;;:49;5226:78;;5343:61;5360:10;5371:5;5360:17;;;;;;;;;;;;;;;;;;;;:43;;;5343:16;:61::i;:::-;5314:90;;5469:20;5468:21;5460:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5549:2;5527:24;;5575:1;5566:10;;5561:150;5582:10;:17;;;;5578:1;:21;5561:150;;;5624:10;5635:1;5624:13;;;;;;;;;;;;;;;;;;;;:18;;;;;;;;;;;;5620:81;;;5684:1;5662:24;;5620:81;5601:3;;;;;;;5561:150;;;5761:1;5743:15;:19;5729:5;:34;5721:99;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5959:1;5912:10;5923:5;5912:17;;;;;;;;;;;;;;;;;;;;:43;;;:48;5908:792;;;5989:1;5980:5;:10;:43;;;;;5994:29;;;;;;;;;;;5980:43;5976:395;;;6240:1;6194:10;6205:5;6194:17;;;;;;;;;;;;;;;;;;;;:43;;:47;;;;5976:395;;;6326:30;6334:21;;6326:3;:7;;:30;;;;:::i;:::-;6280:10;6291:5;6280:17;;;;;;;;;;;;;;;;;;;;:43;;:76;;;;5976:395;5908:792;;;6544:21;:46;;;;;6569:21;6544:46;6540:160;;;6652:37;6660:28;6686:1;6660:21;;:25;;:28;;;;:::i;:::-;6652:3;:7;;:37;;;;:::i;:::-;6606:10;6617:5;6606:17;;;;;;;;;;;;;;;;;;;;:43;;:83;;;;6540:160;5908:792;5068:1638;;;;;;:::o;883:33::-;;;;:::o;7757:961::-;7838:26;7926:20;8020:25;8209:11;12342:18;;;;;;;;;;;12334:56;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7913:3;7867:10;7878:5;7867:17;;;;;;;;;;;;;;;;;;;;:43;;;:49;7838:78;;7949:61;7966:10;7977:5;7966:17;;;;;;;;;;;;;;;;;;;;:43;;;7949:16;:61::i;:::-;7926:84;;8048:10;8059:5;8048:17;;;;;;;;;;;;;;;;;;;;:22;;;;;;;;;;;;8020:50;;8084:21;:41;;;;;8110:15;8109:16;8084:41;:66;;;;;8130:20;8129:21;8084:66;8080:632;;;8191:4;8166:10;8177:5;8166:17;;;;;;;;;;;;;;;;;;;;:22;;;:29;;;;;;;;;;;;;;;;;;8223:10;8234:5;8223:17;;;;;;;;;;;;;;;;;;;;:24;;;8209:38;;8261:11;;;;;;;;;;;:20;;:28;8282:6;8261:28;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8261:28:0;8318:11;;;;;;;;;;;8308:30;;;8331:6;8308:30;;;;;;;;;;;;;;;;;;8440:1;8408:28;8430:5;8408:10;:17;;;;:21;;:28;;;;:::i;:::-;:33;8404:219;;;8596:11;;;;;;;;;;;8583:25;;;8404:219;8080:632;;;8653:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8080:632;7757:961;;;;;:::o;1207:32::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;948:21::-;;;;:::o;12005:96::-;12053:4;12081:12;;;;;;;;;;;12076:18;;;;;;;;12069:25;;12005:96;:::o;3374:1688::-;3481:20;4050:23;4124:21;12462:8;;12455:3;:15;;:38;;;;;12475:18;;;;;;;;;;;12474:19;12455:38;12447:75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;12248:6;;;;;;;;;;;12247:7;12239:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3504:27;3521:9;3504:12;;:16;;:27;;;;:::i;:::-;3481:50;;3568:9;;3549:15;:28;;3541:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4089:25;;4076:9;:38;;4050:64;;4167:9;;4148:15;:28;4124:52;;4194:18;:38;;;;4216:16;4194:38;4186:128;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4427:1;4380:12;:24;4393:10;4380:24;;;;;;;;;;;;;;;:43;;;:48;4376:502;;;4471:207;;;;;;;;;4521:9;4471:207;;;;4577:10;:17;;;;4566:29;;;;;;;;;;;;;;;;;;;;;;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;4566:29:0;;;;4471:207;;;;4625:5;4471:207;;;;;;4658:5;4471:207;;;;;4444:12;:24;4457:10;4444:24;;;;;;;;;;;;;;;:234;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4692:15;4713:10;4692:32;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;4692:32:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4376:502;;;4809:58;4857:9;4809:12;:24;4822:10;4809:24;;;;;;;;;;;;;;;:43;;;:47;;:58;;;;:::i;:::-;4763:12;:24;4776:10;4763:24;;;;;;;;;;;;;;;:43;;:104;;;;4376:502;4903:15;4888:12;:30;;;;4948:9;;4932:12;;:25;4928:81;;;4994:4;4973:18;;:25;;;;;;;;;;;;;;;;;;4928:81;5033:10;5023:32;;;5045:9;5023:32;;;;;;;;;;;;;;;;;;3374:1688;;;:::o;800:30::-;;;;;;;;;;;;;:::o;836:41::-;;;;;;;;;;;;;:::o;1401:29::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;11503:109::-;11544:4;11574:8;;11567:3;:15;;:38;;;;;11587:18;;;;;;;;;;;11586:19;11567:38;11560:45;;11503:109;:::o;1060:116:2:-;1120:7;1148:2;1142;:8;;1135:16;;;;;;1169:2;1164;:7;1157:14;;1060:116;;;;:::o;1238:128::-;1298:9;1324:2;1319;:7;1315:11;;1344:2;1339:1;:7;;1332:15;;;;;;1360:1;1353:8;;1238:128;;;;:::o;203:380::-;263:9;495:1;489:2;:7;485:36;;;513:1;506:8;;;;485:36;536:2;531;:7;527:11;;561:2;555;551:1;:6;;;;;;;;:12;544:20;;;;;;577:1;570:8;;203:380;;;;;:::o;665:283::-;725:7;941:2;936;:7;;;;;;;;929:14;;665:283;;;;:::o;87:12715:0:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", - "source": "pragma solidity ^0.4.24;\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\n\n\ncontract CrowdFund {\n using SafeMath for uint256;\n\n enum FreezeReason {\n CALLER_IS_TRUSTEE,\n CROWD_FUND_FAILED,\n MAJORITY_VOTING_TO_REFUND\n }\n\n FreezeReason freezeReason;\n\n struct Milestone {\n uint amount;\n uint amountVotingAgainstPayout;\n uint payoutRequestVoteDeadline;\n bool paid;\n }\n\n struct Contributor {\n uint contributionAmount;\n // array index bool reflect milestone index vote\n bool[] milestoneNoVotes;\n bool refundVote;\n bool refunded;\n }\n\n event Deposited(address indexed payee, uint256 weiAmount);\n event Withdrawn(address indexed payee, uint256 weiAmount);\n\n bool public frozen;\n bool public isRaiseGoalReached;\n bool public immediateFirstMilestonePayout;\n uint public milestoneVotingPeriod;\n uint public deadline;\n uint public raiseGoal;\n uint public amountRaised;\n uint public frozenBalance;\n uint public minimumContributionAmount;\n uint public amountVotingForRefund;\n address public beneficiary;\n mapping(address => Contributor) public contributors;\n address[] public contributorList;\n // authorized addresses to ask for milestone payouts\n address[] public trustees;\n // constructor ensures that all values combined equal raiseGoal\n Milestone[] public milestones;\n\n constructor(\n uint _raiseGoal,\n address _beneficiary,\n address[] _trustees,\n uint[] _milestones,\n uint _deadline,\n uint _milestoneVotingPeriod,\n bool _immediateFirstMilestonePayout)\n public {\n require(_raiseGoal >= 1 ether, \"Raise goal is smaller than 1 ether\");\n require(_trustees.length >= 1 && _trustees.length <= 10, \"Trustee addresses must be at least 1 and not more than 10\");\n require(_milestones.length >= 1 && _milestones.length <= 10, \"Milestones must be at least 1 and not more than 10\");\n // TODO - require minimum duration\n // TODO - require minimum milestone voting period\n\n // ensure that cumalative milestone payouts equal raiseGoalAmount\n uint milestoneTotal = 0;\n for (uint i = 0; i < _milestones.length; i++) {\n uint milestoneAmount = _milestones[i];\n require(milestoneAmount > 0, \"Milestone amount must be greater than 0\");\n milestoneTotal = milestoneTotal.add(milestoneAmount);\n milestones.push(Milestone({\n amount: milestoneAmount,\n payoutRequestVoteDeadline: 0,\n amountVotingAgainstPayout: 0,\n paid: false\n }));\n }\n require(milestoneTotal == _raiseGoal, \"Milestone total must equal raise goal\");\n // TODO - increase minimum contribution amount is 0.1% of raise goal\n minimumContributionAmount = 1;\n raiseGoal = _raiseGoal;\n beneficiary = _beneficiary;\n trustees = _trustees;\n deadline = now + _deadline;\n milestoneVotingPeriod = _milestoneVotingPeriod;\n immediateFirstMilestonePayout = _immediateFirstMilestonePayout;\n isRaiseGoalReached = false;\n amountVotingForRefund = 0;\n frozen = false;\n // assumes no ether contributed as part of contract deployment\n amountRaised = 0;\n }\n\n function contribute() public payable onlyOnGoing onlyUnfrozen {\n // don't allow overfunding\n uint newAmountRaised = amountRaised.add(msg.value);\n require(newAmountRaised <= raiseGoal, \"Contribution exceeds the raise goal.\");\n // require minimumContributionAmount (set during construction)\n // there may be a special case where just enough has been raised so that the remaining raise amount is just smaller than the minimumContributionAmount\n // in this case, allow that the msg.value + amountRaised will equal the raiseGoal.\n // This makes sure that we don't enter a scenario where a proposal can never be fully funded\n bool greaterThanMinimum = msg.value >= minimumContributionAmount;\n bool exactlyRaiseGoal = newAmountRaised == raiseGoal;\n require(greaterThanMinimum || exactlyRaiseGoal, \"msg.value greater than minimum, or msg.value == remaining amount to be raised\");\n // in cases where an address pays > 1 times\n if (contributors[msg.sender].contributionAmount == 0) {\n contributors[msg.sender] = Contributor({\n contributionAmount: msg.value,\n milestoneNoVotes: new bool[](milestones.length),\n refundVote: false,\n refunded: false\n });\n contributorList.push(msg.sender);\n }\n else {\n contributors[msg.sender].contributionAmount = contributors[msg.sender].contributionAmount.add(msg.value);\n }\n\n amountRaised = newAmountRaised;\n if (amountRaised == raiseGoal) {\n isRaiseGoalReached = true;\n }\n emit Deposited(msg.sender, msg.value);\n }\n\n function requestMilestonePayout (uint index) public onlyTrustee onlyRaised onlyUnfrozen {\n bool milestoneAlreadyPaid = milestones[index].paid;\n bool voteDeadlineHasPassed = milestones[index].payoutRequestVoteDeadline > now;\n bool majorityAgainstPayout = isMajorityVoting(milestones[index].amountVotingAgainstPayout);\n // prevent requesting paid milestones\n require(!milestoneAlreadyPaid, \"Milestone already paid\");\n\n int lowestIndexPaid = -1;\n for (uint i = 0; i < milestones.length; i++) {\n if (milestones[i].paid) {\n lowestIndexPaid = int(i);\n }\n }\n\n require(index == uint(lowestIndexPaid + 1), \"Milestone request must be for first unpaid milestone\");\n // begin grace period for contributors to vote no on milestone payout\n if (milestones[index].payoutRequestVoteDeadline == 0) {\n if (index == 0 && immediateFirstMilestonePayout) {\n // make milestone payouts immediately avtheailable for the first milestone if immediateFirstMilestonePayout is set during consutrction\n milestones[index].payoutRequestVoteDeadline = 1;\n } else {\n milestones[index].payoutRequestVoteDeadline = now.add(milestoneVotingPeriod);\n }\n }\n // if the payoutRequestVoteDealine has passed and majority voted against it previously, begin the grace period with 2 times the deadline\n else if (voteDeadlineHasPassed && majorityAgainstPayout) {\n milestones[index].payoutRequestVoteDeadline = now.add(milestoneVotingPeriod.mul(2));\n }\n }\n\n function voteMilestonePayout(uint index, bool vote) public onlyContributor onlyRaised onlyUnfrozen {\n bool existingMilestoneNoVote = contributors[msg.sender].milestoneNoVotes[index];\n require(existingMilestoneNoVote != vote, \"Vote value must be different than existing vote state\");\n bool milestoneVotingStarted = milestones[index].payoutRequestVoteDeadline > 0;\n bool votePeriodHasEnded = milestones[index].payoutRequestVoteDeadline <= now;\n bool onGoingVote = milestoneVotingStarted && !votePeriodHasEnded;\n require(onGoingVote, \"Milestone voting must be open\");\n contributors[msg.sender].milestoneNoVotes[index] = vote;\n if (!vote) {\n milestones[index].amountVotingAgainstPayout = milestones[index].amountVotingAgainstPayout.sub(contributors[msg.sender].contributionAmount);\n } else if (vote) {\n milestones[index].amountVotingAgainstPayout = milestones[index].amountVotingAgainstPayout.add(contributors[msg.sender].contributionAmount);\n }\n }\n\n function payMilestonePayout(uint index) public onlyRaised onlyUnfrozen {\n bool voteDeadlineHasPassed = milestones[index].payoutRequestVoteDeadline < now;\n bool majorityVotedNo = isMajorityVoting(milestones[index].amountVotingAgainstPayout);\n bool milestoneAlreadyPaid = milestones[index].paid;\n if (voteDeadlineHasPassed && !majorityVotedNo && !milestoneAlreadyPaid) {\n milestones[index].paid = true;\n uint amount = milestones[index].amount;\n beneficiary.transfer(amount);\n emit Withdrawn(beneficiary, amount);\n // if the final milestone just got paid\n if (milestones.length.sub(index) == 1) {\n // useful to selfdestruct in case funds were forcefully deposited into contract. otherwise they are lost.\n selfdestruct(beneficiary);\n }\n } else {\n revert(\"required conditions were not satisfied\");\n }\n }\n\n function voteRefund(bool vote) public onlyContributor onlyRaised onlyUnfrozen {\n bool refundVote = contributors[msg.sender].refundVote;\n require(vote != refundVote, \"Existing vote state is identical to vote value\");\n contributors[msg.sender].refundVote = vote;\n if (!vote) {\n amountVotingForRefund = amountVotingForRefund.sub(contributors[msg.sender].contributionAmount);\n }\n else if (vote) {\n amountVotingForRefund = amountVotingForRefund.add(contributors[msg.sender].contributionAmount);\n }\n }\n\n function refund() public onlyUnfrozen {\n bool callerIsTrustee = isCallerTrustee();\n bool crowdFundFailed = isFailed();\n bool majorityVotingToRefund = isMajorityVoting(amountVotingForRefund);\n require(callerIsTrustee || crowdFundFailed || majorityVotingToRefund, \"Required conditions for refund are not met\");\n if (callerIsTrustee) {\n freezeReason = FreezeReason.CALLER_IS_TRUSTEE;\n } else if (crowdFundFailed) {\n freezeReason = FreezeReason.CROWD_FUND_FAILED;\n } else {\n freezeReason = FreezeReason.MAJORITY_VOTING_TO_REFUND;\n }\n frozen = true;\n frozenBalance = address(this).balance;\n }\n\n // anyone can refund a contributor if a crowdfund has been frozen\n function withdraw(address refundAddress) public onlyFrozen {\n require(frozen, \"CrowdFund is not frozen\");\n bool isRefunded = contributors[refundAddress].refunded;\n require(!isRefunded, \"Specified address is already refunded\");\n contributors[refundAddress].refunded = true;\n uint contributionAmount = contributors[refundAddress].contributionAmount;\n uint amountToRefund = contributionAmount.mul(address(this).balance).div(frozenBalance);\n refundAddress.transfer(amountToRefund);\n emit Withdrawn(refundAddress, amountToRefund);\n }\n\n // it may be useful to selfdestruct in case funds were force deposited to the contract\n function destroy() public onlyTrustee onlyFrozen {\n for (uint i = 0; i < contributorList.length; i++) {\n address contributorAddress = contributorList[i];\n if (!contributors[contributorAddress].refunded) {\n revert(\"At least one contributor has not yet refunded\");\n }\n }\n selfdestruct(beneficiary);\n }\n\n function isMajorityVoting(uint valueVoting) public view returns (bool) {\n return valueVoting.mul(2) > amountRaised;\n }\n\n function isCallerTrustee() public view returns (bool) {\n for (uint i = 0; i < trustees.length; i++) {\n if (msg.sender == trustees[i]) {\n return true;\n }\n }\n return false;\n }\n\n function isFailed() public view returns (bool) {\n return now >= deadline && !isRaiseGoalReached;\n }\n\n function getContributorMilestoneVote(address contributorAddress, uint milestoneIndex) public view returns (bool) { \n return contributors[contributorAddress].milestoneNoVotes[milestoneIndex];\n }\n\n function getContributorContributionAmount(address contributorAddress) public view returns (uint) {\n return contributors[contributorAddress].contributionAmount;\n }\n\n function getFreezeReason() public view returns (uint) {\n return uint(freezeReason);\n }\n\n modifier onlyFrozen() {\n require(frozen, \"CrowdFund is not frozen\");\n _;\n }\n\n modifier onlyUnfrozen() {\n require(!frozen, \"CrowdFund is frozen\");\n _;\n }\n\n modifier onlyRaised() {\n require(isRaiseGoalReached, \"Raise goal is not reached\");\n _;\n }\n\n modifier onlyOnGoing() {\n require(now <= deadline && !isRaiseGoalReached, \"CrowdFund is not ongoing\");\n _;\n }\n\n modifier onlyContributor() {\n require(contributors[msg.sender].contributionAmount != 0, \"Caller is not a contributor\");\n _;\n }\n\n modifier onlyTrustee() {\n require(isCallerTrustee(), \"Caller is not a trustee\");\n _;\n }\n\n}", - "sourcePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFund.sol", - "ast": { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFund.sol", - "exportedSymbols": { - "CrowdFund": [ - 1080 - ] - }, - "id": 1081, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.4", - ".24" - ], - "nodeType": "PragmaDirective", - "src": "0:24:0" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1081, - "sourceUnit": 1233, - "src": "25:59:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1080, - "linearizedBaseContracts": [ - 1080 - ], - "name": "CrowdFund", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 5, - "libraryName": { - "contractScope": null, - "id": 3, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1232, - "src": "118:8:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$1232", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "112:27:0", - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "131:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "canonicalName": "CrowdFund.FreezeReason", - "id": 9, - "members": [ - { - "id": 6, - "name": "CALLER_IS_TRUSTEE", - "nodeType": "EnumValue", - "src": "173:17:0" - }, - { - "id": 7, - "name": "CROWD_FUND_FAILED", - "nodeType": "EnumValue", - "src": "200:17:0" - }, - { - "id": 8, - "name": "MAJORITY_VOTING_TO_REFUND", - "nodeType": "EnumValue", - "src": "227:25:0" - } - ], - "name": "FreezeReason", - "nodeType": "EnumDefinition", - "src": "145:113:0" - }, - { - "constant": false, - "id": 11, - "name": "freezeReason", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "264:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - }, - "typeName": { - "contractScope": null, - "id": 10, - "name": "FreezeReason", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9, - "src": "264:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "value": null, - "visibility": "internal" - }, - { - "canonicalName": "CrowdFund.Milestone", - "id": 20, - "members": [ - { - "constant": false, - "id": 13, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "323:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 12, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 15, - "name": "amountVotingAgainstPayout", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "344:30:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 14, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "344:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 17, - "name": "payoutRequestVoteDeadline", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "384:30:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 16, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 19, - "name": "paid", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "424:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 18, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "424:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Milestone", - "nodeType": "StructDefinition", - "scope": 1080, - "src": "296:144:0", - "visibility": "public" - }, - { - "canonicalName": "CrowdFund.Contributor", - "id": 30, - "members": [ - { - "constant": false, - "id": 22, - "name": "contributionAmount", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "475:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 25, - "name": "milestoneNoVotes", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "565:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - }, - "typeName": { - "baseType": { - "id": 23, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "565:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 24, - "length": null, - "nodeType": "ArrayTypeName", - "src": "565:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 27, - "name": "refundVote", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "598:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 26, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "598:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 29, - "name": "refunded", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "623:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 28, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "623:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Contributor", - "nodeType": "StructDefinition", - "scope": 1080, - "src": "446:197:0", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 36, - "name": "Deposited", - "nodeType": "EventDefinition", - "parameters": { - "id": 35, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 32, - "indexed": true, - "name": "payee", - "nodeType": "VariableDeclaration", - "scope": 36, - "src": "665:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "indexed": false, - "name": "weiAmount", - "nodeType": "VariableDeclaration", - "scope": 36, - "src": "688:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "688:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "664:42:0" - }, - "src": "649:58:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 42, - "name": "Withdrawn", - "nodeType": "EventDefinition", - "parameters": { - "id": 41, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 38, - "indexed": true, - "name": "payee", - "nodeType": "VariableDeclaration", - "scope": 42, - "src": "728:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 37, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "728:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 40, - "indexed": false, - "name": "weiAmount", - "nodeType": "VariableDeclaration", - "scope": 42, - "src": "751:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 39, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "751:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "727:42:0" - }, - "src": "712:58:0" - }, - { - "constant": false, - "id": 44, - "name": "frozen", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "776:18:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 43, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "776:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 46, - "name": "isRaiseGoalReached", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "800:30:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 45, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 48, - "name": "immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "836:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 47, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 50, - "name": "milestoneVotingPeriod", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "883:33:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 49, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "883:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 52, - "name": "deadline", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "922:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 51, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 54, - "name": "raiseGoal", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "948:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 53, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "948:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 56, - "name": "amountRaised", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "975:24:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 55, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "975:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 58, - "name": "frozenBalance", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1005:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 57, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1005:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 60, - "name": "minimumContributionAmount", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1036:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 59, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1036:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 62, - "name": "amountVotingForRefund", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1079:33:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 61, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1079:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 64, - "name": "beneficiary", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1118:26:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 63, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1118:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 68, - "name": "contributors", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1150:51:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1158:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1150:31:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "Contributor", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 30, - "src": "1169:11:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage_ptr", - "typeString": "struct CrowdFund.Contributor" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 71, - "name": "contributorList", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1207:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 69, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1207:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 70, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1207:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 74, - "name": "trustees", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1302:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 72, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1302:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 73, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1302:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 77, - "name": "milestones", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1401:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone[]" - }, - "typeName": { - "baseType": { - "contractScope": null, - "id": 75, - "name": "Milestone", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 20, - "src": "1401:9:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage_ptr", - "typeString": "struct CrowdFund.Milestone" - } - }, - "id": 76, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1401:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage_ptr", - "typeString": "struct CrowdFund.Milestone[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 230, - "nodeType": "Block", - "src": "1679:1689:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 97, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "1697:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 98, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1711:7:0", - "subdenomination": "ether", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1" - }, - "src": "1697:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526169736520676f616c20697320736d616c6c6572207468616e2031206574686572", - "id": 100, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1720:36:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_26795146958ed9fbe8e87984c5fe089e4c2d8b62328649a7a4271f6acc61ad53", - "typeString": "literal_string \"Raise goal is smaller than 1 ether\"" - }, - "value": "Raise goal is smaller than 1 ether" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_26795146958ed9fbe8e87984c5fe089e4c2d8b62328649a7a4271f6acc61ad53", - "typeString": "literal_string \"Raise goal is smaller than 1 ether\"" - } - ], - "id": 96, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1689:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1689:68:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 102, - "nodeType": "ExpressionStatement", - "src": "1689:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 104, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "1775:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1775:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1795:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1775:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 108, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "1800:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1800:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 110, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1820:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "1800:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1775:47:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "5472757374656520616464726573736573206d757374206265206174206c65617374203120616e64206e6f74206d6f7265207468616e203130", - "id": 113, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1824:59:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6f2fb94a1426f6092f6f6ba2fe0c80c7b869c8844f1b5c7d223031cf3376dbf4", - "typeString": "literal_string \"Trustee addresses must be at least 1 and not more than 10\"" - }, - "value": "Trustee addresses must be at least 1 and not more than 10" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6f2fb94a1426f6092f6f6ba2fe0c80c7b869c8844f1b5c7d223031cf3376dbf4", - "typeString": "literal_string \"Trustee addresses must be at least 1 and not more than 10\"" - } - ], - "id": 103, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1767:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1767:117:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 115, - "nodeType": "ExpressionStatement", - "src": "1767:117:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 120, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 117, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1902:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1902:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1924:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1902:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 121, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1929:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1929:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1951:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "1929:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1902:51:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6573206d757374206265206174206c65617374203120616e64206e6f74206d6f7265207468616e203130", - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1955:52:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_fa063e6a0c1c7b99eb5a849143b837901d68276acbf0f2c8247eed588a181ee2", - "typeString": "literal_string \"Milestones must be at least 1 and not more than 10\"" - }, - "value": "Milestones must be at least 1 and not more than 10" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_fa063e6a0c1c7b99eb5a849143b837901d68276acbf0f2c8247eed588a181ee2", - "typeString": "literal_string \"Milestones must be at least 1 and not more than 10\"" - } - ], - "id": 116, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1894:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1894:114:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 128, - "nodeType": "ExpressionStatement", - "src": "1894:114:0" - }, - { - "assignments": [ - 130 - ], - "declarations": [ - { - "constant": false, - "id": 130, - "name": "milestoneTotal", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2194:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 129, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2194:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 132, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2216:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2194:23:0" - }, - { - "body": { - "id": 175, - "nodeType": "Block", - "src": "2273:431:0", - "statements": [ - { - "assignments": [ - 145 - ], - "declarations": [ - { - "constant": false, - "id": 145, - "name": "milestoneAmount", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2287:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 144, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2287:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 146, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "2310:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 148, - "indexExpression": { - "argumentTypes": null, - "id": 147, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2322:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2310:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2287:37:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 153, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 151, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2346:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 152, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2346:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520616d6f756e74206d7573742062652067726561746572207468616e2030", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2367:41:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8340f04f5ef6bd7e467fa70ba384c629e679986a39f0f5df8217fa4a3bb37fb3", - "typeString": "literal_string \"Milestone amount must be greater than 0\"" - }, - "value": "Milestone amount must be greater than 0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8340f04f5ef6bd7e467fa70ba384c629e679986a39f0f5df8217fa4a3bb37fb3", - "typeString": "literal_string \"Milestone amount must be greater than 0\"" - } - ], - "id": 150, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "2338:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2338:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 156, - "nodeType": "ExpressionStatement", - "src": "2338:71:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 157, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2423:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 160, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2459:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 158, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2440:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "2440: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": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2440:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2423:52:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "2423:52:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 168, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2541:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2601:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2647:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2672:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": null, - "id": 167, - "name": "Milestone", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2505:9:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Milestone_$20_storage_ptr_$", - "typeString": "type(struct CrowdFund.Milestone storage pointer)" - } - }, - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "amount", - "payoutRequestVoteDeadline", - "amountVotingAgainstPayout", - "paid" - ], - "nodeType": "FunctionCall", - "src": "2505:187:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_memory", - "typeString": "struct CrowdFund.Milestone memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_struct$_Milestone_$20_memory", - "typeString": "struct CrowdFund.Milestone memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 164, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2489:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2489:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_Milestone_$20_storage_$returns$_t_uint256_$", - "typeString": "function (struct CrowdFund.Milestone storage ref) returns (uint256)" - } - }, - "id": 173, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2489:204:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 174, - "nodeType": "ExpressionStatement", - "src": "2489:204:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 137, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2244:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 138, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "2248:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2248:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2244:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 176, - "initializationExpression": { - "assignments": [ - 134 - ], - "declarations": [ - { - "constant": false, - "id": 134, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2232:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2232:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 136, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2241:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2232:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 142, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2268:3:0", - "subExpression": { - "argumentTypes": null, - "id": 141, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2268:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 143, - "nodeType": "ExpressionStatement", - "src": "2268:3:0" - }, - "nodeType": "ForStatement", - "src": "2227:477:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 178, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2721:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 179, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "2739:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2721:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520746f74616c206d75737420657175616c20726169736520676f616c", - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2751:39:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_3ce6e124acdc65e75fdb7bed5df7531503580223492fe0e86777f092c6d736e4", - "typeString": "literal_string \"Milestone total must equal raise goal\"" - }, - "value": "Milestone total must equal raise goal" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_3ce6e124acdc65e75fdb7bed5df7531503580223492fe0e86777f092c6d736e4", - "typeString": "literal_string \"Milestone total must equal raise goal\"" - } - ], - "id": 177, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "2713:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 182, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2713:78:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 183, - "nodeType": "ExpressionStatement", - "src": "2713:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 184, - "name": "minimumContributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "2878:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2906:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2878:29:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "2878:29:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "2917:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "2929:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2917:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "2917:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 194, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 192, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "2949:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 193, - "name": "_beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "2963:12:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2949:26:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 195, - "nodeType": "ExpressionStatement", - "src": "2949:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 196, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "2985:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 197, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "2996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "2985:20:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 199, - "nodeType": "ExpressionStatement", - "src": "2985:20:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 204, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 200, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "3015:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 203, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 201, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "3026:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 202, - "name": "_deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 89, - "src": "3032:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3026:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3015:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 205, - "nodeType": "ExpressionStatement", - "src": "3015:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "3051:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 207, - "name": "_milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 91, - "src": "3075:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3051:46:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "3051:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 210, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "3107:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 211, - "name": "_immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 93, - "src": "3139:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3107:62:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "3107:62:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 214, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "3179:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 215, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3200:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "3179:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 217, - "nodeType": "ExpressionStatement", - "src": "3179:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 218, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "3215:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3239:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3215:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 221, - "nodeType": "ExpressionStatement", - "src": "3215:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 222, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "3250:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3259:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "3250:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 225, - "nodeType": "ExpressionStatement", - "src": "3250:14:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 226, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "3345:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3360:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3345:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "3345:16:0" - } - ] - }, - "documentation": null, - "id": 231, - "implemented": true, - "isConstructor": true, - "isDeclaredConst": false, - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 94, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 79, - "name": "_raiseGoal", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1458:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1458:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "_beneficiary", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1483:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 80, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1483:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 84, - "name": "_trustees", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1513:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 82, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1513:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 83, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1513:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 87, - "name": "_milestones", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1542:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 85, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1542:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 86, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1542:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 89, - "name": "_deadline", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1570:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 88, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1570:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 91, - "name": "_milestoneVotingPeriod", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1594:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 90, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1594:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 93, - "name": "_immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1631:35:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 92, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1631:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1448:219:0" - }, - "payable": false, - "returnParameters": { - "id": 95, - "nodeType": "ParameterList", - "parameters": [], - "src": "1679:0:0" - }, - "scope": 1080, - "src": "1437:1931:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 344, - "nodeType": "Block", - "src": "3436:1626:0", - "statements": [ - { - "assignments": [ - 239 - ], - "declarations": [ - { - "constant": false, - "id": 239, - "name": "newAmountRaised", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "3481:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 238, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3481:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 245, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 242, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "3521:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3521:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 240, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "3504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 241, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "3504:16: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": 244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3504:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3481:50:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 247, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "3549:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 248, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "3568:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3549:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e747269627574696f6e20657863656564732074686520726169736520676f616c2e", - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3579:38:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f0b2440b5298f52584e66c42ff46ffb5990bc57d408f53ff052d607205091f05", - "typeString": "literal_string \"Contribution exceeds the raise goal.\"" - }, - "value": "Contribution exceeds the raise goal." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f0b2440b5298f52584e66c42ff46ffb5990bc57d408f53ff052d607205091f05", - "typeString": "literal_string \"Contribution exceeds the raise goal.\"" - } - ], - "id": 246, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "3541:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 251, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3541:77:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 252, - "nodeType": "ExpressionStatement", - "src": "3541:77:0" - }, - { - "assignments": [ - 254 - ], - "declarations": [ - { - "constant": false, - "id": 254, - "name": "greaterThanMinimum", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "4050:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 253, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4050:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 259, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 258, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 255, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4076:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4076:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 257, - "name": "minimumContributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "4089:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4076:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4050:64:0" - }, - { - "assignments": [ - 261 - ], - "declarations": [ - { - "constant": false, - "id": 261, - "name": "exactlyRaiseGoal", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "4124:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 260, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4124:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 265, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 262, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "4148:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 263, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "4167:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4148:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4124:52:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 267, - "name": "greaterThanMinimum", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 254, - "src": "4194:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 268, - "name": "exactlyRaiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4216:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4194:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "6d73672e76616c75652067726561746572207468616e206d696e696d756d2c206f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7420746f20626520726169736564", - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4234:79:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_daec81a65fdf63ff22cc80539bfb1e860ba5e1c917be2dc57d9c7bffbe8d96a0", - "typeString": "literal_string \"msg.value greater than minimum, or msg.value == remaining amount to be raised\"" - }, - "value": "msg.value greater than minimum, or msg.value == remaining amount to be raised" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_daec81a65fdf63ff22cc80539bfb1e860ba5e1c917be2dc57d9c7bffbe8d96a0", - "typeString": "literal_string \"msg.value greater than minimum, or msg.value == remaining amount to be raised\"" - } - ], - "id": 266, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "4186:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4186:128:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 272, - "nodeType": "ExpressionStatement", - "src": "4186:128:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 273, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4380:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 276, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 274, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4393:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4393:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4380:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 277, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4380:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 278, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4427:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4380:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 322, - "nodeType": "Block", - "src": "4749:129:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4763:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 309, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 307, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4776:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4776:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4763:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 310, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4763:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 317, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4857:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 318, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4857:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 311, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4809:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 312, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4822:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4822:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4809:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 315, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4809:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "4809:47: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": 319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4809:58:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4763:104:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 321, - "nodeType": "ExpressionStatement", - "src": "4763:104:0" - } - ] - }, - "id": 323, - "nodeType": "IfStatement", - "src": "4376:502:0", - "trueBody": { - "id": 305, - "nodeType": "Block", - "src": "4430:305:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 296, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 280, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4444:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 283, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 281, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4457:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4457:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4444:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 285, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4521:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 286, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4521:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 290, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "4577:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 291, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4577:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "4566:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_bool_$dyn_memory_$", - "typeString": "function (uint256) pure returns (bool[] memory)" - }, - "typeName": { - "baseType": { - "id": 287, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4570:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 288, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4570:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - } - } - }, - "id": 292, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4566:29:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_memory", - "typeString": "bool[] memory" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4625:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4658:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": null, - "id": 284, - "name": "Contributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "4471:11:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Contributor_$30_storage_ptr_$", - "typeString": "type(struct CrowdFund.Contributor storage pointer)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "contributionAmount", - "milestoneNoVotes", - "refundVote", - "refunded" - ], - "nodeType": "FunctionCall", - "src": "4471:207:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_memory", - "typeString": "struct CrowdFund.Contributor memory" - } - }, - "src": "4444:234:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 297, - "nodeType": "ExpressionStatement", - "src": "4444:234:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 301, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4713:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "4692:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4692:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4692:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 304, - "nodeType": "ExpressionStatement", - "src": "4692:32:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 324, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "4888:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 325, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "4903:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4888:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 327, - "nodeType": "ExpressionStatement", - "src": "4888:30:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 328, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "4932:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 329, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "4948:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4932:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 336, - "nodeType": "IfStatement", - "src": "4928:81:0", - "trueBody": { - "id": 335, - "nodeType": "Block", - "src": "4959:50:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 331, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "4973:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 332, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4994:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "4973:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 334, - "nodeType": "ExpressionStatement", - "src": "4973:25:0" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 338, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "5033:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5033:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 340, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "5045:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5045:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "Deposited", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 36, - "src": "5023:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 342, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5023:32:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 343, - "nodeType": "EmitStatement", - "src": "5018:37:0" - } - ] - }, - "documentation": null, - "id": 345, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 234, - "modifierName": { - "argumentTypes": null, - "id": 233, - "name": "onlyOnGoing", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1054, - "src": "3411:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3411:11:0" - }, - { - "arguments": null, - "id": 236, - "modifierName": { - "argumentTypes": null, - "id": 235, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "3423:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3423:12:0" - } - ], - "name": "contribute", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 232, - "nodeType": "ParameterList", - "parameters": [], - "src": "3393:2:0" - }, - "payable": true, - "returnParameters": { - "id": 237, - "nodeType": "ParameterList", - "parameters": [], - "src": "3436:0:0" - }, - "scope": 1080, - "src": "3374:1688:0", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 479, - "nodeType": "Block", - "src": "5156:1550:0", - "statements": [ - { - "assignments": [ - 357 - ], - "declarations": [ - { - "constant": false, - "id": 357, - "name": "milestoneAlreadyPaid", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5166:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 356, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5166:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 362, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 358, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5194:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 360, - "indexExpression": { - "argumentTypes": null, - "id": 359, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5205:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5194:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 361, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "5194:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5166:50:0" - }, - { - "assignments": [ - 364 - ], - "declarations": [ - { - "constant": false, - "id": 364, - "name": "voteDeadlineHasPassed", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5226:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 363, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5226:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 371, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 370, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 365, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5255:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 367, - "indexExpression": { - "argumentTypes": null, - "id": 366, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5266:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5255:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 368, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "5255:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 369, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "5301:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5255:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5226:78:0" - }, - { - "assignments": [ - 373 - ], - "declarations": [ - { - "constant": false, - "id": 373, - "name": "majorityAgainstPayout", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5314:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 372, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5314:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 380, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 375, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5360:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 377, - "indexExpression": { - "argumentTypes": null, - "id": 376, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5371:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5360:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 378, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "5360:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 374, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "5343:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 379, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5343:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5314:90:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 383, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "5468:21:0", - "subExpression": { - "argumentTypes": null, - "id": 382, - "name": "milestoneAlreadyPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 357, - "src": "5469:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520616c72656164792070616964", - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5491:24:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_dd4d403a6ac484772597de76d12f4c453245b6a9170210c47567df5d5a4b5442", - "typeString": "literal_string \"Milestone already paid\"" - }, - "value": "Milestone already paid" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_dd4d403a6ac484772597de76d12f4c453245b6a9170210c47567df5d5a4b5442", - "typeString": "literal_string \"Milestone already paid\"" - } - ], - "id": 381, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "5460:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5460:56:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "5460:56:0" - }, - { - "assignments": [ - 388 - ], - "declarations": [ - { - "constant": false, - "id": 388, - "name": "lowestIndexPaid", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5527:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 387, - "name": "int", - "nodeType": "ElementaryTypeName", - "src": "5527:3:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 391, - "initialValue": { - "argumentTypes": null, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "5549:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5550:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_-1_by_1", - "typeString": "int_const -1" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5527:24:0" - }, - { - "body": { - "id": 415, - "nodeType": "Block", - "src": "5606:105:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 403, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5624:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 405, - "indexExpression": { - "argumentTypes": null, - "id": 404, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5635:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5624:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 406, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "5624:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 414, - "nodeType": "IfStatement", - "src": "5620:81:0", - "trueBody": { - "id": 413, - "nodeType": "Block", - "src": "5644:57:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 407, - "name": "lowestIndexPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 388, - "src": "5662:15:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 409, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5684:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 408, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5680:3:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_int256_$", - "typeString": "type(int256)" - }, - "typeName": "int" - }, - "id": 410, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5680:6:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "src": "5662:24:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "5662:24:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 396, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5578:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 397, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5582:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 398, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5582:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5578:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 416, - "initializationExpression": { - "assignments": [ - 393 - ], - "declarations": [ - { - "constant": false, - "id": 393, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5566:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 392, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 395, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5575:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5566:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 401, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5601:3:0", - "subExpression": { - "argumentTypes": null, - "id": 400, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5601:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 402, - "nodeType": "ExpressionStatement", - "src": "5601:3:0" - }, - "nodeType": "ForStatement", - "src": "5561:150:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 418, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5729:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "id": 422, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 420, - "name": "lowestIndexPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 388, - "src": "5743:15:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 421, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5761:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5743:19:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5738:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 423, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5738:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5729:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e652072657175657374206d75737420626520666f7220666972737420756e70616964206d696c6573746f6e65", - "id": 425, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5765:54:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_109e56ab422d6e7b920445e49fcf1dac376eba8dda71ea922747d3a4bf8e6081", - "typeString": "literal_string \"Milestone request must be for first unpaid milestone\"" - }, - "value": "Milestone request must be for first unpaid milestone" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_109e56ab422d6e7b920445e49fcf1dac376eba8dda71ea922747d3a4bf8e6081", - "typeString": "literal_string \"Milestone request must be for first unpaid milestone\"" - } - ], - "id": 417, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "5721:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5721:99:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "5721:99:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 428, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5912:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 430, - "indexExpression": { - "argumentTypes": null, - "id": 429, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5923:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5912:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 431, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "5912:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 432, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5959:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5912:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 460, - "name": "voteDeadlineHasPassed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 364, - "src": "6544:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 461, - "name": "majorityAgainstPayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 373, - "src": "6569:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "6544:46:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 477, - "nodeType": "IfStatement", - "src": "6540:160:0", - "trueBody": { - "id": 476, - "nodeType": "Block", - "src": "6592:108:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 463, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6606:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 465, - "indexExpression": { - "argumentTypes": null, - "id": 464, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6606:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 466, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6606:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "32", - "id": 471, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6686:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 469, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "6660:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 470, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "6660:25: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": 472, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6660:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 467, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "6652:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 468, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "6652:7: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": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6652:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6606:83:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 475, - "nodeType": "ExpressionStatement", - "src": "6606:83:0" - } - ] - } - }, - "id": 478, - "nodeType": "IfStatement", - "src": "5908:792:0", - "trueBody": { - "id": 459, - "nodeType": "Block", - "src": "5962:419:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 438, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 434, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5980:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5989:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5980:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 437, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "5994:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "5980:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 457, - "nodeType": "Block", - "src": "6262:109:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 447, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6280:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 449, - "indexExpression": { - "argumentTypes": null, - "id": 448, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6291:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6280:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 450, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 453, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "6334:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 451, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "6326:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "6326:7: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": 454, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6326:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6280:76:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 456, - "nodeType": "ExpressionStatement", - "src": "6280:76:0" - } - ] - }, - "id": 458, - "nodeType": "IfStatement", - "src": "5976:395:0", - "trueBody": { - "id": 446, - "nodeType": "Block", - "src": "6025:231:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 439, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6194:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 441, - "indexExpression": { - "argumentTypes": null, - "id": 440, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6205:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6194:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 442, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6194:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 443, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6240:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6194:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 445, - "nodeType": "ExpressionStatement", - "src": "6194:47:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 480, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 350, - "modifierName": { - "argumentTypes": null, - "id": 349, - "name": "onlyTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1079, - "src": "5120:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5120:11:0" - }, - { - "arguments": null, - "id": 352, - "modifierName": { - "argumentTypes": null, - "id": 351, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "5132:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5132:10:0" - }, - { - "arguments": null, - "id": 354, - "modifierName": { - "argumentTypes": null, - "id": 353, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "5143:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5143:12:0" - } - ], - "name": "requestMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 348, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 347, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5101:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 346, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5101:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5100:12:0" - }, - "payable": false, - "returnParameters": { - "id": 355, - "nodeType": "ParameterList", - "parameters": [], - "src": "5156:0:0" - }, - "scope": 1080, - "src": "5068:1638:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 591, - "nodeType": "Block", - "src": "6811:940:0", - "statements": [ - { - "assignments": [ - 494 - ], - "declarations": [ - { - "constant": false, - "id": 494, - "name": "existingMilestoneNoVote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6821:28:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 493, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "6821:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 502, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 495, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6852:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 496, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "6865:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 497, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6865:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6852:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "6852:41:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 501, - "indexExpression": { - "argumentTypes": null, - "id": 500, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "6894:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6852:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6821:79:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 506, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 504, - "name": "existingMilestoneNoVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 494, - "src": "6918:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 505, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "6945:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "6918:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74652076616c7565206d75737420626520646966666572656e74207468616e206578697374696e6720766f7465207374617465", - "id": 507, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6951:55:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2334a2a330d03e0c71ca6e5459a04a9f7768e423b19b905937ae90377f088fd6", - "typeString": "literal_string \"Vote value must be different than existing vote state\"" - }, - "value": "Vote value must be different than existing vote state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2334a2a330d03e0c71ca6e5459a04a9f7768e423b19b905937ae90377f088fd6", - "typeString": "literal_string \"Vote value must be different than existing vote state\"" - } - ], - "id": 503, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "6910:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6910:97:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "6910:97:0" - }, - { - "assignments": [ - 511 - ], - "declarations": [ - { - "constant": false, - "id": 511, - "name": "milestoneVotingStarted", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7017:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 510, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7017:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 518, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 517, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 512, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7047:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 514, - "indexExpression": { - "argumentTypes": null, - "id": 513, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7058:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7047:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 515, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7047:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7093:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7047:47:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7017:77:0" - }, - { - "assignments": [ - 520 - ], - "declarations": [ - { - "constant": false, - "id": 520, - "name": "votePeriodHasEnded", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7104:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 519, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7104:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 527, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 521, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7130:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 523, - "indexExpression": { - "argumentTypes": null, - "id": 522, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7141:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7130:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 524, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7130:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 525, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "7177:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7130:50:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7104:76:0" - }, - { - "assignments": [ - 529 - ], - "declarations": [ - { - "constant": false, - "id": 529, - "name": "onGoingVote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7190:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 528, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7190:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 534, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 530, - "name": "milestoneVotingStarted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 511, - "src": "7209:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 532, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "7235:19:0", - "subExpression": { - "argumentTypes": null, - "id": 531, - "name": "votePeriodHasEnded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 520, - "src": "7236:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "7209:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7190:64:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 536, - "name": "onGoingVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 529, - "src": "7272:11:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520766f74696e67206d757374206265206f70656e", - "id": 537, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7285:31:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9e1dd9ca228a57f4224f45d51f0cb40784c6630bbd866a76b741c781eb59d306", - "typeString": "literal_string \"Milestone voting must be open\"" - }, - "value": "Milestone voting must be open" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9e1dd9ca228a57f4224f45d51f0cb40784c6630bbd866a76b741c781eb59d306", - "typeString": "literal_string \"Milestone voting must be open\"" - } - ], - "id": 535, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "7264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7264:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 539, - "nodeType": "ExpressionStatement", - "src": "7264:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 548, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 540, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7327:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 543, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 541, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7340:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7340:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7327:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 544, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "7327:41:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 546, - "indexExpression": { - "argumentTypes": null, - "id": 545, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7369:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "7327:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 547, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7378:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "7327:55:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 549, - "nodeType": "ExpressionStatement", - "src": "7327:55:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 551, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "7396:5:0", - "subExpression": { - "argumentTypes": null, - "id": 550, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7397:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 570, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 589, - "nodeType": "IfStatement", - "src": "7572:173:0", - "trueBody": { - "id": 588, - "nodeType": "Block", - "src": "7582:163:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 571, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7596:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 573, - "indexExpression": { - "argumentTypes": null, - "id": 572, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7607:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7596:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 574, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7596:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 580, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7690:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 583, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 581, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7703:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 582, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7703:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7690:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 584, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "7690:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 575, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7642:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 577, - "indexExpression": { - "argumentTypes": null, - "id": 576, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7653:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7642:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 578, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7642:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "7642:47: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": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7642:92:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7596:138:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 587, - "nodeType": "ExpressionStatement", - "src": "7596:138:0" - } - ] - } - }, - "id": 590, - "nodeType": "IfStatement", - "src": "7392:353:0", - "trueBody": { - "id": 569, - "nodeType": "Block", - "src": "7403:163:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 567, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 552, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7417:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 554, - "indexExpression": { - "argumentTypes": null, - "id": 553, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7428:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7417:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 555, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7417:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 561, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7511:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 564, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 562, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7524:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7524:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7511:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 565, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "7511:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 556, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7463:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 558, - "indexExpression": { - "argumentTypes": null, - "id": 557, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7474:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7463:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 559, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7463:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 560, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "7463:47: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": 566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7463:92:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7417:138:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 568, - "nodeType": "ExpressionStatement", - "src": "7417:138:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 592, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 487, - "modifierName": { - "argumentTypes": null, - "id": 486, - "name": "onlyContributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1069, - "src": "6771:15:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6771:15:0" - }, - { - "arguments": null, - "id": 489, - "modifierName": { - "argumentTypes": null, - "id": 488, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "6787:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6787:10:0" - }, - { - "arguments": null, - "id": 491, - "modifierName": { - "argumentTypes": null, - "id": 490, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "6798:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6798:12:0" - } - ], - "name": "voteMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 485, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 482, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6741:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 481, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6741:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 484, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6753:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 483, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "6753:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6740:23:0" - }, - "payable": false, - "returnParameters": { - "id": 492, - "nodeType": "ParameterList", - "parameters": [], - "src": "6811:0:0" - }, - "scope": 1080, - "src": "6712:1039:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 678, - "nodeType": "Block", - "src": "7828:890:0", - "statements": [ - { - "assignments": [ - 602 - ], - "declarations": [ - { - "constant": false, - "id": 602, - "name": "voteDeadlineHasPassed", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7838:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 601, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7838:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 609, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 603, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7867:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 605, - "indexExpression": { - "argumentTypes": null, - "id": 604, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "7878:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7867:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 606, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7867:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 607, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "7913:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7867:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7838:78:0" - }, - { - "assignments": [ - 611 - ], - "declarations": [ - { - "constant": false, - "id": 611, - "name": "majorityVotedNo", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7926:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 610, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7926:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 618, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 613, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7966:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 615, - "indexExpression": { - "argumentTypes": null, - "id": 614, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "7977:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7966:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 616, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7966:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 612, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "7949:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 617, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7949:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7926:84:0" - }, - { - "assignments": [ - 620 - ], - "declarations": [ - { - "constant": false, - "id": 620, - "name": "milestoneAlreadyPaid", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "8020:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 619, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8020:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 625, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 621, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8048:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 623, - "indexExpression": { - "argumentTypes": null, - "id": 622, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8059:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8048:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 624, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "8048:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8020:50:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 629, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 626, - "name": "voteDeadlineHasPassed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 602, - "src": "8084:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8109:16:0", - "subExpression": { - "argumentTypes": null, - "id": 627, - "name": "majorityVotedNo", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 611, - "src": "8110:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8084:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8129:21:0", - "subExpression": { - "argumentTypes": null, - "id": 630, - "name": "milestoneAlreadyPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 620, - "src": "8130:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8084:66:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 676, - "nodeType": "Block", - "src": "8639:73:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "726571756972656420636f6e646974696f6e732077657265206e6f7420736174697366696564", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8660:40:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c944a403407a4b450cdf033de02e1e093564ed6120fdd470c5daee653f2d6a87", - "typeString": "literal_string \"required conditions were not satisfied\"" - }, - "value": "required conditions were not satisfied" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_c944a403407a4b450cdf033de02e1e093564ed6120fdd470c5daee653f2d6a87", - "typeString": "literal_string \"required conditions were not satisfied\"" - } - ], - "id": 672, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1252, - 1253 - ], - "referencedDeclaration": 1253, - "src": "8653:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8653:48:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 675, - "nodeType": "ExpressionStatement", - "src": "8653:48:0" - } - ] - }, - "id": 677, - "nodeType": "IfStatement", - "src": "8080:632:0", - "trueBody": { - "id": 671, - "nodeType": "Block", - "src": "8152:481:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 633, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8166:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 635, - "indexExpression": { - "argumentTypes": null, - "id": 634, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8177:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8166:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 636, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "8166:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 637, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8191:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "8166:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 639, - "nodeType": "ExpressionStatement", - "src": "8166:29:0" - }, - { - "assignments": [ - 641 - ], - "declarations": [ - { - "constant": false, - "id": 641, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "8209:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 640, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8209:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 646, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 642, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8223:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 644, - "indexExpression": { - "argumentTypes": null, - "id": 643, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8234:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8223:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 645, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amount", - "nodeType": "MemberAccess", - "referencedDeclaration": 13, - "src": "8223:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8209:38:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "8282:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 647, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8261:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8261:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8261:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 652, - "nodeType": "ExpressionStatement", - "src": "8261:28:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 654, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8318:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 655, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "8331:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 653, - "name": "Withdrawn", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "8308:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 656, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8308:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 657, - "nodeType": "EmitStatement", - "src": "8303:35:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 661, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8430:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 658, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 659, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8408:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 660, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "8408:21: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": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8408:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 663, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8440:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8408:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 670, - "nodeType": "IfStatement", - "src": "8404:219:0", - "trueBody": { - "id": 669, - "nodeType": "Block", - "src": "8443:180:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 666, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8596:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 665, - "name": "selfdestruct", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1255, - "src": "8583:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8583:25:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 668, - "nodeType": "ExpressionStatement", - "src": "8583:25:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 679, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 597, - "modifierName": { - "argumentTypes": null, - "id": 596, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "7804:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7804:10:0" - }, - { - "arguments": null, - "id": 599, - "modifierName": { - "argumentTypes": null, - "id": 598, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "7815:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7815:12:0" - } - ], - "name": "payMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 595, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 594, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7785:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 593, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7785:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7784:12:0" - }, - "payable": false, - "returnParameters": { - "id": 600, - "nodeType": "ParameterList", - "parameters": [], - "src": "7828:0:0" - }, - "scope": 1080, - "src": "7757:961:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 742, - "nodeType": "Block", - "src": "8802:491:0", - "statements": [ - { - "assignments": [ - 691 - ], - "declarations": [ - { - "constant": false, - "id": 691, - "name": "refundVote", - "nodeType": "VariableDeclaration", - "scope": 743, - "src": "8812:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 690, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8812:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 697, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 692, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8830:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 695, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 693, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "8843:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8843:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8830:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 696, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refundVote", - "nodeType": "MemberAccess", - "referencedDeclaration": 27, - "src": "8830:35:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8812:53:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 701, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 699, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "8883:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 700, - "name": "refundVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 691, - "src": "8891:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8883:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4578697374696e6720766f7465207374617465206973206964656e746963616c20746f20766f74652076616c7565", - "id": 702, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8903:48:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_83d9b841f406ef52e32942228e28c13fcdb47e5fa9512f22f335b7955cb71cb5", - "typeString": "literal_string \"Existing vote state is identical to vote value\"" - }, - "value": "Existing vote state is identical to vote value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_83d9b841f406ef52e32942228e28c13fcdb47e5fa9512f22f335b7955cb71cb5", - "typeString": "literal_string \"Existing vote state is identical to vote value\"" - } - ], - "id": 698, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "8875:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8875:77:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 704, - "nodeType": "ExpressionStatement", - "src": "8875:77:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 711, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 705, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8962:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 708, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 706, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "8975:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8975:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8962:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 709, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "refundVote", - "nodeType": "MemberAccess", - "referencedDeclaration": 27, - "src": "8962:35:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 710, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9000:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8962:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 712, - "nodeType": "ExpressionStatement", - "src": "8962:42:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "9018:5:0", - "subExpression": { - "argumentTypes": null, - "id": 713, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9019:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 727, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9162:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 740, - "nodeType": "IfStatement", - "src": "9158:129:0", - "trueBody": { - "id": 739, - "nodeType": "Block", - "src": "9168:119:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 737, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 728, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9182:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 731, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "9232:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 734, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 732, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "9245:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 733, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9245:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9232:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 735, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "9232:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 729, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9206:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 730, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "9206:25: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": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9206:70:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9182:94:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 738, - "nodeType": "ExpressionStatement", - "src": "9182:94:0" - } - ] - } - }, - "id": 741, - "nodeType": "IfStatement", - "src": "9014:273:0", - "trueBody": { - "id": 726, - "nodeType": "Block", - "src": "9025:119:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 724, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 715, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9039:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 718, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "9089:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 721, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 719, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "9102:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9102:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9089:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 722, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "9089:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 716, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9063:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "9063:25: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": 723, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9063:70:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9039:94:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 725, - "nodeType": "ExpressionStatement", - "src": "9039:94:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 743, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 684, - "modifierName": { - "argumentTypes": null, - "id": 683, - "name": "onlyContributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1069, - "src": "8762:15:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8762:15:0" - }, - { - "arguments": null, - "id": 686, - "modifierName": { - "argumentTypes": null, - "id": 685, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "8778:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8778:10:0" - }, - { - "arguments": null, - "id": 688, - "modifierName": { - "argumentTypes": null, - "id": 687, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "8789:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8789:12:0" - } - ], - "name": "voteRefund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 743, - "src": "8744:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 680, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8744:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8743:11:0" - }, - "payable": false, - "returnParameters": { - "id": 689, - "nodeType": "ParameterList", - "parameters": [], - "src": "8802:0:0" - }, - "scope": 1080, - "src": "8724:569:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 806, - "nodeType": "Block", - "src": "9337:655:0", - "statements": [ - { - "assignments": [ - 749 - ], - "declarations": [ - { - "constant": false, - "id": 749, - "name": "callerIsTrustee", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9347:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 748, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9347:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 752, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 750, - "name": "isCallerTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 959, - "src": "9370:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9370:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9347:40:0" - }, - { - "assignments": [ - 754 - ], - "declarations": [ - { - "constant": false, - "id": 754, - "name": "crowdFundFailed", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9397:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 753, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9397:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 757, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 755, - "name": "isFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 972, - "src": "9420:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 756, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9420:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9397:33:0" - }, - { - "assignments": [ - 759 - ], - "declarations": [ - { - "constant": false, - "id": 759, - "name": "majorityVotingToRefund", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9440:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 758, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9440:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 763, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 761, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9487:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 760, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "9470:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 762, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9470:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9440:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 769, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 765, - "name": "callerIsTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 749, - "src": "9527:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 766, - "name": "crowdFundFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 754, - "src": "9546:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "9527:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 768, - "name": "majorityVotingToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 759, - "src": "9565:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "9527:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526571756972656420636f6e646974696f6e7320666f7220726566756e6420617265206e6f74206d6574", - "id": 770, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9589:44:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_1086fb0a245a80bddbec2bbf87c88d8fc142025bee989551e1ac5ccca15d31ff", - "typeString": "literal_string \"Required conditions for refund are not met\"" - }, - "value": "Required conditions for refund are not met" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_1086fb0a245a80bddbec2bbf87c88d8fc142025bee989551e1ac5ccca15d31ff", - "typeString": "literal_string \"Required conditions for refund are not met\"" - } - ], - "id": 764, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "9519:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 771, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9519:115:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 772, - "nodeType": "ExpressionStatement", - "src": "9519:115:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 773, - "name": "callerIsTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 749, - "src": "9648:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 780, - "name": "crowdFundFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 754, - "src": "9745:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 792, - "nodeType": "Block", - "src": "9838:78:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 790, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 787, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9852:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 788, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9867:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 789, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "MAJORITY_VOTING_TO_REFUND", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9867:38:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9852:53:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 791, - "nodeType": "ExpressionStatement", - "src": "9852:53:0" - } - ] - }, - "id": 793, - "nodeType": "IfStatement", - "src": "9741:175:0", - "trueBody": { - "id": 786, - "nodeType": "Block", - "src": "9762:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 784, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 781, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9776:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 782, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9791:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 783, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CROWD_FUND_FAILED", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9791:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9776:45:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 785, - "nodeType": "ExpressionStatement", - "src": "9776:45:0" - } - ] - } - }, - "id": 794, - "nodeType": "IfStatement", - "src": "9644:272:0", - "trueBody": { - "id": 779, - "nodeType": "Block", - "src": "9665:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 774, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9679:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 775, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9694:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CALLER_IS_TRUSTEE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9694:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9679:45:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 778, - "nodeType": "ExpressionStatement", - "src": "9679:45:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 797, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 795, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "9925:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 796, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9934:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9925:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 798, - "nodeType": "ExpressionStatement", - "src": "9925:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 799, - "name": "frozenBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 58, - "src": "9948:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 801, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1262, - "src": "9972:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - ], - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9964:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9964:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 803, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balance", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9964:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9948:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "9948:37:0" - } - ] - }, - "documentation": null, - "id": 807, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 746, - "modifierName": { - "argumentTypes": null, - "id": 745, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "9324:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9324:12:0" - } - ], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 744, - "nodeType": "ParameterList", - "parameters": [], - "src": "9314:2:0" - }, - "payable": false, - "returnParameters": { - "id": 747, - "nodeType": "ParameterList", - "parameters": [], - "src": "9337:0:0" - }, - "scope": 1080, - "src": "9299:693:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 870, - "nodeType": "Block", - "src": "10127:528:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 815, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "10145:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f742066726f7a656e", - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10153:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - }, - "value": "CrowdFund is not frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - } - ], - "id": 814, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "10137:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10137:42:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "10137:42:0" - }, - { - "assignments": [ - 820 - ], - "declarations": [ - { - "constant": false, - "id": 820, - "name": "isRefunded", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10189:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 819, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10189:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 825, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 821, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10207:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 823, - "indexExpression": { - "argumentTypes": null, - "id": 822, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10220:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10207:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 824, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10207:36:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10189:54:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 828, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10261:11:0", - "subExpression": { - "argumentTypes": null, - "id": 827, - "name": "isRefunded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 820, - "src": "10262:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "537065636966696564206164647265737320697320616c726561647920726566756e646564", - "id": 829, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10274:39:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ad918abf6ea38b3d8dd6fccfc0198c349db0339300085e3846f4b85c44350efa", - "typeString": "literal_string \"Specified address is already refunded\"" - }, - "value": "Specified address is already refunded" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ad918abf6ea38b3d8dd6fccfc0198c349db0339300085e3846f4b85c44350efa", - "typeString": "literal_string \"Specified address is already refunded\"" - } - ], - "id": 826, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "10253:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 830, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10253:61:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 831, - "nodeType": "ExpressionStatement", - "src": "10253:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 837, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 832, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10324:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 834, - "indexExpression": { - "argumentTypes": null, - "id": 833, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10337:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10324:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 835, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10324:36:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 836, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10363:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10324:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 838, - "nodeType": "ExpressionStatement", - "src": "10324:43:0" - }, - { - "assignments": [ - 840 - ], - "declarations": [ - { - "constant": false, - "id": 840, - "name": "contributionAmount", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10377:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 839, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10377:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 845, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 841, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10403:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 843, - "indexExpression": { - "argumentTypes": null, - "id": 842, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10416:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10403:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 844, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "10403:46:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10377:72:0" - }, - { - "assignments": [ - 847 - ], - "declarations": [ - { - "constant": false, - "id": 847, - "name": "amountToRefund", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10459:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 846, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10459:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 858, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 856, - "name": "frozenBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 58, - "src": "10531:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 851, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1262, - "src": "10512:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - ], - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10504:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10504:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balance", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10504:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 848, - "name": "contributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "10481:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 849, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "10481:22: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": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10481:45:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 855, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1187, - "src": "10481:49: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": 857, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10481:64:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10459:86:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 862, - "name": "amountToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 847, - "src": "10578:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 859, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10555:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 861, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10555:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 863, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10555:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 864, - "nodeType": "ExpressionStatement", - "src": "10555:38:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10618:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 867, - "name": "amountToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 847, - "src": "10633:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 865, - "name": "Withdrawn", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "10608:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 868, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10608:40:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 869, - "nodeType": "EmitStatement", - "src": "10603:45:0" - } - ] - }, - "documentation": null, - "id": 871, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 812, - "modifierName": { - "argumentTypes": null, - "id": 811, - "name": "onlyFrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1021, - "src": "10116:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10116:10:0" - } - ], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 810, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 809, - "name": "refundAddress", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10086:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 808, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10086:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10085:23:0" - }, - "payable": false, - "returnParameters": { - "id": 813, - "nodeType": "ParameterList", - "parameters": [], - "src": "10127:0:0" - }, - "scope": 1080, - "src": "10068:587:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 912, - "nodeType": "Block", - "src": "10801:322:0", - "statements": [ - { - "body": { - "id": 906, - "nodeType": "Block", - "src": "10861:221:0", - "statements": [ - { - "assignments": [ - 890 - ], - "declarations": [ - { - "constant": false, - "id": 890, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 913, - "src": "10875:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 889, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10875:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 894, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 891, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "10904:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 893, - "indexExpression": { - "argumentTypes": null, - "id": 892, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10920:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10904:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10875:47:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10940:42:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 895, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10941:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 897, - "indexExpression": { - "argumentTypes": null, - "id": 896, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 890, - "src": "10954:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10941:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 898, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10941:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 905, - "nodeType": "IfStatement", - "src": "10936:136:0", - "trueBody": { - "id": 904, - "nodeType": "Block", - "src": "10984:88:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f742079657420726566756e646564", - "id": 901, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11009:47:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_85d231c62370fa6b43ee7ffe2e2243eb8d4631e742e97de3a2558a277a825be1", - "typeString": "literal_string \"At least one contributor has not yet refunded\"" - }, - "value": "At least one contributor has not yet refunded" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_85d231c62370fa6b43ee7ffe2e2243eb8d4631e742e97de3a2558a277a825be1", - "typeString": "literal_string \"At least one contributor has not yet refunded\"" - } - ], - "id": 900, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1252, - 1253 - ], - "referencedDeclaration": 1253, - "src": "11002:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 902, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11002:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 903, - "nodeType": "ExpressionStatement", - "src": "11002:55:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 882, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10828:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 883, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "10832:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 884, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10832:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10828:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 907, - "initializationExpression": { - "assignments": [ - 879 - ], - "declarations": [ - { - "constant": false, - "id": 879, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 913, - "src": "10816:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 878, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10816:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 881, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 880, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10825:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "10816:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10856:3:0", - "subExpression": { - "argumentTypes": null, - "id": 886, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10856:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 888, - "nodeType": "ExpressionStatement", - "src": "10856:3:0" - }, - "nodeType": "ForStatement", - "src": "10811:271:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 909, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "11104:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 908, - "name": "selfdestruct", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1255, - "src": "11091:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 910, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11091:25:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 911, - "nodeType": "ExpressionStatement", - "src": "11091:25:0" - } - ] - }, - "documentation": null, - "id": 913, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 874, - "modifierName": { - "argumentTypes": null, - "id": 873, - "name": "onlyTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1079, - "src": "10778:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10778:11:0" - }, - { - "arguments": null, - "id": 876, - "modifierName": { - "argumentTypes": null, - "id": 875, - "name": "onlyFrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1021, - "src": "10790:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10790:10:0" - } - ], - "name": "destroy", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 872, - "nodeType": "ParameterList", - "parameters": [], - "src": "10768:2:0" - }, - "payable": false, - "returnParameters": { - "id": 877, - "nodeType": "ParameterList", - "parameters": [], - "src": "10801:0:0" - }, - "scope": 1080, - "src": "10752:371:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 927, - "nodeType": "Block", - "src": "11200:57:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "32", - "id": 922, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11233:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 920, - "name": "valueVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 915, - "src": "11217:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "11217:15: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": 923, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11217:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 924, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "11238:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11217:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 919, - "id": 926, - "nodeType": "Return", - "src": "11210:40:0" - } - ] - }, - "documentation": null, - "id": 928, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isMajorityVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 916, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 915, - "name": "valueVoting", - "nodeType": "VariableDeclaration", - "scope": 928, - "src": "11155:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 914, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11154:18:0" - }, - "payable": false, - "returnParameters": { - "id": 919, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 918, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 928, - "src": "11194:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 917, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11194:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11193:6:0" - }, - "scope": 1080, - "src": "11129:128:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 958, - "nodeType": "Block", - "src": "11317:180:0", - "statements": [ - { - "body": { - "id": 954, - "nodeType": "Block", - "src": "11370:99:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 944, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "11388:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 945, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11388:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 946, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "11402:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 948, - "indexExpression": { - "argumentTypes": null, - "id": 947, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11411:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11402:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "11388:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 953, - "nodeType": "IfStatement", - "src": "11384:75:0", - "trueBody": { - "id": 952, - "nodeType": "Block", - "src": "11415:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 950, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11440:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 932, - "id": 951, - "nodeType": "Return", - "src": "11433:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 940, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 937, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11344:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "11348:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 939, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11348:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11344:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 955, - "initializationExpression": { - "assignments": [ - 934 - ], - "declarations": [ - { - "constant": false, - "id": 934, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 959, - "src": "11332:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 933, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11332:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 936, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11341:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "11332:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 942, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11365:3:0", - "subExpression": { - "argumentTypes": null, - "id": 941, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11365:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 943, - "nodeType": "ExpressionStatement", - "src": "11365:3:0" - }, - "nodeType": "ForStatement", - "src": "11327:142:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 956, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11485:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 932, - "id": 957, - "nodeType": "Return", - "src": "11478:12:0" - } - ] - }, - "documentation": null, - "id": 959, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isCallerTrustee", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 929, - "nodeType": "ParameterList", - "parameters": [], - "src": "11287:2:0" - }, - "payable": false, - "returnParameters": { - "id": 932, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 931, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 959, - "src": "11311:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 930, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11311:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11310:6:0" - }, - "scope": 1080, - "src": "11263:234:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 971, - "nodeType": "Block", - "src": "11550:62:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 969, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 966, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 964, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "11567:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 965, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "11574:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11567:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 968, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "11586:19:0", - "subExpression": { - "argumentTypes": null, - "id": 967, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "11587:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "11567:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 963, - "id": 970, - "nodeType": "Return", - "src": "11560:45:0" - } - ] - }, - "documentation": null, - "id": 972, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isFailed", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 960, - "nodeType": "ParameterList", - "parameters": [], - "src": "11520:2:0" - }, - "payable": false, - "returnParameters": { - "id": 963, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 962, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 972, - "src": "11544:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 961, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11543:6:0" - }, - "scope": 1080, - "src": "11503:109:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 988, - "nodeType": "Block", - "src": "11731:90:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "11749:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 974, - "src": "11762:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11749:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "11749:49:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 986, - "indexExpression": { - "argumentTypes": null, - "id": 985, - "name": "milestoneIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 976, - "src": "11799:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11749:65:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 980, - "id": 987, - "nodeType": "Return", - "src": "11742:72:0" - } - ] - }, - "documentation": null, - "id": 989, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getContributorMilestoneVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 977, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 974, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11655:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 973, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11655:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 976, - "name": "milestoneIndex", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11683:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 975, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11683:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11654:49:0" - }, - "payable": false, - "returnParameters": { - "id": 980, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 979, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11725:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 978, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11725:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11724:6:0" - }, - "scope": 1080, - "src": "11618:203:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1001, - "nodeType": "Block", - "src": "11924:75:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 996, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "11941:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 998, - "indexExpression": { - "argumentTypes": null, - "id": 997, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 991, - "src": "11954:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11941:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 999, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "11941:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 995, - "id": 1000, - "nodeType": "Return", - "src": "11934:58:0" - } - ] - }, - "documentation": null, - "id": 1002, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getContributorContributionAmount", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 992, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 991, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 1002, - "src": "11869:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 990, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11869:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11868:28:0" - }, - "payable": false, - "returnParameters": { - "id": 995, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 994, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1002, - "src": "11918:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 993, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11918:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11917:6:0" - }, - "scope": 1080, - "src": "11827:172:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1011, - "nodeType": "Block", - "src": "12059:42:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1008, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "12081:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - ], - "id": 1007, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12076:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 1009, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12076:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 1006, - "id": 1010, - "nodeType": "Return", - "src": "12069:25:0" - } - ] - }, - "documentation": null, - "id": 1012, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getFreezeReason", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1003, - "nodeType": "ParameterList", - "parameters": [], - "src": "12029:2:0" - }, - "payable": false, - "returnParameters": { - "id": 1006, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1005, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "12053:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1004, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "12053:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "12052:6:0" - }, - "scope": 1080, - "src": "12005:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1020, - "nodeType": "Block", - "src": "12129:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1015, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "12147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f742066726f7a656e", - "id": 1016, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12155:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - }, - "value": "CrowdFund is not frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - } - ], - "id": 1014, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1017, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12139:42:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1018, - "nodeType": "ExpressionStatement", - "src": "12139:42:0" - }, - { - "id": 1019, - "nodeType": "PlaceholderStatement", - "src": "12191:1:0" - } - ] - }, - "documentation": null, - "id": 1021, - "name": "onlyFrozen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1013, - "nodeType": "ParameterList", - "parameters": [], - "src": "12126:2:0" - }, - "src": "12107:92:0", - "visibility": "internal" - }, - { - "body": { - "id": 1030, - "nodeType": "Block", - "src": "12229:67:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "12247:7:0", - "subExpression": { - "argumentTypes": null, - "id": 1024, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "12248:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e642069732066726f7a656e", - "id": 1026, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12256:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_21ebfed987d130de5e469bef5346c6c759f8769c3909e5f178aa85e98366503d", - "typeString": "literal_string \"CrowdFund is frozen\"" - }, - "value": "CrowdFund is frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_21ebfed987d130de5e469bef5346c6c759f8769c3909e5f178aa85e98366503d", - "typeString": "literal_string \"CrowdFund is frozen\"" - } - ], - "id": 1023, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12239:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1027, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12239:39:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1028, - "nodeType": "ExpressionStatement", - "src": "12239:39:0" - }, - { - "id": 1029, - "nodeType": "PlaceholderStatement", - "src": "12288:1:0" - } - ] - }, - "documentation": null, - "id": 1031, - "name": "onlyUnfrozen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1022, - "nodeType": "ParameterList", - "parameters": [], - "src": "12226:2:0" - }, - "src": "12205:91:0", - "visibility": "internal" - }, - { - "body": { - "id": 1039, - "nodeType": "Block", - "src": "12324:84:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1034, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "12342:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526169736520676f616c206973206e6f742072656163686564", - "id": 1035, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12362:27:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d65d4721f73624ca6e381e7ad4c000f40a20c0abe88c0be62360bb906d10ffbe", - "typeString": "literal_string \"Raise goal is not reached\"" - }, - "value": "Raise goal is not reached" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d65d4721f73624ca6e381e7ad4c000f40a20c0abe88c0be62360bb906d10ffbe", - "typeString": "literal_string \"Raise goal is not reached\"" - } - ], - "id": 1033, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12334:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1036, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12334:56:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1037, - "nodeType": "ExpressionStatement", - "src": "12334:56:0" - }, - { - "id": 1038, - "nodeType": "PlaceholderStatement", - "src": "12400:1:0" - } - ] - }, - "documentation": null, - "id": 1040, - "name": "onlyRaised", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1032, - "nodeType": "ParameterList", - "parameters": [], - "src": "12321:2:0" - }, - "src": "12302:106:0", - "visibility": "internal" - }, - { - "body": { - "id": 1053, - "nodeType": "Block", - "src": "12437:103:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1045, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1043, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "12455:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 1044, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "12462:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12455:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 1047, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "12474:19:0", - "subExpression": { - "argumentTypes": null, - "id": 1046, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "12475:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "12455:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f74206f6e676f696e67", - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12495:26:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_843cc2d7a1ba19041b40561b89d21c7571d29e5c5e2d0d1510f441aea3fc1747", - "typeString": "literal_string \"CrowdFund is not ongoing\"" - }, - "value": "CrowdFund is not ongoing" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_843cc2d7a1ba19041b40561b89d21c7571d29e5c5e2d0d1510f441aea3fc1747", - "typeString": "literal_string \"CrowdFund is not ongoing\"" - } - ], - "id": 1042, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12447:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1050, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12447:75:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1051, - "nodeType": "ExpressionStatement", - "src": "12447:75:0" - }, - { - "id": 1052, - "nodeType": "PlaceholderStatement", - "src": "12532:1:0" - } - ] - }, - "documentation": null, - "id": 1054, - "name": "onlyOnGoing", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1041, - "nodeType": "ParameterList", - "parameters": [], - "src": "12434:2:0" - }, - "src": "12414:126:0", - "visibility": "internal" - }, - { - "body": { - "id": 1068, - "nodeType": "Block", - "src": "12573:116:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1063, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1057, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "12591:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 1060, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1058, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "12604:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1059, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12604:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12591:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 1061, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "12591:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1062, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12638:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "12591:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616c6c6572206973206e6f74206120636f6e7472696275746f72", - "id": 1064, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12641:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_27c7012fc5b199883f3d6c1e7d0d3c9cd967752b2ed8ba1703713f2d84425e7b", - "typeString": "literal_string \"Caller is not a contributor\"" - }, - "value": "Caller is not a contributor" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_27c7012fc5b199883f3d6c1e7d0d3c9cd967752b2ed8ba1703713f2d84425e7b", - "typeString": "literal_string \"Caller is not a contributor\"" - } - ], - "id": 1056, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12583:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1065, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12583:88:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1066, - "nodeType": "ExpressionStatement", - "src": "12583:88:0" - }, - { - "id": 1067, - "nodeType": "PlaceholderStatement", - "src": "12681:1:0" - } - ] - }, - "documentation": null, - "id": 1069, - "name": "onlyContributor", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1055, - "nodeType": "ParameterList", - "parameters": [], - "src": "12570:2:0" - }, - "src": "12546:143:0", - "visibility": "internal" - }, - { - "body": { - "id": 1078, - "nodeType": "Block", - "src": "12718:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1072, - "name": "isCallerTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 959, - "src": "12736:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616c6c6572206973206e6f7420612074727573746565", - "id": 1074, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12755:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_efecdf3be8b72bfbf67a07f441dfdb20b968592ad6d7fba48a91dfa72a34f2d8", - "typeString": "literal_string \"Caller is not a trustee\"" - }, - "value": "Caller is not a trustee" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_efecdf3be8b72bfbf67a07f441dfdb20b968592ad6d7fba48a91dfa72a34f2d8", - "typeString": "literal_string \"Caller is not a trustee\"" - } - ], - "id": 1071, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12728:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1075, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12728:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1076, - "nodeType": "ExpressionStatement", - "src": "12728:53:0" - }, - { - "id": 1077, - "nodeType": "PlaceholderStatement", - "src": "12791:1:0" - } - ] - }, - "documentation": null, - "id": 1079, - "name": "onlyTrustee", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1070, - "nodeType": "ParameterList", - "parameters": [], - "src": "12715:2:0" - }, - "src": "12695:104:0", - "visibility": "internal" - } - ], - "scope": 1081, - "src": "87:12715:0" - } - ], - "src": "0:12802:0" - }, - "legacyAST": { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFund.sol", - "exportedSymbols": { - "CrowdFund": [ - 1080 - ] - }, - "id": 1081, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1, - "literals": [ - "solidity", - "^", - "0.4", - ".24" - ], - "nodeType": "PragmaDirective", - "src": "0:24:0" - }, - { - "absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "file": "openzeppelin-solidity/contracts/math/SafeMath.sol", - "id": 2, - "nodeType": "ImportDirective", - "scope": 1081, - "sourceUnit": 1233, - "src": "25:59:0", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1080, - "linearizedBaseContracts": [ - 1080 - ], - "name": "CrowdFund", - "nodeType": "ContractDefinition", - "nodes": [ - { - "id": 5, - "libraryName": { - "contractScope": null, - "id": 3, - "name": "SafeMath", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1232, - "src": "118:8:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_SafeMath_$1232", - "typeString": "library SafeMath" - } - }, - "nodeType": "UsingForDirective", - "src": "112:27:0", - "typeName": { - "id": 4, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "131:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - }, - { - "canonicalName": "CrowdFund.FreezeReason", - "id": 9, - "members": [ - { - "id": 6, - "name": "CALLER_IS_TRUSTEE", - "nodeType": "EnumValue", - "src": "173:17:0" - }, - { - "id": 7, - "name": "CROWD_FUND_FAILED", - "nodeType": "EnumValue", - "src": "200:17:0" - }, - { - "id": 8, - "name": "MAJORITY_VOTING_TO_REFUND", - "nodeType": "EnumValue", - "src": "227:25:0" - } - ], - "name": "FreezeReason", - "nodeType": "EnumDefinition", - "src": "145:113:0" - }, - { - "constant": false, - "id": 11, - "name": "freezeReason", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "264:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - }, - "typeName": { - "contractScope": null, - "id": 10, - "name": "FreezeReason", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 9, - "src": "264:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "value": null, - "visibility": "internal" - }, - { - "canonicalName": "CrowdFund.Milestone", - "id": 20, - "members": [ - { - "constant": false, - "id": 13, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "323:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 12, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "323:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 15, - "name": "amountVotingAgainstPayout", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "344:30:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 14, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "344:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 17, - "name": "payoutRequestVoteDeadline", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "384:30:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 16, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "384:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 19, - "name": "paid", - "nodeType": "VariableDeclaration", - "scope": 20, - "src": "424:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 18, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "424:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Milestone", - "nodeType": "StructDefinition", - "scope": 1080, - "src": "296:144:0", - "visibility": "public" - }, - { - "canonicalName": "CrowdFund.Contributor", - "id": 30, - "members": [ - { - "constant": false, - "id": 22, - "name": "contributionAmount", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "475:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 21, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "475:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 25, - "name": "milestoneNoVotes", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "565:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - }, - "typeName": { - "baseType": { - "id": 23, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "565:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 24, - "length": null, - "nodeType": "ArrayTypeName", - "src": "565:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 27, - "name": "refundVote", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "598:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 26, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "598:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 29, - "name": "refunded", - "nodeType": "VariableDeclaration", - "scope": 30, - "src": "623:13:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 28, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "623:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "name": "Contributor", - "nodeType": "StructDefinition", - "scope": 1080, - "src": "446:197:0", - "visibility": "public" - }, - { - "anonymous": false, - "documentation": null, - "id": 36, - "name": "Deposited", - "nodeType": "EventDefinition", - "parameters": { - "id": 35, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 32, - "indexed": true, - "name": "payee", - "nodeType": "VariableDeclaration", - "scope": 36, - "src": "665:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 31, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "665:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 34, - "indexed": false, - "name": "weiAmount", - "nodeType": "VariableDeclaration", - "scope": 36, - "src": "688:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 33, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "688:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "664:42:0" - }, - "src": "649:58:0" - }, - { - "anonymous": false, - "documentation": null, - "id": 42, - "name": "Withdrawn", - "nodeType": "EventDefinition", - "parameters": { - "id": 41, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 38, - "indexed": true, - "name": "payee", - "nodeType": "VariableDeclaration", - "scope": 42, - "src": "728:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 37, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "728:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 40, - "indexed": false, - "name": "weiAmount", - "nodeType": "VariableDeclaration", - "scope": 42, - "src": "751:17:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 39, - "name": "uint256", - "nodeType": "ElementaryTypeName", - "src": "751:7:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "727:42:0" - }, - "src": "712:58:0" - }, - { - "constant": false, - "id": 44, - "name": "frozen", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "776:18:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 43, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "776:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 46, - "name": "isRaiseGoalReached", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "800:30:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 45, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "800:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 48, - "name": "immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "836:41:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 47, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "836:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 50, - "name": "milestoneVotingPeriod", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "883:33:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 49, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "883:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 52, - "name": "deadline", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "922:20:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 51, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "922:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 54, - "name": "raiseGoal", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "948:21:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 53, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "948:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 56, - "name": "amountRaised", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "975:24:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 55, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "975:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 58, - "name": "frozenBalance", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1005:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 57, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1005:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 60, - "name": "minimumContributionAmount", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1036:37:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 59, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1036:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 62, - "name": "amountVotingForRefund", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1079:33:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 61, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1079:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 64, - "name": "beneficiary", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1118:26:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 63, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1118:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 68, - "name": "contributors", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1150:51:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor)" - }, - "typeName": { - "id": 67, - "keyType": { - "id": 65, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1158:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Mapping", - "src": "1150:31:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor)" - }, - "valueType": { - "contractScope": null, - "id": 66, - "name": "Contributor", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 30, - "src": "1169:11:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage_ptr", - "typeString": "struct CrowdFund.Contributor" - } - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 71, - "name": "contributorList", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1207:32:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 69, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1207:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 70, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1207:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 74, - "name": "trustees", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1302:25:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 72, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1302:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 73, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1302:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "constant": false, - "id": 77, - "name": "milestones", - "nodeType": "VariableDeclaration", - "scope": 1080, - "src": "1401:29:0", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone[]" - }, - "typeName": { - "baseType": { - "contractScope": null, - "id": 75, - "name": "Milestone", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 20, - "src": "1401:9:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage_ptr", - "typeString": "struct CrowdFund.Milestone" - } - }, - "id": 76, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1401:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage_ptr", - "typeString": "struct CrowdFund.Milestone[]" - } - }, - "value": null, - "visibility": "public" - }, - { - "body": { - "id": 230, - "nodeType": "Block", - "src": "1679:1689:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 99, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 97, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "1697:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 98, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1711:7:0", - "subdenomination": "ether", - "typeDescriptions": { - "typeIdentifier": "t_rational_1000000000000000000_by_1", - "typeString": "int_const 1000000000000000000" - }, - "value": "1" - }, - "src": "1697:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526169736520676f616c20697320736d616c6c6572207468616e2031206574686572", - "id": 100, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1720:36:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_26795146958ed9fbe8e87984c5fe089e4c2d8b62328649a7a4271f6acc61ad53", - "typeString": "literal_string \"Raise goal is smaller than 1 ether\"" - }, - "value": "Raise goal is smaller than 1 ether" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_26795146958ed9fbe8e87984c5fe089e4c2d8b62328649a7a4271f6acc61ad53", - "typeString": "literal_string \"Raise goal is smaller than 1 ether\"" - } - ], - "id": 96, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1689:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 101, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1689:68:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 102, - "nodeType": "ExpressionStatement", - "src": "1689:68:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 112, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 107, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 104, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "1775:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 105, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1775:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 106, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1795:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1775:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 111, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 108, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "1800:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "id": 109, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1800:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 110, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1820:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "1800:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1775:47:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "5472757374656520616464726573736573206d757374206265206174206c65617374203120616e64206e6f74206d6f7265207468616e203130", - "id": 113, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1824:59:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_6f2fb94a1426f6092f6f6ba2fe0c80c7b869c8844f1b5c7d223031cf3376dbf4", - "typeString": "literal_string \"Trustee addresses must be at least 1 and not more than 10\"" - }, - "value": "Trustee addresses must be at least 1 and not more than 10" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_6f2fb94a1426f6092f6f6ba2fe0c80c7b869c8844f1b5c7d223031cf3376dbf4", - "typeString": "literal_string \"Trustee addresses must be at least 1 and not more than 10\"" - } - ], - "id": 103, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1767:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 114, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1767:117:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 115, - "nodeType": "ExpressionStatement", - "src": "1767:117:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 125, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 120, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 117, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1902:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 118, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1902:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 119, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1924:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "1902:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 124, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 121, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "1929:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 122, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "1929:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "3130", - "id": 123, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1951:2:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_10_by_1", - "typeString": "int_const 10" - }, - "value": "10" - }, - "src": "1929:24:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "1902:51:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6573206d757374206265206174206c65617374203120616e64206e6f74206d6f7265207468616e203130", - "id": 126, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "1955:52:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_fa063e6a0c1c7b99eb5a849143b837901d68276acbf0f2c8247eed588a181ee2", - "typeString": "literal_string \"Milestones must be at least 1 and not more than 10\"" - }, - "value": "Milestones must be at least 1 and not more than 10" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_fa063e6a0c1c7b99eb5a849143b837901d68276acbf0f2c8247eed588a181ee2", - "typeString": "literal_string \"Milestones must be at least 1 and not more than 10\"" - } - ], - "id": 116, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "1894:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 127, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "1894:114:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 128, - "nodeType": "ExpressionStatement", - "src": "1894:114:0" - }, - { - "assignments": [ - 130 - ], - "declarations": [ - { - "constant": false, - "id": 130, - "name": "milestoneTotal", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2194:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 129, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2194:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 132, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 131, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2216:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2194:23:0" - }, - { - "body": { - "id": 175, - "nodeType": "Block", - "src": "2273:431:0", - "statements": [ - { - "assignments": [ - 145 - ], - "declarations": [ - { - "constant": false, - "id": 145, - "name": "milestoneAmount", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2287:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 144, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2287:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 149, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 146, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "2310:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 148, - "indexExpression": { - "argumentTypes": null, - "id": 147, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2322:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "2310:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "2287:37:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 153, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 151, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2346:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 152, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2364:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "2346:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520616d6f756e74206d7573742062652067726561746572207468616e2030", - "id": 154, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2367:41:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_8340f04f5ef6bd7e467fa70ba384c629e679986a39f0f5df8217fa4a3bb37fb3", - "typeString": "literal_string \"Milestone amount must be greater than 0\"" - }, - "value": "Milestone amount must be greater than 0" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_8340f04f5ef6bd7e467fa70ba384c629e679986a39f0f5df8217fa4a3bb37fb3", - "typeString": "literal_string \"Milestone amount must be greater than 0\"" - } - ], - "id": 150, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "2338:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 155, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2338:71:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 156, - "nodeType": "ExpressionStatement", - "src": "2338:71:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 162, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 157, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2423:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 160, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2459:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 158, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2440:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 159, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "2440: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": 161, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2440:35:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2423:52:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 163, - "nodeType": "ExpressionStatement", - "src": "2423:52:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 168, - "name": "milestoneAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 145, - "src": "2541:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 169, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2601:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "30", - "id": 170, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2647:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 171, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2672:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": null, - "id": 167, - "name": "Milestone", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 20, - "src": "2505:9:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Milestone_$20_storage_ptr_$", - "typeString": "type(struct CrowdFund.Milestone storage pointer)" - } - }, - "id": 172, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "amount", - "payoutRequestVoteDeadline", - "amountVotingAgainstPayout", - "paid" - ], - "nodeType": "FunctionCall", - "src": "2505:187:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_memory", - "typeString": "struct CrowdFund.Milestone memory" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_struct$_Milestone_$20_memory", - "typeString": "struct CrowdFund.Milestone memory" - } - ], - "expression": { - "argumentTypes": null, - "id": 164, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "2489:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 166, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2489:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_struct$_Milestone_$20_storage_$returns$_t_uint256_$", - "typeString": "function (struct CrowdFund.Milestone storage ref) returns (uint256)" - } - }, - "id": 173, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2489:204:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 174, - "nodeType": "ExpressionStatement", - "src": "2489:204:0" - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 140, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 137, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2244:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 138, - "name": "_milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 87, - "src": "2248:11:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - "id": 139, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "2248:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2244:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 176, - "initializationExpression": { - "assignments": [ - 134 - ], - "declarations": [ - { - "constant": false, - "id": 134, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "2232:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 133, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "2232:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 136, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 135, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2241:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "2232:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 142, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "2268:3:0", - "subExpression": { - "argumentTypes": null, - "id": 141, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 134, - "src": "2268:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 143, - "nodeType": "ExpressionStatement", - "src": "2268:3:0" - }, - "nodeType": "ForStatement", - "src": "2227:477:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 180, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 178, - "name": "milestoneTotal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 130, - "src": "2721:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 179, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "2739:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2721:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520746f74616c206d75737420657175616c20726169736520676f616c", - "id": 181, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2751:39:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_3ce6e124acdc65e75fdb7bed5df7531503580223492fe0e86777f092c6d736e4", - "typeString": "literal_string \"Milestone total must equal raise goal\"" - }, - "value": "Milestone total must equal raise goal" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_3ce6e124acdc65e75fdb7bed5df7531503580223492fe0e86777f092c6d736e4", - "typeString": "literal_string \"Milestone total must equal raise goal\"" - } - ], - "id": 177, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "2713:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 182, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "2713:78:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 183, - "nodeType": "ExpressionStatement", - "src": "2713:78:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 186, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 184, - "name": "minimumContributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "2878:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 185, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "2906:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "2878:29:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 187, - "nodeType": "ExpressionStatement", - "src": "2878:29:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 190, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 188, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "2917:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 189, - "name": "_raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 79, - "src": "2929:10:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "2917:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 191, - "nodeType": "ExpressionStatement", - "src": "2917:22:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 194, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 192, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "2949:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 193, - "name": "_beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 81, - "src": "2963:12:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "2949:26:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 195, - "nodeType": "ExpressionStatement", - "src": "2949:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 198, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 196, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "2985:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 197, - "name": "_trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 84, - "src": "2996:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - "src": "2985:20:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 199, - "nodeType": "ExpressionStatement", - "src": "2985:20:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 204, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 200, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "3015:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 203, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 201, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "3026:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "id": 202, - "name": "_deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 89, - "src": "3032:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3026:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3015:26:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 205, - "nodeType": "ExpressionStatement", - "src": "3015:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 208, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 206, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "3051:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 207, - "name": "_milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 91, - "src": "3075:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3051:46:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 209, - "nodeType": "ExpressionStatement", - "src": "3051:46:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 212, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 210, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "3107:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 211, - "name": "_immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 93, - "src": "3139:30:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "3107:62:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 213, - "nodeType": "ExpressionStatement", - "src": "3107:62:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 216, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 214, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "3179:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 215, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3200:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "3179:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 217, - "nodeType": "ExpressionStatement", - "src": "3179:26:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 220, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 218, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "3215:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 219, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3239:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3215:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 221, - "nodeType": "ExpressionStatement", - "src": "3215:25:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 224, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 222, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "3250:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 223, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3259:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "src": "3250:14:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 225, - "nodeType": "ExpressionStatement", - "src": "3250:14:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 228, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 226, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "3345:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "30", - "id": 227, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3360:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "3345:16:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 229, - "nodeType": "ExpressionStatement", - "src": "3345:16:0" - } - ] - }, - "documentation": null, - "id": 231, - "implemented": true, - "isConstructor": true, - "isDeclaredConst": false, - "modifiers": [], - "name": "", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 94, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 79, - "name": "_raiseGoal", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1458:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 78, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1458:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 81, - "name": "_beneficiary", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1483:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 80, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1483:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 84, - "name": "_trustees", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1513:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 82, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "1513:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 83, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1513:9:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 87, - "name": "_milestones", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1542:18:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 85, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1542:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 86, - "length": null, - "nodeType": "ArrayTypeName", - "src": "1542:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 89, - "name": "_deadline", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1570:14:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 88, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1570:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 91, - "name": "_milestoneVotingPeriod", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1594:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 90, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "1594:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 93, - "name": "_immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 231, - "src": "1631:35:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 92, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "1631:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "1448:219:0" - }, - "payable": false, - "returnParameters": { - "id": 95, - "nodeType": "ParameterList", - "parameters": [], - "src": "1679:0:0" - }, - "scope": 1080, - "src": "1437:1931:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 344, - "nodeType": "Block", - "src": "3436:1626:0", - "statements": [ - { - "assignments": [ - 239 - ], - "declarations": [ - { - "constant": false, - "id": 239, - "name": "newAmountRaised", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "3481:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 238, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "3481:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 245, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 242, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "3521:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 243, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "3521:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 240, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "3504:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 241, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "3504:16: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": 244, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3504:27:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "3481:50:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 249, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 247, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "3549:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 248, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "3568:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "3549:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "436f6e747269627574696f6e20657863656564732074686520726169736520676f616c2e", - "id": 250, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "3579:38:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_f0b2440b5298f52584e66c42ff46ffb5990bc57d408f53ff052d607205091f05", - "typeString": "literal_string \"Contribution exceeds the raise goal.\"" - }, - "value": "Contribution exceeds the raise goal." - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_f0b2440b5298f52584e66c42ff46ffb5990bc57d408f53ff052d607205091f05", - "typeString": "literal_string \"Contribution exceeds the raise goal.\"" - } - ], - "id": 246, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "3541:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 251, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "3541:77:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 252, - "nodeType": "ExpressionStatement", - "src": "3541:77:0" - }, - { - "assignments": [ - 254 - ], - "declarations": [ - { - "constant": false, - "id": 254, - "name": "greaterThanMinimum", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "4050:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 253, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4050:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 259, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 258, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 255, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4076:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 256, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4076:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 257, - "name": "minimumContributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 60, - "src": "4089:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4076:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4050:64:0" - }, - { - "assignments": [ - 261 - ], - "declarations": [ - { - "constant": false, - "id": 261, - "name": "exactlyRaiseGoal", - "nodeType": "VariableDeclaration", - "scope": 345, - "src": "4124:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 260, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4124:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 265, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 264, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 262, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "4148:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 263, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "4167:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4148:28:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "4124:52:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 269, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 267, - "name": "greaterThanMinimum", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 254, - "src": "4194:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 268, - "name": "exactlyRaiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 261, - "src": "4216:16:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "4194:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "6d73672e76616c75652067726561746572207468616e206d696e696d756d2c206f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7420746f20626520726169736564", - "id": 270, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4234:79:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_daec81a65fdf63ff22cc80539bfb1e860ba5e1c917be2dc57d9c7bffbe8d96a0", - "typeString": "literal_string \"msg.value greater than minimum, or msg.value == remaining amount to be raised\"" - }, - "value": "msg.value greater than minimum, or msg.value == remaining amount to be raised" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_daec81a65fdf63ff22cc80539bfb1e860ba5e1c917be2dc57d9c7bffbe8d96a0", - "typeString": "literal_string \"msg.value greater than minimum, or msg.value == remaining amount to be raised\"" - } - ], - "id": 266, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "4186:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 271, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4186:128:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 272, - "nodeType": "ExpressionStatement", - "src": "4186:128:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 279, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 273, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4380:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 276, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 274, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4393:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 275, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4393:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4380:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 277, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4380:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 278, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4427:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "4380:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 322, - "nodeType": "Block", - "src": "4749:129:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 320, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 306, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4763:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 309, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 307, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4776:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 308, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4776:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4763:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 310, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4763:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 317, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4857:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 318, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4857:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 311, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4809:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 314, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 312, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4822:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 313, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4822:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "4809:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 315, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "4809:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 316, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "4809:47: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": 319, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4809:58:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4763:104:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 321, - "nodeType": "ExpressionStatement", - "src": "4763:104:0" - } - ] - }, - "id": 323, - "nodeType": "IfStatement", - "src": "4376:502:0", - "trueBody": { - "id": 305, - "nodeType": "Block", - "src": "4430:305:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 296, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 280, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "4444:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 283, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 281, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4457:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 282, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4457:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "4444:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 285, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4521:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 286, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4521:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 290, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "4577:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 291, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4577:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 289, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "4566:10:0", - "typeDescriptions": { - "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_bool_$dyn_memory_$", - "typeString": "function (uint256) pure returns (bool[] memory)" - }, - "typeName": { - "baseType": { - "id": 287, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "4570:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 288, - "length": null, - "nodeType": "ArrayTypeName", - "src": "4570:6:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage_ptr", - "typeString": "bool[]" - } - } - }, - "id": 292, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4566:29:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_memory", - "typeString": "bool[] memory" - } - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 293, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4625:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 294, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4658:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - } - ], - "expression": { - "argumentTypes": null, - "id": 284, - "name": "Contributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 30, - "src": "4471:11:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_struct$_Contributor_$30_storage_ptr_$", - "typeString": "type(struct CrowdFund.Contributor storage pointer)" - } - }, - "id": 295, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "structConstructorCall", - "lValueRequested": false, - "names": [ - "contributionAmount", - "milestoneNoVotes", - "refundVote", - "refunded" - ], - "nodeType": "FunctionCall", - "src": "4471:207:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_memory", - "typeString": "struct CrowdFund.Contributor memory" - } - }, - "src": "4444:234:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 297, - "nodeType": "ExpressionStatement", - "src": "4444:234:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 301, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "4713:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 302, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4713:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 298, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "4692:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 300, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "4692:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 303, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "4692:32:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 304, - "nodeType": "ExpressionStatement", - "src": "4692:32:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 326, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 324, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "4888:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 325, - "name": "newAmountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 239, - "src": "4903:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4888:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 327, - "nodeType": "ExpressionStatement", - "src": "4888:30:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 330, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 328, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "4932:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "id": 329, - "name": "raiseGoal", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 54, - "src": "4948:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "4932:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 336, - "nodeType": "IfStatement", - "src": "4928:81:0", - "trueBody": { - "id": 335, - "nodeType": "Block", - "src": "4959:50:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 333, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 331, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "4973:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 332, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "4994:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "4973:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 334, - "nodeType": "ExpressionStatement", - "src": "4973:25:0" - } - ] - } - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 338, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "5033:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 339, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5033:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 340, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "5045:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 341, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "value", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5045:9:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 337, - "name": "Deposited", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 36, - "src": "5023:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 342, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5023:32:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 343, - "nodeType": "EmitStatement", - "src": "5018:37:0" - } - ] - }, - "documentation": null, - "id": 345, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 234, - "modifierName": { - "argumentTypes": null, - "id": 233, - "name": "onlyOnGoing", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1054, - "src": "3411:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3411:11:0" - }, - { - "arguments": null, - "id": 236, - "modifierName": { - "argumentTypes": null, - "id": 235, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "3423:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "3423:12:0" - } - ], - "name": "contribute", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 232, - "nodeType": "ParameterList", - "parameters": [], - "src": "3393:2:0" - }, - "payable": true, - "returnParameters": { - "id": 237, - "nodeType": "ParameterList", - "parameters": [], - "src": "3436:0:0" - }, - "scope": 1080, - "src": "3374:1688:0", - "stateMutability": "payable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 479, - "nodeType": "Block", - "src": "5156:1550:0", - "statements": [ - { - "assignments": [ - 357 - ], - "declarations": [ - { - "constant": false, - "id": 357, - "name": "milestoneAlreadyPaid", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5166:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 356, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5166:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 362, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 358, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5194:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 360, - "indexExpression": { - "argumentTypes": null, - "id": 359, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5205:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5194:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 361, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "5194:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5166:50:0" - }, - { - "assignments": [ - 364 - ], - "declarations": [ - { - "constant": false, - "id": 364, - "name": "voteDeadlineHasPassed", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5226:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 363, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5226:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 371, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 370, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 365, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5255:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 367, - "indexExpression": { - "argumentTypes": null, - "id": 366, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5266:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5255:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 368, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "5255:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 369, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "5301:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5255:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5226:78:0" - }, - { - "assignments": [ - 373 - ], - "declarations": [ - { - "constant": false, - "id": 373, - "name": "majorityAgainstPayout", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5314:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 372, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "5314:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 380, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 375, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5360:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 377, - "indexExpression": { - "argumentTypes": null, - "id": 376, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5371:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5360:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 378, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "5360:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 374, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "5343:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 379, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5343:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5314:90:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 383, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "5468:21:0", - "subExpression": { - "argumentTypes": null, - "id": 382, - "name": "milestoneAlreadyPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 357, - "src": "5469:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520616c72656164792070616964", - "id": 384, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5491:24:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_dd4d403a6ac484772597de76d12f4c453245b6a9170210c47567df5d5a4b5442", - "typeString": "literal_string \"Milestone already paid\"" - }, - "value": "Milestone already paid" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_dd4d403a6ac484772597de76d12f4c453245b6a9170210c47567df5d5a4b5442", - "typeString": "literal_string \"Milestone already paid\"" - } - ], - "id": 381, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "5460:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 385, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5460:56:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 386, - "nodeType": "ExpressionStatement", - "src": "5460:56:0" - }, - { - "assignments": [ - 388 - ], - "declarations": [ - { - "constant": false, - "id": 388, - "name": "lowestIndexPaid", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5527:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "typeName": { - "id": 387, - "name": "int", - "nodeType": "ElementaryTypeName", - "src": "5527:3:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 391, - "initialValue": { - "argumentTypes": null, - "id": 390, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "-", - "prefix": true, - "src": "5549:2:0", - "subExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 389, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5550:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "typeDescriptions": { - "typeIdentifier": "t_rational_-1_by_1", - "typeString": "int_const -1" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "5527:24:0" - }, - { - "body": { - "id": 415, - "nodeType": "Block", - "src": "5606:105:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 403, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5624:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 405, - "indexExpression": { - "argumentTypes": null, - "id": 404, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5635:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5624:13:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 406, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "5624:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 414, - "nodeType": "IfStatement", - "src": "5620:81:0", - "trueBody": { - "id": 413, - "nodeType": "Block", - "src": "5644:57:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 411, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 407, - "name": "lowestIndexPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 388, - "src": "5662:15:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 409, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5684:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 408, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5680:3:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_int256_$", - "typeString": "type(int256)" - }, - "typeName": "int" - }, - "id": 410, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5680:6:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "src": "5662:24:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "id": 412, - "nodeType": "ExpressionStatement", - "src": "5662:24:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 399, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 396, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5578:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 397, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5582:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 398, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "5582:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5578:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 416, - "initializationExpression": { - "assignments": [ - 393 - ], - "declarations": [ - { - "constant": false, - "id": 393, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5566:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 392, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5566:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 395, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 394, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5575:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "5566:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 401, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "5601:3:0", - "subExpression": { - "argumentTypes": null, - "id": 400, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 393, - "src": "5601:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 402, - "nodeType": "ExpressionStatement", - "src": "5601:3:0" - }, - "nodeType": "ForStatement", - "src": "5561:150:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 424, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 418, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5729:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_int256", - "typeString": "int256" - }, - "id": 422, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 420, - "name": "lowestIndexPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 388, - "src": "5743:15:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - }, - "nodeType": "BinaryOperation", - "operator": "+", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 421, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5761:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "5743:19:0", - "typeDescriptions": { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_int256", - "typeString": "int256" - } - ], - "id": 419, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "5738:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 423, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5738:25:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "5729:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e652072657175657374206d75737420626520666f7220666972737420756e70616964206d696c6573746f6e65", - "id": 425, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5765:54:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_109e56ab422d6e7b920445e49fcf1dac376eba8dda71ea922747d3a4bf8e6081", - "typeString": "literal_string \"Milestone request must be for first unpaid milestone\"" - }, - "value": "Milestone request must be for first unpaid milestone" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_109e56ab422d6e7b920445e49fcf1dac376eba8dda71ea922747d3a4bf8e6081", - "typeString": "literal_string \"Milestone request must be for first unpaid milestone\"" - } - ], - "id": 417, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "5721:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 426, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "5721:99:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 427, - "nodeType": "ExpressionStatement", - "src": "5721:99:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 433, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 428, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "5912:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 430, - "indexExpression": { - "argumentTypes": null, - "id": 429, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5923:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "5912:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 431, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "5912:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 432, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5959:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5912:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 462, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 460, - "name": "voteDeadlineHasPassed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 364, - "src": "6544:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 461, - "name": "majorityAgainstPayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 373, - "src": "6569:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "6544:46:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 477, - "nodeType": "IfStatement", - "src": "6540:160:0", - "trueBody": { - "id": 476, - "nodeType": "Block", - "src": "6592:108:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 474, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 463, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6606:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 465, - "indexExpression": { - "argumentTypes": null, - "id": 464, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6617:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6606:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 466, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6606:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "32", - "id": 471, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6686:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 469, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "6660:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 470, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "6660:25: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": 472, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6660:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 467, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "6652:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 468, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "6652:7: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": 473, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6652:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6606:83:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 475, - "nodeType": "ExpressionStatement", - "src": "6606:83:0" - } - ] - } - }, - "id": 478, - "nodeType": "IfStatement", - "src": "5908:792:0", - "trueBody": { - "id": 459, - "nodeType": "Block", - "src": "5962:419:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 438, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 436, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 434, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "5980:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 435, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "5989:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "5980:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 437, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 48, - "src": "5994:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "5980:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 457, - "nodeType": "Block", - "src": "6262:109:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 455, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 447, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6280:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 449, - "indexExpression": { - "argumentTypes": null, - "id": 448, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6291:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6280:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 450, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6280:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 453, - "name": "milestoneVotingPeriod", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 50, - "src": "6334:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 451, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "6326:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 452, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "6326:7: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": 454, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6326:30:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "6280:76:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 456, - "nodeType": "ExpressionStatement", - "src": "6280:76:0" - } - ] - }, - "id": 458, - "nodeType": "IfStatement", - "src": "5976:395:0", - "trueBody": { - "id": 446, - "nodeType": "Block", - "src": "6025:231:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 444, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 439, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "6194:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 441, - "indexExpression": { - "argumentTypes": null, - "id": 440, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 347, - "src": "6205:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6194:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 442, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "6194:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "31", - "id": 443, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6240:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "6194:47:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 445, - "nodeType": "ExpressionStatement", - "src": "6194:47:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 480, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 350, - "modifierName": { - "argumentTypes": null, - "id": 349, - "name": "onlyTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1079, - "src": "5120:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5120:11:0" - }, - { - "arguments": null, - "id": 352, - "modifierName": { - "argumentTypes": null, - "id": 351, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "5132:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5132:10:0" - }, - { - "arguments": null, - "id": 354, - "modifierName": { - "argumentTypes": null, - "id": 353, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "5143:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "5143:12:0" - } - ], - "name": "requestMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 348, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 347, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 480, - "src": "5101:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 346, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "5101:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "5100:12:0" - }, - "payable": false, - "returnParameters": { - "id": 355, - "nodeType": "ParameterList", - "parameters": [], - "src": "5156:0:0" - }, - "scope": 1080, - "src": "5068:1638:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 591, - "nodeType": "Block", - "src": "6811:940:0", - "statements": [ - { - "assignments": [ - 494 - ], - "declarations": [ - { - "constant": false, - "id": 494, - "name": "existingMilestoneNoVote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6821:28:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 493, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "6821:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 502, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 495, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "6852:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 498, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 496, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "6865:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 497, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "6865:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6852:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 499, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "6852:41:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 501, - "indexExpression": { - "argumentTypes": null, - "id": 500, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "6894:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "6852:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "6821:79:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 506, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 504, - "name": "existingMilestoneNoVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 494, - "src": "6918:23:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 505, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "6945:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "6918:31:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "566f74652076616c7565206d75737420626520646966666572656e74207468616e206578697374696e6720766f7465207374617465", - "id": 507, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "6951:55:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_2334a2a330d03e0c71ca6e5459a04a9f7768e423b19b905937ae90377f088fd6", - "typeString": "literal_string \"Vote value must be different than existing vote state\"" - }, - "value": "Vote value must be different than existing vote state" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_2334a2a330d03e0c71ca6e5459a04a9f7768e423b19b905937ae90377f088fd6", - "typeString": "literal_string \"Vote value must be different than existing vote state\"" - } - ], - "id": 503, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "6910:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 508, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "6910:97:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 509, - "nodeType": "ExpressionStatement", - "src": "6910:97:0" - }, - { - "assignments": [ - 511 - ], - "declarations": [ - { - "constant": false, - "id": 511, - "name": "milestoneVotingStarted", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7017:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 510, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7017:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 518, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 517, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 512, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7047:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 514, - "indexExpression": { - "argumentTypes": null, - "id": 513, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7058:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7047:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 515, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7047:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 516, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7093:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "7047:47:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7017:77:0" - }, - { - "assignments": [ - 520 - ], - "declarations": [ - { - "constant": false, - "id": 520, - "name": "votePeriodHasEnded", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7104:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 519, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7104:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 527, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 526, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 521, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7130:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 523, - "indexExpression": { - "argumentTypes": null, - "id": 522, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7141:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7130:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 524, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7130:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 525, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "7177:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7130:50:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7104:76:0" - }, - { - "assignments": [ - 529 - ], - "declarations": [ - { - "constant": false, - "id": 529, - "name": "onGoingVote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "7190:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 528, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7190:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 534, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 533, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 530, - "name": "milestoneVotingStarted", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 511, - "src": "7209:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 532, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "7235:19:0", - "subExpression": { - "argumentTypes": null, - "id": 531, - "name": "votePeriodHasEnded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 520, - "src": "7236:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "7209:45:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7190:64:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 536, - "name": "onGoingVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 529, - "src": "7272:11:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4d696c6573746f6e6520766f74696e67206d757374206265206f70656e", - "id": 537, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "7285:31:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_9e1dd9ca228a57f4224f45d51f0cb40784c6630bbd866a76b741c781eb59d306", - "typeString": "literal_string \"Milestone voting must be open\"" - }, - "value": "Milestone voting must be open" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_9e1dd9ca228a57f4224f45d51f0cb40784c6630bbd866a76b741c781eb59d306", - "typeString": "literal_string \"Milestone voting must be open\"" - } - ], - "id": 535, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "7264:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 538, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7264:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 539, - "nodeType": "ExpressionStatement", - "src": "7264:53:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 548, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 540, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7327:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 543, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 541, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7340:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 542, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7340:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7327:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 544, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "7327:41:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 546, - "indexExpression": { - "argumentTypes": null, - "id": 545, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7369:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "nodeType": "IndexAccess", - "src": "7327:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 547, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7378:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "7327:55:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 549, - "nodeType": "ExpressionStatement", - "src": "7327:55:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 551, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "7396:5:0", - "subExpression": { - "argumentTypes": null, - "id": 550, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7397:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 570, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 484, - "src": "7576:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 589, - "nodeType": "IfStatement", - "src": "7572:173:0", - "trueBody": { - "id": 588, - "nodeType": "Block", - "src": "7582:163:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 586, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 571, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7596:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 573, - "indexExpression": { - "argumentTypes": null, - "id": 572, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7607:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7596:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 574, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7596:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 580, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7690:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 583, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 581, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7703:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 582, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7703:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7690:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 584, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "7690:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 575, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7642:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 577, - "indexExpression": { - "argumentTypes": null, - "id": 576, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7653:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7642:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 578, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7642:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 579, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "7642:47: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": 585, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7642:92:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7596:138:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 587, - "nodeType": "ExpressionStatement", - "src": "7596:138:0" - } - ] - } - }, - "id": 590, - "nodeType": "IfStatement", - "src": "7392:353:0", - "trueBody": { - "id": 569, - "nodeType": "Block", - "src": "7403:163:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 567, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 552, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7417:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 554, - "indexExpression": { - "argumentTypes": null, - "id": 553, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7428:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7417:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 555, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7417:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 561, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "7511:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 564, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 562, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "7524:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 563, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "7524:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7511:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 565, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "7511:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 556, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7463:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 558, - "indexExpression": { - "argumentTypes": null, - "id": 557, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 482, - "src": "7474:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7463:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 559, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7463:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 560, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "7463:47: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": 566, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7463:92:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7417:138:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 568, - "nodeType": "ExpressionStatement", - "src": "7417:138:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 592, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 487, - "modifierName": { - "argumentTypes": null, - "id": 486, - "name": "onlyContributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1069, - "src": "6771:15:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6771:15:0" - }, - { - "arguments": null, - "id": 489, - "modifierName": { - "argumentTypes": null, - "id": 488, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "6787:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6787:10:0" - }, - { - "arguments": null, - "id": 491, - "modifierName": { - "argumentTypes": null, - "id": 490, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "6798:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "6798:12:0" - } - ], - "name": "voteMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 485, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 482, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6741:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 481, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "6741:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 484, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 592, - "src": "6753:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 483, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "6753:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "6740:23:0" - }, - "payable": false, - "returnParameters": { - "id": 492, - "nodeType": "ParameterList", - "parameters": [], - "src": "6811:0:0" - }, - "scope": 1080, - "src": "6712:1039:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 678, - "nodeType": "Block", - "src": "7828:890:0", - "statements": [ - { - "assignments": [ - 602 - ], - "declarations": [ - { - "constant": false, - "id": 602, - "name": "voteDeadlineHasPassed", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7838:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 601, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7838:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 609, - "initialValue": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 608, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 603, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7867:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 605, - "indexExpression": { - "argumentTypes": null, - "id": 604, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "7878:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7867:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 606, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "payoutRequestVoteDeadline", - "nodeType": "MemberAccess", - "referencedDeclaration": 17, - "src": "7867:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "id": 607, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "7913:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "7867:49:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7838:78:0" - }, - { - "assignments": [ - 611 - ], - "declarations": [ - { - "constant": false, - "id": 611, - "name": "majorityVotedNo", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7926:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 610, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "7926:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 618, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 613, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "7966:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 615, - "indexExpression": { - "argumentTypes": null, - "id": 614, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "7977:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "7966:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 616, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amountVotingAgainstPayout", - "nodeType": "MemberAccess", - "referencedDeclaration": 15, - "src": "7966:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 612, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "7949:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 617, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "7949:61:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "7926:84:0" - }, - { - "assignments": [ - 620 - ], - "declarations": [ - { - "constant": false, - "id": 620, - "name": "milestoneAlreadyPaid", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "8020:25:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 619, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8020:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 625, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 621, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8048:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 623, - "indexExpression": { - "argumentTypes": null, - "id": 622, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8059:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8048:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 624, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "8048:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8020:50:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 632, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 629, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 626, - "name": "voteDeadlineHasPassed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 602, - "src": "8084:21:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 628, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8109:16:0", - "subExpression": { - "argumentTypes": null, - "id": 627, - "name": "majorityVotedNo", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 611, - "src": "8110:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8084:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 631, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "8129:21:0", - "subExpression": { - "argumentTypes": null, - "id": 630, - "name": "milestoneAlreadyPaid", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 620, - "src": "8130:20:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8084:66:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 676, - "nodeType": "Block", - "src": "8639:73:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "726571756972656420636f6e646974696f6e732077657265206e6f7420736174697366696564", - "id": 673, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8660:40:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_c944a403407a4b450cdf033de02e1e093564ed6120fdd470c5daee653f2d6a87", - "typeString": "literal_string \"required conditions were not satisfied\"" - }, - "value": "required conditions were not satisfied" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_c944a403407a4b450cdf033de02e1e093564ed6120fdd470c5daee653f2d6a87", - "typeString": "literal_string \"required conditions were not satisfied\"" - } - ], - "id": 672, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1252, - 1253 - ], - "referencedDeclaration": 1253, - "src": "8653:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 674, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8653:48:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 675, - "nodeType": "ExpressionStatement", - "src": "8653:48:0" - } - ] - }, - "id": 677, - "nodeType": "IfStatement", - "src": "8080:632:0", - "trueBody": { - "id": 671, - "nodeType": "Block", - "src": "8152:481:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 638, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 633, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8166:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 635, - "indexExpression": { - "argumentTypes": null, - "id": 634, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8177:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8166:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 636, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "paid", - "nodeType": "MemberAccess", - "referencedDeclaration": 19, - "src": "8166:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 637, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8191:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "8166:29:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 639, - "nodeType": "ExpressionStatement", - "src": "8166:29:0" - }, - { - "assignments": [ - 641 - ], - "declarations": [ - { - "constant": false, - "id": 641, - "name": "amount", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "8209:11:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 640, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "8209:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 646, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 642, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8223:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 644, - "indexExpression": { - "argumentTypes": null, - "id": 643, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8234:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8223:17:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Milestone_$20_storage", - "typeString": "struct CrowdFund.Milestone storage ref" - } - }, - "id": 645, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "amount", - "nodeType": "MemberAccess", - "referencedDeclaration": 13, - "src": "8223:24:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8209:38:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 650, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "8282:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 647, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8261:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 649, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8261:20:0", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 651, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8261:28:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 652, - "nodeType": "ExpressionStatement", - "src": "8261:28:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 654, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8318:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 655, - "name": "amount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 641, - "src": "8331:6:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 653, - "name": "Withdrawn", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "8308:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 656, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8308:30:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 657, - "nodeType": "EmitStatement", - "src": "8303:35:0" - }, - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 664, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 661, - "name": "index", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 594, - "src": "8430:5:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 658, - "name": "milestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 77, - "src": "8408:10:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_struct$_Milestone_$20_storage_$dyn_storage", - "typeString": "struct CrowdFund.Milestone storage ref[] storage ref" - } - }, - "id": 659, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8408:17:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 660, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "8408:21: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": 662, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8408:28:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "hexValue": "31", - "id": 663, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8440:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_1_by_1", - "typeString": "int_const 1" - }, - "value": "1" - }, - "src": "8408:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 670, - "nodeType": "IfStatement", - "src": "8404:219:0", - "trueBody": { - "id": 669, - "nodeType": "Block", - "src": "8443:180:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 666, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "8596:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 665, - "name": "selfdestruct", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1255, - "src": "8583:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 667, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8583:25:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 668, - "nodeType": "ExpressionStatement", - "src": "8583:25:0" - } - ] - } - } - ] - } - } - ] - }, - "documentation": null, - "id": 679, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 597, - "modifierName": { - "argumentTypes": null, - "id": 596, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "7804:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7804:10:0" - }, - { - "arguments": null, - "id": 599, - "modifierName": { - "argumentTypes": null, - "id": 598, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "7815:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "7815:12:0" - } - ], - "name": "payMilestonePayout", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 595, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 594, - "name": "index", - "nodeType": "VariableDeclaration", - "scope": 679, - "src": "7785:10:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 593, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "7785:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "7784:12:0" - }, - "payable": false, - "returnParameters": { - "id": 600, - "nodeType": "ParameterList", - "parameters": [], - "src": "7828:0:0" - }, - "scope": 1080, - "src": "7757:961:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 742, - "nodeType": "Block", - "src": "8802:491:0", - "statements": [ - { - "assignments": [ - 691 - ], - "declarations": [ - { - "constant": false, - "id": 691, - "name": "refundVote", - "nodeType": "VariableDeclaration", - "scope": 743, - "src": "8812:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 690, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8812:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 697, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 692, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8830:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 695, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 693, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "8843:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 694, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8843:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8830:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 696, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refundVote", - "nodeType": "MemberAccess", - "referencedDeclaration": 27, - "src": "8830:35:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "8812:53:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 701, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 699, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "8883:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "id": 700, - "name": "refundVote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 691, - "src": "8891:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8883:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "4578697374696e6720766f7465207374617465206973206964656e746963616c20746f20766f74652076616c7565", - "id": 702, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "8903:48:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_83d9b841f406ef52e32942228e28c13fcdb47e5fa9512f22f335b7955cb71cb5", - "typeString": "literal_string \"Existing vote state is identical to vote value\"" - }, - "value": "Existing vote state is identical to vote value" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_83d9b841f406ef52e32942228e28c13fcdb47e5fa9512f22f335b7955cb71cb5", - "typeString": "literal_string \"Existing vote state is identical to vote value\"" - } - ], - "id": 698, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "8875:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 703, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "8875:77:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 704, - "nodeType": "ExpressionStatement", - "src": "8875:77:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 711, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 705, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "8962:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 708, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 706, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "8975:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 707, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "8975:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "8962:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 709, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "refundVote", - "nodeType": "MemberAccess", - "referencedDeclaration": 27, - "src": "8962:35:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "id": 710, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9000:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "8962:42:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 712, - "nodeType": "ExpressionStatement", - "src": "8962:42:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 714, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "9018:5:0", - "subExpression": { - "argumentTypes": null, - "id": 713, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9019:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 727, - "name": "vote", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 681, - "src": "9162:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 740, - "nodeType": "IfStatement", - "src": "9158:129:0", - "trueBody": { - "id": 739, - "nodeType": "Block", - "src": "9168:119:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 737, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 728, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9182:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 731, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "9232:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 734, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 732, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "9245:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 733, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9245:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9232:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 735, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "9232:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 729, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9206:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 730, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "add", - "nodeType": "MemberAccess", - "referencedDeclaration": 1231, - "src": "9206:25: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": 736, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9206:70:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9182:94:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 738, - "nodeType": "ExpressionStatement", - "src": "9182:94:0" - } - ] - } - }, - "id": 741, - "nodeType": "IfStatement", - "src": "9014:273:0", - "trueBody": { - "id": 726, - "nodeType": "Block", - "src": "9025:119:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 724, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 715, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9039:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 718, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "9089:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 721, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 719, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "9102:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 720, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9102:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "9089:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 722, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "9089:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 716, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9063:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 717, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sub", - "nodeType": "MemberAccess", - "referencedDeclaration": 1207, - "src": "9063:25: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": 723, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9063:70:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9039:94:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 725, - "nodeType": "ExpressionStatement", - "src": "9039:94:0" - } - ] - } - } - ] - }, - "documentation": null, - "id": 743, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 684, - "modifierName": { - "argumentTypes": null, - "id": 683, - "name": "onlyContributor", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1069, - "src": "8762:15:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8762:15:0" - }, - { - "arguments": null, - "id": 686, - "modifierName": { - "argumentTypes": null, - "id": 685, - "name": "onlyRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1040, - "src": "8778:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8778:10:0" - }, - { - "arguments": null, - "id": 688, - "modifierName": { - "argumentTypes": null, - "id": 687, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "8789:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "8789:12:0" - } - ], - "name": "voteRefund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 682, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 681, - "name": "vote", - "nodeType": "VariableDeclaration", - "scope": 743, - "src": "8744:9:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 680, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "8744:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "8743:11:0" - }, - "payable": false, - "returnParameters": { - "id": 689, - "nodeType": "ParameterList", - "parameters": [], - "src": "8802:0:0" - }, - "scope": 1080, - "src": "8724:569:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 806, - "nodeType": "Block", - "src": "9337:655:0", - "statements": [ - { - "assignments": [ - 749 - ], - "declarations": [ - { - "constant": false, - "id": 749, - "name": "callerIsTrustee", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9347:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 748, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9347:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 752, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 750, - "name": "isCallerTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 959, - "src": "9370:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 751, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9370:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9347:40:0" - }, - { - "assignments": [ - 754 - ], - "declarations": [ - { - "constant": false, - "id": 754, - "name": "crowdFundFailed", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9397:20:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 753, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9397:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 757, - "initialValue": { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 755, - "name": "isFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 972, - "src": "9420:8:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 756, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9420:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9397:33:0" - }, - { - "assignments": [ - 759 - ], - "declarations": [ - { - "constant": false, - "id": 759, - "name": "majorityVotingToRefund", - "nodeType": "VariableDeclaration", - "scope": 807, - "src": "9440:27:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 758, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "9440:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 763, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 761, - "name": "amountVotingForRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 62, - "src": "9487:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 760, - "name": "isMajorityVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 928, - "src": "9470:16:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$_t_uint256_$returns$_t_bool_$", - "typeString": "function (uint256) view returns (bool)" - } - }, - "id": 762, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9470:39:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "9440:69:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 769, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 767, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 765, - "name": "callerIsTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 749, - "src": "9527:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 766, - "name": "crowdFundFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 754, - "src": "9546:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "9527:34:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "||", - "rightExpression": { - "argumentTypes": null, - "id": 768, - "name": "majorityVotingToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 759, - "src": "9565:22:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "9527:60:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526571756972656420636f6e646974696f6e7320666f7220726566756e6420617265206e6f74206d6574", - "id": 770, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9589:44:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_1086fb0a245a80bddbec2bbf87c88d8fc142025bee989551e1ac5ccca15d31ff", - "typeString": "literal_string \"Required conditions for refund are not met\"" - }, - "value": "Required conditions for refund are not met" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_1086fb0a245a80bddbec2bbf87c88d8fc142025bee989551e1ac5ccca15d31ff", - "typeString": "literal_string \"Required conditions for refund are not met\"" - } - ], - "id": 764, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "9519:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 771, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9519:115:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 772, - "nodeType": "ExpressionStatement", - "src": "9519:115:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 773, - "name": "callerIsTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 749, - "src": "9648:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "condition": { - "argumentTypes": null, - "id": 780, - "name": "crowdFundFailed", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 754, - "src": "9745:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": { - "id": 792, - "nodeType": "Block", - "src": "9838:78:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 790, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 787, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9852:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 788, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9867:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 789, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "MAJORITY_VOTING_TO_REFUND", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9867:38:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9852:53:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 791, - "nodeType": "ExpressionStatement", - "src": "9852:53:0" - } - ] - }, - "id": 793, - "nodeType": "IfStatement", - "src": "9741:175:0", - "trueBody": { - "id": 786, - "nodeType": "Block", - "src": "9762:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 784, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 781, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9776:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 782, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9791:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 783, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CROWD_FUND_FAILED", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9791:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9776:45:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 785, - "nodeType": "ExpressionStatement", - "src": "9776:45:0" - } - ] - } - }, - "id": 794, - "nodeType": "IfStatement", - "src": "9644:272:0", - "trueBody": { - "id": 779, - "nodeType": "Block", - "src": "9665:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "id": 777, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 774, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "9679:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 775, - "name": "FreezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 9, - "src": "9694:12:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_enum$_FreezeReason_$9_$", - "typeString": "type(enum CrowdFund.FreezeReason)" - } - }, - "id": 776, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "memberName": "CALLER_IS_TRUSTEE", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9694:30:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "src": "9679:45:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - }, - "id": 778, - "nodeType": "ExpressionStatement", - "src": "9679:45:0" - } - ] - } - }, - { - "expression": { - "argumentTypes": null, - "id": 797, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 795, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "9925:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 796, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "9934:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "9925:13:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 798, - "nodeType": "ExpressionStatement", - "src": "9925:13:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 804, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "id": 799, - "name": "frozenBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 58, - "src": "9948:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 801, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1262, - "src": "9972:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - ], - "id": 800, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "9964:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 802, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "9964:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 803, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balance", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "9964:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "9948:37:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 805, - "nodeType": "ExpressionStatement", - "src": "9948:37:0" - } - ] - }, - "documentation": null, - "id": 807, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 746, - "modifierName": { - "argumentTypes": null, - "id": 745, - "name": "onlyUnfrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1031, - "src": "9324:12:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "9324:12:0" - } - ], - "name": "refund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 744, - "nodeType": "ParameterList", - "parameters": [], - "src": "9314:2:0" - }, - "payable": false, - "returnParameters": { - "id": 747, - "nodeType": "ParameterList", - "parameters": [], - "src": "9337:0:0" - }, - "scope": 1080, - "src": "9299:693:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 870, - "nodeType": "Block", - "src": "10127:528:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 815, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "10145:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f742066726f7a656e", - "id": 816, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10153:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - }, - "value": "CrowdFund is not frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - } - ], - "id": 814, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "10137:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 817, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10137:42:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 818, - "nodeType": "ExpressionStatement", - "src": "10137:42:0" - }, - { - "assignments": [ - 820 - ], - "declarations": [ - { - "constant": false, - "id": 820, - "name": "isRefunded", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10189:15:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 819, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "10189:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 825, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 821, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10207:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 823, - "indexExpression": { - "argumentTypes": null, - "id": 822, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10220:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10207:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 824, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10207:36:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10189:54:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 828, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10261:11:0", - "subExpression": { - "argumentTypes": null, - "id": 827, - "name": "isRefunded", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 820, - "src": "10262:10:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "537065636966696564206164647265737320697320616c726561647920726566756e646564", - "id": 829, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10274:39:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_ad918abf6ea38b3d8dd6fccfc0198c349db0339300085e3846f4b85c44350efa", - "typeString": "literal_string \"Specified address is already refunded\"" - }, - "value": "Specified address is already refunded" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_ad918abf6ea38b3d8dd6fccfc0198c349db0339300085e3846f4b85c44350efa", - "typeString": "literal_string \"Specified address is already refunded\"" - } - ], - "id": 826, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "10253:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 830, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10253:61:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 831, - "nodeType": "ExpressionStatement", - "src": "10253:61:0" - }, - { - "expression": { - "argumentTypes": null, - "id": 837, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftHandSide": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 832, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10324:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 834, - "indexExpression": { - "argumentTypes": null, - "id": 833, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10337:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10324:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 835, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": true, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10324:36:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "Assignment", - "operator": "=", - "rightHandSide": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 836, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10363:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "src": "10324:43:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 838, - "nodeType": "ExpressionStatement", - "src": "10324:43:0" - }, - { - "assignments": [ - 840 - ], - "declarations": [ - { - "constant": false, - "id": 840, - "name": "contributionAmount", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10377:23:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 839, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10377:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 845, - "initialValue": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 841, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10403:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 843, - "indexExpression": { - "argumentTypes": null, - "id": 842, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10416:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10403:27:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 844, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "10403:46:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10377:72:0" - }, - { - "assignments": [ - 847 - ], - "declarations": [ - { - "constant": false, - "id": 847, - "name": "amountToRefund", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10459:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 846, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10459:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 858, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 856, - "name": "frozenBalance", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 58, - "src": "10531:13:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 851, - "name": "this", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1262, - "src": "10512:4:0", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - ], - "id": 850, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "10504:7:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_address_$", - "typeString": "type(address)" - }, - "typeName": "address" - }, - "id": 852, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10504:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 853, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "balance", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10504:21:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 848, - "name": "contributionAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 840, - "src": "10481:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 849, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "10481:22: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": 854, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10481:45:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 855, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "div", - "nodeType": "MemberAccess", - "referencedDeclaration": 1187, - "src": "10481:49: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": 857, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10481:64:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10459:86:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 862, - "name": "amountToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 847, - "src": "10578:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "expression": { - "argumentTypes": null, - "id": 859, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10555:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 861, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "transfer", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10555:22:0", - "typeDescriptions": { - "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", - "typeString": "function (uint256)" - } - }, - "id": 863, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10555:38:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 864, - "nodeType": "ExpressionStatement", - "src": "10555:38:0" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 866, - "name": "refundAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 809, - "src": "10618:13:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 867, - "name": "amountToRefund", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 847, - "src": "10633:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - ], - "id": 865, - "name": "Withdrawn", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 42, - "src": "10608:9:0", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_uint256_$returns$__$", - "typeString": "function (address,uint256)" - } - }, - "id": 868, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "10608:40:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 869, - "nodeType": "EmitStatement", - "src": "10603:45:0" - } - ] - }, - "documentation": null, - "id": 871, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 812, - "modifierName": { - "argumentTypes": null, - "id": 811, - "name": "onlyFrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1021, - "src": "10116:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10116:10:0" - } - ], - "name": "withdraw", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 810, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 809, - "name": "refundAddress", - "nodeType": "VariableDeclaration", - "scope": 871, - "src": "10086:21:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 808, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10086:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "10085:23:0" - }, - "payable": false, - "returnParameters": { - "id": 813, - "nodeType": "ParameterList", - "parameters": [], - "src": "10127:0:0" - }, - "scope": 1080, - "src": "10068:587:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 912, - "nodeType": "Block", - "src": "10801:322:0", - "statements": [ - { - "body": { - "id": 906, - "nodeType": "Block", - "src": "10861:221:0", - "statements": [ - { - "assignments": [ - 890 - ], - "declarations": [ - { - "constant": false, - "id": 890, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 913, - "src": "10875:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 889, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "10875:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 894, - "initialValue": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 891, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "10904:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 893, - "indexExpression": { - "argumentTypes": null, - "id": 892, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10920:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10904:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "10875:47:0" - }, - { - "condition": { - "argumentTypes": null, - "id": 899, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "10940:42:0", - "subExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 895, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "10941:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 897, - "indexExpression": { - "argumentTypes": null, - "id": 896, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 890, - "src": "10954:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "10941:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 898, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "refunded", - "nodeType": "MemberAccess", - "referencedDeclaration": 29, - "src": "10941:41:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 905, - "nodeType": "IfStatement", - "src": "10936:136:0", - "trueBody": { - "id": 904, - "nodeType": "Block", - "src": "10984:88:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f742079657420726566756e646564", - "id": 901, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11009:47:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_85d231c62370fa6b43ee7ffe2e2243eb8d4631e742e97de3a2558a277a825be1", - "typeString": "literal_string \"At least one contributor has not yet refunded\"" - }, - "value": "At least one contributor has not yet refunded" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_stringliteral_85d231c62370fa6b43ee7ffe2e2243eb8d4631e742e97de3a2558a277a825be1", - "typeString": "literal_string \"At least one contributor has not yet refunded\"" - } - ], - "id": 900, - "name": "revert", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1252, - 1253 - ], - "referencedDeclaration": 1253, - "src": "11002:6:0", - "typeDescriptions": { - "typeIdentifier": "t_function_revert_pure$_t_string_memory_ptr_$returns$__$", - "typeString": "function (string memory) pure" - } - }, - "id": 902, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11002:55:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 903, - "nodeType": "ExpressionStatement", - "src": "11002:55:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 885, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 882, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10828:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 883, - "name": "contributorList", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 71, - "src": "10832:15:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 884, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "10832:22:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "10828:26:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 907, - "initializationExpression": { - "assignments": [ - 879 - ], - "declarations": [ - { - "constant": false, - "id": 879, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 913, - "src": "10816:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 878, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "10816:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 881, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 880, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "10825:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "10816:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 887, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "10856:3:0", - "subExpression": { - "argumentTypes": null, - "id": 886, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 879, - "src": "10856:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 888, - "nodeType": "ExpressionStatement", - "src": "10856:3:0" - }, - "nodeType": "ForStatement", - "src": "10811:271:0" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 909, - "name": "beneficiary", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 64, - "src": "11104:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 908, - "name": "selfdestruct", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1255, - "src": "11091:12:0", - "typeDescriptions": { - "typeIdentifier": "t_function_selfdestruct_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 910, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11091:25:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 911, - "nodeType": "ExpressionStatement", - "src": "11091:25:0" - } - ] - }, - "documentation": null, - "id": 913, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [ - { - "arguments": null, - "id": 874, - "modifierName": { - "argumentTypes": null, - "id": 873, - "name": "onlyTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1079, - "src": "10778:11:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10778:11:0" - }, - { - "arguments": null, - "id": 876, - "modifierName": { - "argumentTypes": null, - "id": 875, - "name": "onlyFrozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1021, - "src": "10790:10:0", - "typeDescriptions": { - "typeIdentifier": "t_modifier$__$", - "typeString": "modifier ()" - } - }, - "nodeType": "ModifierInvocation", - "src": "10790:10:0" - } - ], - "name": "destroy", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 872, - "nodeType": "ParameterList", - "parameters": [], - "src": "10768:2:0" - }, - "payable": false, - "returnParameters": { - "id": 877, - "nodeType": "ParameterList", - "parameters": [], - "src": "10801:0:0" - }, - "scope": 1080, - "src": "10752:371:0", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 927, - "nodeType": "Block", - "src": "11200:57:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 925, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "hexValue": "32", - "id": 922, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11233:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - }, - "value": "2" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_rational_2_by_1", - "typeString": "int_const 2" - } - ], - "expression": { - "argumentTypes": null, - "id": 920, - "name": "valueVoting", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 915, - "src": "11217:11:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 921, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "mul", - "nodeType": "MemberAccess", - "referencedDeclaration": 1173, - "src": "11217:15: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": 923, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "11217:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">", - "rightExpression": { - "argumentTypes": null, - "id": 924, - "name": "amountRaised", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 56, - "src": "11238:12:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11217:33:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 919, - "id": 926, - "nodeType": "Return", - "src": "11210:40:0" - } - ] - }, - "documentation": null, - "id": 928, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isMajorityVoting", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 916, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 915, - "name": "valueVoting", - "nodeType": "VariableDeclaration", - "scope": 928, - "src": "11155:16:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 914, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11155:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11154:18:0" - }, - "payable": false, - "returnParameters": { - "id": 919, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 918, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 928, - "src": "11194:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 917, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11194:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11193:6:0" - }, - "scope": 1080, - "src": "11129:128:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 958, - "nodeType": "Block", - "src": "11317:180:0", - "statements": [ - { - "body": { - "id": 954, - "nodeType": "Block", - "src": "11370:99:0", - "statements": [ - { - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "id": 949, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 944, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "11388:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 945, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11388:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "nodeType": "BinaryOperation", - "operator": "==", - "rightExpression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 946, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "11402:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 948, - "indexExpression": { - "argumentTypes": null, - "id": 947, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11411:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11402:11:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "src": "11388:25:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "falseBody": null, - "id": 953, - "nodeType": "IfStatement", - "src": "11384:75:0", - "trueBody": { - "id": 952, - "nodeType": "Block", - "src": "11415:44:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "hexValue": "74727565", - "id": 950, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11440:4:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "true" - }, - "functionReturnParameters": 932, - "id": 951, - "nodeType": "Return", - "src": "11433:11:0" - } - ] - } - } - ] - }, - "condition": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 940, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 937, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11344:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<", - "rightExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 938, - "name": "trustees", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 74, - "src": "11348:8:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 939, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "length", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "11348:15:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11344:19:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "id": 955, - "initializationExpression": { - "assignments": [ - 934 - ], - "declarations": [ - { - "constant": false, - "id": 934, - "name": "i", - "nodeType": "VariableDeclaration", - "scope": 959, - "src": "11332:6:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 933, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11332:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 936, - "initialValue": { - "argumentTypes": null, - "hexValue": "30", - "id": 935, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11341:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "nodeType": "VariableDeclarationStatement", - "src": "11332:10:0" - }, - "loopExpression": { - "expression": { - "argumentTypes": null, - "id": 942, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "++", - "prefix": false, - "src": "11365:3:0", - "subExpression": { - "argumentTypes": null, - "id": 941, - "name": "i", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 934, - "src": "11365:1:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 943, - "nodeType": "ExpressionStatement", - "src": "11365:3:0" - }, - "nodeType": "ForStatement", - "src": "11327:142:0" - }, - { - "expression": { - "argumentTypes": null, - "hexValue": "66616c7365", - "id": 956, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "bool", - "lValueRequested": false, - "nodeType": "Literal", - "src": "11485:5:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "value": "false" - }, - "functionReturnParameters": 932, - "id": 957, - "nodeType": "Return", - "src": "11478:12:0" - } - ] - }, - "documentation": null, - "id": 959, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isCallerTrustee", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 929, - "nodeType": "ParameterList", - "parameters": [], - "src": "11287:2:0" - }, - "payable": false, - "returnParameters": { - "id": 932, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 931, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 959, - "src": "11311:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 930, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11311:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11310:6:0" - }, - "scope": 1080, - "src": "11263:234:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 971, - "nodeType": "Block", - "src": "11550:62:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 969, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 966, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 964, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "11567:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": ">=", - "rightExpression": { - "argumentTypes": null, - "id": 965, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "11574:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "11567:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 968, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "11586:19:0", - "subExpression": { - "argumentTypes": null, - "id": 967, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "11587:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "11567:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 963, - "id": 970, - "nodeType": "Return", - "src": "11560:45:0" - } - ] - }, - "documentation": null, - "id": 972, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "isFailed", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 960, - "nodeType": "ParameterList", - "parameters": [], - "src": "11520:2:0" - }, - "payable": false, - "returnParameters": { - "id": 963, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 962, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 972, - "src": "11544:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 961, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11544:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11543:6:0" - }, - "scope": 1080, - "src": "11503:109:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 988, - "nodeType": "Block", - "src": "11731:90:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 981, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "11749:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 983, - "indexExpression": { - "argumentTypes": null, - "id": 982, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 974, - "src": "11762:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11749:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 984, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "milestoneNoVotes", - "nodeType": "MemberAccess", - "referencedDeclaration": 25, - "src": "11749:49:0", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_bool_$dyn_storage", - "typeString": "bool[] storage ref" - } - }, - "id": 986, - "indexExpression": { - "argumentTypes": null, - "id": 985, - "name": "milestoneIndex", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 976, - "src": "11799:14:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11749:65:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "functionReturnParameters": 980, - "id": 987, - "nodeType": "Return", - "src": "11742:72:0" - } - ] - }, - "documentation": null, - "id": 989, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getContributorMilestoneVote", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 977, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 974, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11655:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 973, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11655:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 976, - "name": "milestoneIndex", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11683:19:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 975, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11683:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11654:49:0" - }, - "payable": false, - "returnParameters": { - "id": 980, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 979, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 989, - "src": "11725:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 978, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "11725:4:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11724:6:0" - }, - "scope": 1080, - "src": "11618:203:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1001, - "nodeType": "Block", - "src": "11924:75:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 996, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "11941:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 998, - "indexExpression": { - "argumentTypes": null, - "id": 997, - "name": "contributorAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 991, - "src": "11954:18:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "11941:32:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 999, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "11941:51:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 995, - "id": 1000, - "nodeType": "Return", - "src": "11934:58:0" - } - ] - }, - "documentation": null, - "id": 1002, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getContributorContributionAmount", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 992, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 991, - "name": "contributorAddress", - "nodeType": "VariableDeclaration", - "scope": 1002, - "src": "11869:26:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 990, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "11869:7:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11868:28:0" - }, - "payable": false, - "returnParameters": { - "id": 995, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 994, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1002, - "src": "11918:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 993, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "11918:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "11917:6:0" - }, - "scope": 1080, - "src": "11827:172:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1011, - "nodeType": "Block", - "src": "12059:42:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1008, - "name": "freezeReason", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 11, - "src": "12081:12:0", - "typeDescriptions": { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_enum$_FreezeReason_$9", - "typeString": "enum CrowdFund.FreezeReason" - } - ], - "id": 1007, - "isConstant": false, - "isLValue": false, - "isPure": true, - "lValueRequested": false, - "nodeType": "ElementaryTypeNameExpression", - "src": "12076:4:0", - "typeDescriptions": { - "typeIdentifier": "t_type$_t_uint256_$", - "typeString": "type(uint256)" - }, - "typeName": "uint" - }, - "id": 1009, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "typeConversion", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12076:18:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "functionReturnParameters": 1006, - "id": 1010, - "nodeType": "Return", - "src": "12069:25:0" - } - ] - }, - "documentation": null, - "id": 1012, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": true, - "modifiers": [], - "name": "getFreezeReason", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1003, - "nodeType": "ParameterList", - "parameters": [], - "src": "12029:2:0" - }, - "payable": false, - "returnParameters": { - "id": 1006, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1005, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1012, - "src": "12053:4:0", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1004, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "12053:4:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "12052:6:0" - }, - "scope": 1080, - "src": "12005:96:0", - "stateMutability": "view", - "superFunction": null, - "visibility": "public" - }, - { - "body": { - "id": 1020, - "nodeType": "Block", - "src": "12129:70:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1015, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "12147:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f742066726f7a656e", - "id": 1016, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12155:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - }, - "value": "CrowdFund is not frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_144124cc12823f56a1037eeced499cee1638a07fba8aa0ce757da7cf592192bf", - "typeString": "literal_string \"CrowdFund is not frozen\"" - } - ], - "id": 1014, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12139:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1017, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12139:42:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1018, - "nodeType": "ExpressionStatement", - "src": "12139:42:0" - }, - { - "id": 1019, - "nodeType": "PlaceholderStatement", - "src": "12191:1:0" - } - ] - }, - "documentation": null, - "id": 1021, - "name": "onlyFrozen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1013, - "nodeType": "ParameterList", - "parameters": [], - "src": "12126:2:0" - }, - "src": "12107:92:0", - "visibility": "internal" - }, - { - "body": { - "id": 1030, - "nodeType": "Block", - "src": "12229:67:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1025, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "12247:7:0", - "subExpression": { - "argumentTypes": null, - "id": 1024, - "name": "frozen", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 44, - "src": "12248:6:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e642069732066726f7a656e", - "id": 1026, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12256:21:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_21ebfed987d130de5e469bef5346c6c759f8769c3909e5f178aa85e98366503d", - "typeString": "literal_string \"CrowdFund is frozen\"" - }, - "value": "CrowdFund is frozen" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_21ebfed987d130de5e469bef5346c6c759f8769c3909e5f178aa85e98366503d", - "typeString": "literal_string \"CrowdFund is frozen\"" - } - ], - "id": 1023, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12239:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1027, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12239:39:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1028, - "nodeType": "ExpressionStatement", - "src": "12239:39:0" - }, - { - "id": 1029, - "nodeType": "PlaceholderStatement", - "src": "12288:1:0" - } - ] - }, - "documentation": null, - "id": 1031, - "name": "onlyUnfrozen", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1022, - "nodeType": "ParameterList", - "parameters": [], - "src": "12226:2:0" - }, - "src": "12205:91:0", - "visibility": "internal" - }, - { - "body": { - "id": 1039, - "nodeType": "Block", - "src": "12324:84:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1034, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "12342:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "526169736520676f616c206973206e6f742072656163686564", - "id": 1035, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12362:27:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_d65d4721f73624ca6e381e7ad4c000f40a20c0abe88c0be62360bb906d10ffbe", - "typeString": "literal_string \"Raise goal is not reached\"" - }, - "value": "Raise goal is not reached" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_d65d4721f73624ca6e381e7ad4c000f40a20c0abe88c0be62360bb906d10ffbe", - "typeString": "literal_string \"Raise goal is not reached\"" - } - ], - "id": 1033, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12334:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1036, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12334:56:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1037, - "nodeType": "ExpressionStatement", - "src": "12334:56:0" - }, - { - "id": 1038, - "nodeType": "PlaceholderStatement", - "src": "12400:1:0" - } - ] - }, - "documentation": null, - "id": 1040, - "name": "onlyRaised", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1032, - "nodeType": "ParameterList", - "parameters": [], - "src": "12321:2:0" - }, - "src": "12302:106:0", - "visibility": "internal" - }, - { - "body": { - "id": 1053, - "nodeType": "Block", - "src": "12437:103:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "id": 1048, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1045, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "id": 1043, - "name": "now", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1249, - "src": "12455:3:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "<=", - "rightExpression": { - "argumentTypes": null, - "id": 1044, - "name": "deadline", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 52, - "src": "12462:8:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "src": "12455:15:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "nodeType": "BinaryOperation", - "operator": "&&", - "rightExpression": { - "argumentTypes": null, - "id": 1047, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "UnaryOperation", - "operator": "!", - "prefix": true, - "src": "12474:19:0", - "subExpression": { - "argumentTypes": null, - "id": 1046, - "name": "isRaiseGoalReached", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 46, - "src": "12475:18:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "src": "12455:38:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43726f776446756e64206973206e6f74206f6e676f696e67", - "id": 1049, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12495:26:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_843cc2d7a1ba19041b40561b89d21c7571d29e5c5e2d0d1510f441aea3fc1747", - "typeString": "literal_string \"CrowdFund is not ongoing\"" - }, - "value": "CrowdFund is not ongoing" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_843cc2d7a1ba19041b40561b89d21c7571d29e5c5e2d0d1510f441aea3fc1747", - "typeString": "literal_string \"CrowdFund is not ongoing\"" - } - ], - "id": 1042, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12447:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1050, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12447:75:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1051, - "nodeType": "ExpressionStatement", - "src": "12447:75:0" - }, - { - "id": 1052, - "nodeType": "PlaceholderStatement", - "src": "12532:1:0" - } - ] - }, - "documentation": null, - "id": 1054, - "name": "onlyOnGoing", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1041, - "nodeType": "ParameterList", - "parameters": [], - "src": "12434:2:0" - }, - "src": "12414:126:0", - "visibility": "internal" - }, - { - "body": { - "id": 1068, - "nodeType": "Block", - "src": "12573:116:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "commonType": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "id": 1063, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "leftExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "baseExpression": { - "argumentTypes": null, - "id": 1057, - "name": "contributors", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 68, - "src": "12591:12:0", - "typeDescriptions": { - "typeIdentifier": "t_mapping$_t_address_$_t_struct$_Contributor_$30_storage_$", - "typeString": "mapping(address => struct CrowdFund.Contributor storage ref)" - } - }, - "id": 1060, - "indexExpression": { - "argumentTypes": null, - "expression": { - "argumentTypes": null, - "id": 1058, - "name": "msg", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1247, - "src": "12604:3:0", - "typeDescriptions": { - "typeIdentifier": "t_magic_message", - "typeString": "msg" - } - }, - "id": 1059, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "sender", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "12604:10:0", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "nodeType": "IndexAccess", - "src": "12591:24:0", - "typeDescriptions": { - "typeIdentifier": "t_struct$_Contributor_$30_storage", - "typeString": "struct CrowdFund.Contributor storage ref" - } - }, - "id": 1061, - "isConstant": false, - "isLValue": true, - "isPure": false, - "lValueRequested": false, - "memberName": "contributionAmount", - "nodeType": "MemberAccess", - "referencedDeclaration": 22, - "src": "12591:43:0", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "nodeType": "BinaryOperation", - "operator": "!=", - "rightExpression": { - "argumentTypes": null, - "hexValue": "30", - "id": 1062, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "number", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12638:1:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_rational_0_by_1", - "typeString": "int_const 0" - }, - "value": "0" - }, - "src": "12591:48:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616c6c6572206973206e6f74206120636f6e7472696275746f72", - "id": 1064, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12641:29:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_27c7012fc5b199883f3d6c1e7d0d3c9cd967752b2ed8ba1703713f2d84425e7b", - "typeString": "literal_string \"Caller is not a contributor\"" - }, - "value": "Caller is not a contributor" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_27c7012fc5b199883f3d6c1e7d0d3c9cd967752b2ed8ba1703713f2d84425e7b", - "typeString": "literal_string \"Caller is not a contributor\"" - } - ], - "id": 1056, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12583:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1065, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12583:88:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1066, - "nodeType": "ExpressionStatement", - "src": "12583:88:0" - }, - { - "id": 1067, - "nodeType": "PlaceholderStatement", - "src": "12681:1:0" - } - ] - }, - "documentation": null, - "id": 1069, - "name": "onlyContributor", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1055, - "nodeType": "ParameterList", - "parameters": [], - "src": "12570:2:0" - }, - "src": "12546:143:0", - "visibility": "internal" - }, - { - "body": { - "id": 1078, - "nodeType": "Block", - "src": "12718:81:0", - "statements": [ - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "arguments": [], - "expression": { - "argumentTypes": [], - "id": 1072, - "name": "isCallerTrustee", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 959, - "src": "12736:15:0", - "typeDescriptions": { - "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", - "typeString": "function () view returns (bool)" - } - }, - "id": 1073, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12736:17:0", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - { - "argumentTypes": null, - "hexValue": "43616c6c6572206973206e6f7420612074727573746565", - "id": 1074, - "isConstant": false, - "isLValue": false, - "isPure": true, - "kind": "string", - "lValueRequested": false, - "nodeType": "Literal", - "src": "12755:25:0", - "subdenomination": null, - "typeDescriptions": { - "typeIdentifier": "t_stringliteral_efecdf3be8b72bfbf67a07f441dfdb20b968592ad6d7fba48a91dfa72a34f2d8", - "typeString": "literal_string \"Caller is not a trustee\"" - }, - "value": "Caller is not a trustee" - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - { - "typeIdentifier": "t_stringliteral_efecdf3be8b72bfbf67a07f441dfdb20b968592ad6d7fba48a91dfa72a34f2d8", - "typeString": "literal_string \"Caller is not a trustee\"" - } - ], - "id": 1071, - "name": "require", - "nodeType": "Identifier", - "overloadedDeclarations": [ - 1250, - 1251 - ], - "referencedDeclaration": 1251, - "src": "12728:7:0", - "typeDescriptions": { - "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", - "typeString": "function (bool,string memory) pure" - } - }, - "id": 1075, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "12728:53:0", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1076, - "nodeType": "ExpressionStatement", - "src": "12728:53:0" - }, - { - "id": 1077, - "nodeType": "PlaceholderStatement", - "src": "12791:1:0" - } - ] - }, - "documentation": null, - "id": 1079, - "name": "onlyTrustee", - "nodeType": "ModifierDefinition", - "parameters": { - "id": 1070, - "nodeType": "ParameterList", - "parameters": [], - "src": "12715:2:0" - }, - "src": "12695:104:0", - "visibility": "internal" - } - ], - "scope": 1081, - "src": "87:12715:0" - } - ], - "src": "0:12802:0" - }, - "compiler": { - "name": "solc", - "version": "0.4.24+commit.e67f0147.Emscripten.clang" - }, - "networks": {}, - "schemaVersion": "2.0.1", - "updatedAt": "2018-09-26T03:49:30.936Z" -} \ No newline at end of file diff --git a/contract/build/contracts/CrowdFundFactory.json b/contract/build/contracts/CrowdFundFactory.json deleted file mode 100644 index b42770e5..00000000 --- a/contract/build/contracts/CrowdFundFactory.json +++ /dev/null @@ -1,1566 +0,0 @@ -{ - "contractName": "CrowdFundFactory", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "name": "newAddress", - "type": "address" - } - ], - "name": "ContractCreated", - "type": "event" - }, - { - "constant": false, - "inputs": [ - { - "name": "raiseGoalAmount", - "type": "uint256" - }, - { - "name": "payOutAddress", - "type": "address" - }, - { - "name": "trusteesAddresses", - "type": "address[]" - }, - { - "name": "allMilestones", - "type": "uint256[]" - }, - { - "name": "durationInSeconds", - "type": "uint256" - }, - { - "name": "milestoneVotingPeriodInSeconds", - "type": "uint256" - }, - { - "name": "immediateFirstMilestonePayout", - "type": "bool" - } - ], - "name": "createCrowdFund", - "outputs": [ - { - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b50613692806100206000396000f300608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806350f74ec014610046575b600080fd5b34801561005257600080fd5b5061013760048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019092919080359060200190929190803515159060200190929190505050610179565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000808888888888888861018b610368565b808881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018060200186815260200185815260200184151515158152602001838103835288818151815260200191508051906020019060200280838360005b8381101561021d578082015181840152602081019050610202565b50505050905001838103825287818151815260200191508051906020019060200280838360005b8381101561025f578082015181840152602081019050610244565b505050509050019950505050505050505050604051809103906000f08015801561028d573d6000803e3d6000fd5b5090507fcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca31281604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a160008190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505080915050979650505050505050565b6040516132ee8061037983390190560060806040523480156200001157600080fd5b50604051620032ee380380620032ee833981018060405281019080805190602001909291908051906020019092919080518201929190602001805182019291906020018051906020019092919080519060200190929190805190602001909291905050506000806000670de0b6b3a76400008a1015151562000121576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f526169736520676f616c20697320736d616c6c6572207468616e20312065746881526020017f657200000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001885110158015620001365750600a885111155b1515620001d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260398152602001807f5472757374656520616464726573736573206d757374206265206174206c656181526020017f7374203120616e64206e6f74206d6f7265207468616e2031300000000000000081525060400191505060405180910390fd5b6001875110158015620001e65750600a875111155b151562000281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f4d696c6573746f6e6573206d757374206265206174206c65617374203120616e81526020017f64206e6f74206d6f7265207468616e203130000000000000000000000000000081525060400191505060405180910390fd5b60009250600091505b865182101562000416578682815181101515620002a357fe5b9060200190602002015190506000811115156200034e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f4d696c6573746f6e6520616d6f756e74206d757374206265206772656174657281526020017f207468616e20300000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6200037181846200059b6401000000000262002ae5179091906401000000009004565b9250600c6080604051908101604052808381526020016000815260200160008152602001600015158152509080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555050505081806001019250506200028a565b8983141515620004b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4d696c6573746f6e6520746f74616c206d75737420657175616c20726169736581526020017f20676f616c00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60016006819055508960038190555088600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600b90805190602001906200051c929190620005b8565b508542016002819055508460018190555083600060036101000a81548160ff02191690831515021790555060008060026101000a81548160ff021916908315150217905550600060078190555060008060016101000a81548160ff0219169083151502179055506000600481905550505050505050505050506200068d565b60008183019050828110151515620005af57fe5b80905092915050565b82805482825590600052602060002090810192821562000634579160200282015b82811115620006335782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620005d9565b5b50905062000643919062000647565b5090565b6200068a91905b808211156200068657600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016200064e565b5090565b90565b612c51806200069d6000396000f300608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461017a57806318329822146101a95780631f6d4942146101d45780631fe4d9dd1461024157806326e6074b1461027057806329dcb0cf1461029b5780632b99d7e4146102c657806337b028ef146102ff57806338af3eed1461032a57806347680fca1461038157806351cff8d9146103c6578063590e1ae31461040957806369d596fc14610420578063717d63a41461044f5780637923de2a146104bc5780637b3e5e7b1461051357806383197ef01461053e578063966778061461055557806396b6a34e146105ba5780639d5b06f7146105e75780639ec45bbe146106125780639f5557981461063f578063a3e9436c146106ac578063d6383230146106d7578063d7bb99ba14610702578063d9a992431461070c578063e88329691461073b578063e89e4ed61461076a578063f4163340146107c4575b600080fd5b34801561018657600080fd5b5061018f6107f3565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610806565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b50610215600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061080c565b604051808481526020018315151515815260200182151515158152602001935050505060405180910390f35b34801561024d57600080fd5b50610256610850565b604051808215151515815260200191505060405180910390f35b34801561027c57600080fd5b506102856108f1565b6040518082815260200191505060405180910390f35b3480156102a757600080fd5b506102b06108f7565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102fd600480360381019080803590602001909291908035151590602001909291905050506108fd565b005b34801561030b57600080fd5b50610314610e6f565b6040518082815260200191505060405180910390f35b34801561033657600080fd5b5061033f610e75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038d57600080fd5b506103ac60048036038101908080359060200190929190505050610e9b565b604051808215151515815260200191505060405180910390f35b3480156103d257600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebc565b005b34801561041557600080fd5b5061041e611231565b005b34801561042c57600080fd5b5061044d600480360381019080803515159060200190929190505050611445565b005b34801561045b57600080fd5b5061047a6004803603810190808035906020019092919050505061182a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c857600080fd5b506104fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611868565b6040518082815260200191505060405180910390f35b34801561051f57600080fd5b506105286118b4565b6040518082815260200191505060405180910390f35b34801561054a57600080fd5b506105536118ba565b005b34801561056157600080fd5b506105a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b3d565b604051808215151515815260200191505060405180910390f35b3480156105c657600080fd5b506105e560048036038101908080359060200190929190505050611bb6565b005b3480156105f357600080fd5b506105fc61206b565b6040518082815260200191505060405180910390f35b34801561061e57600080fd5b5061063d60048036038101908080359060200190929190505050612071565b005b34801561064b57600080fd5b5061066a6004803603810190808035906020019092919050505061244a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1612488565b6040518082815260200191505060405180910390f35b3480156106e357600080fd5b506106ec61248e565b6040518082815260200191505060405180910390f35b61070a6124af565b005b34801561071857600080fd5b50610721612a34565b604051808215151515815260200191505060405180910390f35b34801561074757600080fd5b50610750612a47565b604051808215151515815260200191505060405180910390f35b34801561077657600080fd5b5061079560048036038101908080359060200190929190505050612a5a565b604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390f35b3480156107d057600080fd5b506107d9612aa6565b604051808215151515815260200191505060405180910390f35b600060019054906101000a900460ff1681565b60075481565b60096020528060005260406000206000915090508060000154908060020160009054906101000a900460ff16908060020160019054906101000a900460ff16905083565b600080600090505b600b805490508110156108e857600b8181548110151561087457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156108db57600191506108ed565b8080600101915050610858565b600091505b5090565b60055481565b60025481565b6000806000806000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141515156109be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515610a42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010186815481101515610b1657fe5b90600052602060002090602091828204019190069054906101000a900460ff16935084151584151514151515610bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f566f74652076616c7565206d75737420626520646966666572656e742074686181526020017f6e206578697374696e6720766f7465207374617465000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515610beb57fe5b90600052602060002090600402016002015411925042600c87815481101515610c1057fe5b90600052602060002090600402016002015411159150828015610c31575081155b9050801515610ca8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d696c6573746f6e6520766f74696e67206d757374206265206f70656e00000081525060200191505060405180910390fd5b84600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010187815481101515610cf857fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550841515610dc657610d9d600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610d7d57fe5b906000526020600020906004020160010154612acc90919063ffffffff16565b600c87815481101515610dac57fe5b906000526020600020906004020160010181905550610e67565b8415610e6657610e41600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610e2157fe5b906000526020600020906004020160010154612ae590919063ffffffff16565b600c87815481101515610e5057fe5b9060005260206000209060040201600101819055505b5b505050505050565b60065481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454610eb4600284612b0190919063ffffffff16565b119050919050565b60008060008060019054906101000a900460ff161515610f44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515610fc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff169250821515156110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f537065636966696564206164647265737320697320616c72656164792072656681526020017f756e64656400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160016101000a81548160ff021916908315150217905550600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015491506111946005546111863073ffffffffffffffffffffffffffffffffffffffff163185612b0190919063ffffffff16565b612b3990919063ffffffff16565b90508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156111dc573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a250505050565b60008060008060019054906101000a900460ff161515156112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6112c2610850565b92506112cc612aa6565b91506112d9600754610e9b565b905082806112e45750815b806112ec5750805b1515611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f526571756972656420636f6e646974696f6e7320666f7220726566756e64206181526020017f7265206e6f74206d65740000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82156113b45760008060006101000a81548160ff021916908360028111156113aa57fe5b0217905550611407565b81156113e25760016000806101000a81548160ff021916908360028111156113d857fe5b0217905550611406565b60026000806101000a81548160ff0219169083600281111561140057fe5b02179055505b5b6001600060016101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff1631600581905550505050565b600080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414151515611501576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611585576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615151561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff169050801515821515141515156116fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4578697374696e6720766f7465207374617465206973206964656e746963616c81526020017f20746f20766f74652076616c756500000000000000000000000000000000000081525060400191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff0219169083151502179055508115156117c1576117b6600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612acc90919063ffffffff16565b600781905550611826565b81156118255761181e600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612ae590919063ffffffff16565b6007819055505b5b5050565b600b8181548110151561183957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b60045481565b6000806118c5610850565b1515611939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615156119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600091505b600a80549050821015611b0257600a828154811015156119de57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff161515611af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f7481526020017f2079657420726566756e6465640000000000000000000000000000000000000081525060400191505060405180910390fd5b81806001019250506119c2565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515611b8e57fe5b90600052602060002090602091828204019190069054906101000a900460ff16905092915050565b6000806000806000611bc6610850565b1515611c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600c86815481101515611d5257fe5b906000526020600020906004020160030160009054906101000a900460ff16945042600c87815481101515611d8357fe5b906000526020600020906004020160020154119350611dc1600c87815481101515611daa57fe5b906000526020600020906004020160010154610e9b565b925084151515611e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4d696c6573746f6e6520616c726561647920706169640000000000000000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150600090505b600c80549050811015611eb257600c81815481101515611e7d57fe5b906000526020600020906004020160030160009054906101000a900460ff1615611ea5578091505b8080600101915050611e61565b6001820186141515611f52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f4d696c6573746f6e652072657175657374206d75737420626520666f7220666981526020017f72737420756e70616964206d696c6573746f6e6500000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515611f6357fe5b906000526020600020906004020160020154141561200657600086148015611f975750600060039054906101000a900460ff165b15611fc7576001600c87815481101515611fad57fe5b906000526020600020906004020160020181905550612001565b611fdc60015442612ae590919063ffffffff16565b600c87815481101515611feb57fe5b9060005260206000209060040201600201819055505b612063565b8380156120105750825b156120625761203d61202e6002600154612b0190919063ffffffff16565b42612ae590919063ffffffff16565b600c8781548110151561204c57fe5b9060005260206000209060040201600201819055505b5b505050505050565b60015481565b600080600080600060029054906101000a900460ff1615156120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515612180576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b42600c8681548110151561219057fe5b9060005260206000209060040201600201541093506121ce600c868154811015156121b757fe5b906000526020600020906004020160010154610e9b565b9250600c858154811015156121df57fe5b906000526020600020906004020160030160009054906101000a900460ff16915083801561220b575082155b8015612215575081155b156123af576001600c8681548110151561222b57fe5b906000526020600020906004020160030160006101000a81548160ff021916908315150217905550600c8581548110151561226257fe5b9060005260206000209060040201600001549050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122de573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2600161236986600c80549050612acc90919063ffffffff16565b14156123aa57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b612443565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f726571756972656420636f6e646974696f6e732077657265206e6f742073617481526020017f697366696564000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5050505050565b600a8181548110151561245957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60008060009054906101000a900460ff1660028111156124aa57fe5b905090565b600080600060025442111580156124d35750600060029054906101000a900460ff16155b1515612547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43726f776446756e64206973206e6f74206f6e676f696e67000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515156125cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6125e134600454612ae590919063ffffffff16565b92506003548311151515612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f436f6e747269627574696f6e206578636565647320746865207261697365206781526020017f6f616c2e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600654341015915060035483149050818061269b5750805b151561275b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604d8152602001807f6d73672e76616c75652067726561746572207468616e206d696e696d756d2c2081526020017f6f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7481526020017f20746f206265207261697365640000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141561291657608060405190810160405280348152602001600c805490506040519080825280602002602001820160405280156127ec5781602001602082028038833980820191505090505b50815260200160001515815260200160001515815250600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001019080519060200190612867929190612b4f565b5060408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff021916908315150217905550905050600a3390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506129b2565b61296b34600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612ae590919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b8260048190555060035460045414156129e1576001600060026101000a81548160ff0219169083151502179055505b3373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4346040518082815260200191505060405180910390a2505050565b600060029054906101000a900460ff1681565b600060039054906101000a900460ff1681565b600c81815481101515612a6957fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60006002544210158015612ac75750600060029054906101000a900460ff16155b905090565b6000828211151515612ada57fe5b818303905092915050565b60008183019050828110151515612af857fe5b80905092915050565b600080831415612b145760009050612b33565b8183029050818382811515612b2557fe5b04141515612b2f57fe5b8090505b92915050565b60008183811515612b4657fe5b04905092915050565b82805482825590600052602060002090601f01602090048101928215612be45791602002820160005b83821115612bb557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612b78565b8015612be25782816101000a81549060ff0219169055600101602081600001049283019260010302612bb5565b505b509050612bf19190612bf5565b5090565b612c2291905b80821115612c1e57600081816101000a81549060ff021916905550600101612bfb565b5090565b905600a165627a7a72305820b725d6ed533ba3c21fcb343e8c393171f8c562c1668224983554c10c88ce87060029a165627a7a7230582038c1809b6ce57218a64a17a9211e1b79cca7e3c5a544e99070a9b555c6cb52430029", - "deployedBytecode": "0x608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806350f74ec014610046575b600080fd5b34801561005257600080fd5b5061013760048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019092919080359060200190929190803515159060200190929190505050610179565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000808888888888888861018b610368565b808881526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001806020018060200186815260200185815260200184151515158152602001838103835288818151815260200191508051906020019060200280838360005b8381101561021d578082015181840152602081019050610202565b50505050905001838103825287818151815260200191508051906020019060200280838360005b8381101561025f578082015181840152602081019050610244565b505050509050019950505050505050505050604051809103906000f08015801561028d573d6000803e3d6000fd5b5090507fcf78cf0d6f3d8371e1075c69c492ab4ec5d8cf23a1a239b6a51a1d00be7ca31281604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a160008190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505080915050979650505050505050565b6040516132ee8061037983390190560060806040523480156200001157600080fd5b50604051620032ee380380620032ee833981018060405281019080805190602001909291908051906020019092919080518201929190602001805182019291906020018051906020019092919080519060200190929190805190602001909291905050506000806000670de0b6b3a76400008a1015151562000121576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f526169736520676f616c20697320736d616c6c6572207468616e20312065746881526020017f657200000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001885110158015620001365750600a885111155b1515620001d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260398152602001807f5472757374656520616464726573736573206d757374206265206174206c656181526020017f7374203120616e64206e6f74206d6f7265207468616e2031300000000000000081525060400191505060405180910390fd5b6001875110158015620001e65750600a875111155b151562000281576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f4d696c6573746f6e6573206d757374206265206174206c65617374203120616e81526020017f64206e6f74206d6f7265207468616e203130000000000000000000000000000081525060400191505060405180910390fd5b60009250600091505b865182101562000416578682815181101515620002a357fe5b9060200190602002015190506000811115156200034e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001807f4d696c6573746f6e6520616d6f756e74206d757374206265206772656174657281526020017f207468616e20300000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6200037181846200059b6401000000000262002ae5179091906401000000009004565b9250600c6080604051908101604052808381526020016000815260200160008152602001600015158152509080600181540180825580915050906001820390600052602060002090600402016000909192909190915060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555050505081806001019250506200028a565b8983141515620004b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4d696c6573746f6e6520746f74616c206d75737420657175616c20726169736581526020017f20676f616c00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60016006819055508960038190555088600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555087600b90805190602001906200051c929190620005b8565b508542016002819055508460018190555083600060036101000a81548160ff02191690831515021790555060008060026101000a81548160ff021916908315150217905550600060078190555060008060016101000a81548160ff0219169083151502179055506000600481905550505050505050505050506200068d565b60008183019050828110151515620005af57fe5b80905092915050565b82805482825590600052602060002090810192821562000634579160200282015b82811115620006335782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190620005d9565b5b50905062000643919062000647565b5090565b6200068a91905b808211156200068657600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016200064e565b5090565b90565b612c51806200069d6000396000f300608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063054f7d9c1461017a57806318329822146101a95780631f6d4942146101d45780631fe4d9dd1461024157806326e6074b1461027057806329dcb0cf1461029b5780632b99d7e4146102c657806337b028ef146102ff57806338af3eed1461032a57806347680fca1461038157806351cff8d9146103c6578063590e1ae31461040957806369d596fc14610420578063717d63a41461044f5780637923de2a146104bc5780637b3e5e7b1461051357806383197ef01461053e578063966778061461055557806396b6a34e146105ba5780639d5b06f7146105e75780639ec45bbe146106125780639f5557981461063f578063a3e9436c146106ac578063d6383230146106d7578063d7bb99ba14610702578063d9a992431461070c578063e88329691461073b578063e89e4ed61461076a578063f4163340146107c4575b600080fd5b34801561018657600080fd5b5061018f6107f3565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be610806565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b50610215600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061080c565b604051808481526020018315151515815260200182151515158152602001935050505060405180910390f35b34801561024d57600080fd5b50610256610850565b604051808215151515815260200191505060405180910390f35b34801561027c57600080fd5b506102856108f1565b6040518082815260200191505060405180910390f35b3480156102a757600080fd5b506102b06108f7565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102fd600480360381019080803590602001909291908035151590602001909291905050506108fd565b005b34801561030b57600080fd5b50610314610e6f565b6040518082815260200191505060405180910390f35b34801561033657600080fd5b5061033f610e75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038d57600080fd5b506103ac60048036038101908080359060200190929190505050610e9b565b604051808215151515815260200191505060405180910390f35b3480156103d257600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ebc565b005b34801561041557600080fd5b5061041e611231565b005b34801561042c57600080fd5b5061044d600480360381019080803515159060200190929190505050611445565b005b34801561045b57600080fd5b5061047a6004803603810190808035906020019092919050505061182a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c857600080fd5b506104fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611868565b6040518082815260200191505060405180910390f35b34801561051f57600080fd5b506105286118b4565b6040518082815260200191505060405180910390f35b34801561054a57600080fd5b506105536118ba565b005b34801561056157600080fd5b506105a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b3d565b604051808215151515815260200191505060405180910390f35b3480156105c657600080fd5b506105e560048036038101908080359060200190929190505050611bb6565b005b3480156105f357600080fd5b506105fc61206b565b6040518082815260200191505060405180910390f35b34801561061e57600080fd5b5061063d60048036038101908080359060200190929190505050612071565b005b34801561064b57600080fd5b5061066a6004803603810190808035906020019092919050505061244a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106b857600080fd5b506106c1612488565b6040518082815260200191505060405180910390f35b3480156106e357600080fd5b506106ec61248e565b6040518082815260200191505060405180910390f35b61070a6124af565b005b34801561071857600080fd5b50610721612a34565b604051808215151515815260200191505060405180910390f35b34801561074757600080fd5b50610750612a47565b604051808215151515815260200191505060405180910390f35b34801561077657600080fd5b5061079560048036038101908080359060200190929190505050612a5a565b604051808581526020018481526020018381526020018215151515815260200194505050505060405180910390f35b3480156107d057600080fd5b506107d9612aa6565b604051808215151515815260200191505060405180910390f35b600060019054906101000a900460ff1681565b60075481565b60096020528060005260406000206000915090508060000154908060020160009054906101000a900460ff16908060020160019054906101000a900460ff16905083565b600080600090505b600b805490508110156108e857600b8181548110151561087457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156108db57600191506108ed565b8080600101915050610858565b600091505b5090565b60055481565b60025481565b6000806000806000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141515156109be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515610a42576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515610ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010186815481101515610b1657fe5b90600052602060002090602091828204019190069054906101000a900460ff16935084151584151514151515610bda576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001807f566f74652076616c7565206d75737420626520646966666572656e742074686181526020017f6e206578697374696e6720766f7465207374617465000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515610beb57fe5b90600052602060002090600402016002015411925042600c87815481101515610c1057fe5b90600052602060002090600402016002015411159150828015610c31575081155b9050801515610ca8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4d696c6573746f6e6520766f74696e67206d757374206265206f70656e00000081525060200191505060405180910390fd5b84600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010187815481101515610cf857fe5b90600052602060002090602091828204019190066101000a81548160ff021916908315150217905550841515610dc657610d9d600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610d7d57fe5b906000526020600020906004020160010154612acc90919063ffffffff16565b600c87815481101515610dac57fe5b906000526020600020906004020160010181905550610e67565b8415610e6657610e41600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600c88815481101515610e2157fe5b906000526020600020906004020160010154612ae590919063ffffffff16565b600c87815481101515610e5057fe5b9060005260206000209060040201600101819055505b5b505050505050565b60065481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454610eb4600284612b0190919063ffffffff16565b119050919050565b60008060008060019054906101000a900460ff161515610f44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515610fc8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff169250821515156110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f537065636966696564206164647265737320697320616c72656164792072656681526020017f756e64656400000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6001600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160016101000a81548160ff021916908315150217905550600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015491506111946005546111863073ffffffffffffffffffffffffffffffffffffffff163185612b0190919063ffffffff16565b612b3990919063ffffffff16565b90508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156111dc573d6000803e3d6000fd5b508373ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a250505050565b60008060008060019054906101000a900460ff161515156112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6112c2610850565b92506112cc612aa6565b91506112d9600754610e9b565b905082806112e45750815b806112ec5750805b1515611386576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f526571756972656420636f6e646974696f6e7320666f7220726566756e64206181526020017f7265206e6f74206d65740000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82156113b45760008060006101000a81548160ff021916908360028111156113aa57fe5b0217905550611407565b81156113e25760016000806101000a81548160ff021916908360028111156113d857fe5b0217905550611406565b60026000806101000a81548160ff0219169083600281111561140057fe5b02179055505b5b6001600060016101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff1631600581905550505050565b600080600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414151515611501576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616c6c6572206973206e6f74206120636f6e7472696275746f72000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611585576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615151561160a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff169050801515821515141515156116fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4578697374696e6720766f7465207374617465206973206964656e746963616c81526020017f20746f20766f74652076616c756500000000000000000000000000000000000081525060400191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548160ff0219169083151502179055508115156117c1576117b6600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612acc90919063ffffffff16565b600781905550611826565b81156118255761181e600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154600754612ae590919063ffffffff16565b6007819055505b5b5050565b600b8181548110151561183957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b60045481565b6000806118c5610850565b1515611939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff1615156119bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43726f776446756e64206973206e6f742066726f7a656e00000000000000000081525060200191505060405180910390fd5b600091505b600a80549050821015611b0257600a828154811015156119de57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160019054906101000a900460ff161515611af5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d8152602001807f4174206c65617374206f6e6520636f6e7472696275746f7220686173206e6f7481526020017f2079657420726566756e6465640000000000000000000000000000000000000081525060400191505060405180910390fd5b81806001019250506119c2565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515611b8e57fe5b90600052602060002090602091828204019190069054906101000a900460ff16905092915050565b6000806000806000611bc6610850565b1515611c3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616c6c6572206973206e6f742061207472757374656500000000000000000081525060200191505060405180910390fd5b600060029054906101000a900460ff161515611cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b600c86815481101515611d5257fe5b906000526020600020906004020160030160009054906101000a900460ff16945042600c87815481101515611d8357fe5b906000526020600020906004020160020154119350611dc1600c87815481101515611daa57fe5b906000526020600020906004020160010154610e9b565b925084151515611e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4d696c6573746f6e6520616c726561647920706169640000000000000000000081525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9150600090505b600c80549050811015611eb257600c81815481101515611e7d57fe5b906000526020600020906004020160030160009054906101000a900460ff1615611ea5578091505b8080600101915050611e61565b6001820186141515611f52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001807f4d696c6573746f6e652072657175657374206d75737420626520666f7220666981526020017f72737420756e70616964206d696c6573746f6e6500000000000000000000000081525060400191505060405180910390fd5b6000600c87815481101515611f6357fe5b906000526020600020906004020160020154141561200657600086148015611f975750600060039054906101000a900460ff165b15611fc7576001600c87815481101515611fad57fe5b906000526020600020906004020160020181905550612001565b611fdc60015442612ae590919063ffffffff16565b600c87815481101515611feb57fe5b9060005260206000209060040201600201819055505b612063565b8380156120105750825b156120625761203d61202e6002600154612b0190919063ffffffff16565b42612ae590919063ffffffff16565b600c8781548110151561204c57fe5b9060005260206000209060040201600201819055505b5b505050505050565b60015481565b600080600080600060029054906101000a900460ff1615156120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f526169736520676f616c206973206e6f7420726561636865640000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff16151515612180576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b42600c8681548110151561219057fe5b9060005260206000209060040201600201541093506121ce600c868154811015156121b757fe5b906000526020600020906004020160010154610e9b565b9250600c858154811015156121df57fe5b906000526020600020906004020160030160009054906101000a900460ff16915083801561220b575082155b8015612215575081155b156123af576001600c8681548110151561222b57fe5b906000526020600020906004020160030160006101000a81548160ff021916908315150217905550600c8581548110151561226257fe5b9060005260206000209060040201600001549050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122de573d6000803e3d6000fd5b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a2600161236986600c80549050612acc90919063ffffffff16565b14156123aa57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b612443565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f726571756972656420636f6e646974696f6e732077657265206e6f742073617481526020017f697366696564000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5050505050565b600a8181548110151561245957fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60008060009054906101000a900460ff1660028111156124aa57fe5b905090565b600080600060025442111580156124d35750600060029054906101000a900460ff16155b1515612547576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43726f776446756e64206973206e6f74206f6e676f696e67000000000000000081525060200191505060405180910390fd5b600060019054906101000a900460ff161515156125cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43726f776446756e642069732066726f7a656e0000000000000000000000000081525060200191505060405180910390fd5b6125e134600454612ae590919063ffffffff16565b92506003548311151515612683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f436f6e747269627574696f6e206578636565647320746865207261697365206781526020017f6f616c2e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600654341015915060035483149050818061269b5750805b151561275b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604d8152602001807f6d73672e76616c75652067726561746572207468616e206d696e696d756d2c2081526020017f6f72206d73672e76616c7565203d3d2072656d61696e696e6720616d6f756e7481526020017f20746f206265207261697365640000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141561291657608060405190810160405280348152602001600c805490506040519080825280602002602001820160405280156127ec5781602001602082028038833980820191505090505b50815260200160001515815260200160001515815250600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001019080519060200190612867929190612b4f565b5060408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff021916908315150217905550905050600a3390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506129b2565b61296b34600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612ae590919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b8260048190555060035460045414156129e1576001600060026101000a81548160ff0219169083151502179055505b3373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4346040518082815260200191505060405180910390a2505050565b600060029054906101000a900460ff1681565b600060039054906101000a900460ff1681565b600c81815481101515612a6957fe5b90600052602060002090600402016000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16905084565b60006002544210158015612ac75750600060029054906101000a900460ff16155b905090565b6000828211151515612ada57fe5b818303905092915050565b60008183019050828110151515612af857fe5b80905092915050565b600080831415612b145760009050612b33565b8183029050818382811515612b2557fe5b04141515612b2f57fe5b8090505b92915050565b60008183811515612b4657fe5b04905092915050565b82805482825590600052602060002090601f01602090048101928215612be45791602002820160005b83821115612bb557835183826101000a81548160ff0219169083151502179055509260200192600101602081600001049283019260010302612b78565b8015612be25782816101000a81549060ff0219169055600101602081600001049283019260010302612bb5565b505b509050612bf19190612bf5565b5090565b612c2291905b80821115612c1e57600081816101000a81549060ff021916905550600101612bfb565b5090565b905600a165627a7a72305820b725d6ed533ba3c21fcb343e8c393171f8c562c1668224983554c10c88ce87060029a165627a7a7230582038c1809b6ce57218a64a17a9211e1b79cca7e3c5a544e99070a9b555c6cb52430029", - "sourceMap": "52:860:1:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;52:860:1;;;;;;;", - "deployedSourceMap": "52:860:1:-;;;;;;;;;;;;;;;;;;;;;;;;159:751;;8:9:-1;5:2;;;30:1;27;20:12;5:2;159:751:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;462:7;481:28;539:15;568:13;595:17;626:13;653:17;684:30;728:29;512:255;;:::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;512:255:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;512:255:1;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;512:255:1;481:286;;782:37;798:20;782:37;;;;;;;;;;;;;;;;;;;;;;829:10;845:20;829:37;;39:1:-1;33:3;27:10;23:18;57:10;52:3;45:23;79:10;72:17;;0:93;829:37:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;883:20;876:27;;159:751;;;;;;;;;;:::o;52:860::-;;;;;;;;;;:::o", - "source": "pragma solidity ^0.4.24;\nimport \"./CrowdFund.sol\";\n\ncontract CrowdFundFactory {\n address[] crowdfunds;\n\n event ContractCreated(address newAddress);\n\n function createCrowdFund (\n uint raiseGoalAmount, \n address payOutAddress, \n address[] trusteesAddresses, \n uint[] allMilestones,\n uint durationInSeconds,\n uint milestoneVotingPeriodInSeconds,\n bool immediateFirstMilestonePayout\n ) public returns(address) {\n address newCrowdFundContract = new CrowdFund(\n raiseGoalAmount,\n payOutAddress,\n trusteesAddresses,\n allMilestones,\n durationInSeconds,\n milestoneVotingPeriodInSeconds,\n immediateFirstMilestonePayout\n );\n emit ContractCreated(newCrowdFundContract);\n crowdfunds.push(newCrowdFundContract);\n return newCrowdFundContract;\n }\n}", - "sourcePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFundFactory.sol", - "ast": { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFundFactory.sol", - "exportedSymbols": { - "CrowdFundFactory": [ - 1138 - ] - }, - "id": 1139, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1082, - "literals": [ - "solidity", - "^", - "0.4", - ".24" - ], - "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFund.sol", - "file": "./CrowdFund.sol", - "id": 1083, - "nodeType": "ImportDirective", - "scope": 1139, - "sourceUnit": 1081, - "src": "25:25:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [ - 1080 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1138, - "linearizedBaseContracts": [ - 1138 - ], - "name": "CrowdFundFactory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 1086, - "name": "crowdfunds", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "84:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1084, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "84:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1085, - "length": null, - "nodeType": "ArrayTypeName", - "src": "84:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 1090, - "name": "ContractCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1088, - "indexed": false, - "name": "newAddress", - "nodeType": "VariableDeclaration", - "scope": 1090, - "src": "133:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "133:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "132:20:1" - }, - "src": "111:42:1" - }, - { - "body": { - "id": 1136, - "nodeType": "Block", - "src": "471:439:1", - "statements": [ - { - "assignments": [ - 1112 - ], - "declarations": [ - { - "constant": false, - "id": 1112, - "name": "newCrowdFundContract", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "481:28:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1111, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "481:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1123, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1115, - "name": "raiseGoalAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1092, - "src": "539:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1116, - "name": "payOutAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "568:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1117, - "name": "trusteesAddresses", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1097, - "src": "595:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 1118, - "name": "allMilestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1100, - "src": "626:13:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "id": 1119, - "name": "durationInSeconds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1102, - "src": "653:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1120, - "name": "milestoneVotingPeriodInSeconds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1104, - "src": "684:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1121, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1106, - "src": "728:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 1114, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "512:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$_t_address_$_t_array$_t_address_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_bool_$returns$_t_contract$_CrowdFund_$1080_$", - "typeString": "function (uint256,address,address[] memory,uint256[] memory,uint256,uint256,bool) returns (contract CrowdFund)" - }, - "typeName": { - "contractScope": null, - "id": 1113, - "name": "CrowdFund", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1080, - "src": "516:9:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "512:255:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "481:286:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1125, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "798:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 1124, - "name": "ContractCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1090, - "src": "782:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "782:37:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1127, - "nodeType": "EmitStatement", - "src": "777:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1131, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "845:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1128, - "name": "crowdfunds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "829:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 1130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "829:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 1132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "829:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1133, - "nodeType": "ExpressionStatement", - "src": "829:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1134, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "883:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 1110, - "id": 1135, - "nodeType": "Return", - "src": "876:27:1" - } - ] - }, - "documentation": null, - "id": 1137, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [], - "name": "createCrowdFund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1107, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1092, - "name": "raiseGoalAmount", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "194:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1091, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "194:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1094, - "name": "payOutAddress", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "225:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1093, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "225:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1097, - "name": "trusteesAddresses", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "257:27:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1095, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "257:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1096, - "length": null, - "nodeType": "ArrayTypeName", - "src": "257:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1100, - "name": "allMilestones", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "295:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1098, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "295:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1099, - "length": null, - "nodeType": "ArrayTypeName", - "src": "295:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1102, - "name": "durationInSeconds", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "325:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1101, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "325:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1104, - "name": "milestoneVotingPeriodInSeconds", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "357:35:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1103, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "357:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1106, - "name": "immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "402:34:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1105, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "402:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "184:262:1" - }, - "payable": false, - "returnParameters": { - "id": 1110, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1109, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "462:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1108, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "462:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "461:9:1" - }, - "scope": 1138, - "src": "159:751:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 1139, - "src": "52:860:1" - } - ], - "src": "0:912:1" - }, - "legacyAST": { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFundFactory.sol", - "exportedSymbols": { - "CrowdFundFactory": [ - 1138 - ] - }, - "id": 1139, - "nodeType": "SourceUnit", - "nodes": [ - { - "id": 1082, - "literals": [ - "solidity", - "^", - "0.4", - ".24" - ], - "nodeType": "PragmaDirective", - "src": "0:24:1" - }, - { - "absolutePath": "/Users/danielternyak2/ActiveDevelopment/grant-monorepo/contract/contracts/CrowdFund.sol", - "file": "./CrowdFund.sol", - "id": 1083, - "nodeType": "ImportDirective", - "scope": 1139, - "sourceUnit": 1081, - "src": "25:25:1", - "symbolAliases": [], - "unitAlias": "" - }, - { - "baseContracts": [], - "contractDependencies": [ - 1080 - ], - "contractKind": "contract", - "documentation": null, - "fullyImplemented": true, - "id": 1138, - "linearizedBaseContracts": [ - 1138 - ], - "name": "CrowdFundFactory", - "nodeType": "ContractDefinition", - "nodes": [ - { - "constant": false, - "id": 1086, - "name": "crowdfunds", - "nodeType": "VariableDeclaration", - "scope": 1138, - "src": "84:20:1", - "stateVariable": true, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1084, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "84:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1085, - "length": null, - "nodeType": "ArrayTypeName", - "src": "84:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "anonymous": false, - "documentation": null, - "id": 1090, - "name": "ContractCreated", - "nodeType": "EventDefinition", - "parameters": { - "id": 1089, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1088, - "indexed": false, - "name": "newAddress", - "nodeType": "VariableDeclaration", - "scope": 1090, - "src": "133:18:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1087, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "133:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "132:20:1" - }, - "src": "111:42:1" - }, - { - "body": { - "id": 1136, - "nodeType": "Block", - "src": "471:439:1", - "statements": [ - { - "assignments": [ - 1112 - ], - "declarations": [ - { - "constant": false, - "id": 1112, - "name": "newCrowdFundContract", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "481:28:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1111, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "481:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "id": 1123, - "initialValue": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1115, - "name": "raiseGoalAmount", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1092, - "src": "539:15:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1116, - "name": "payOutAddress", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1094, - "src": "568:13:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - { - "argumentTypes": null, - "id": 1117, - "name": "trusteesAddresses", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1097, - "src": "595:17:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - } - }, - { - "argumentTypes": null, - "id": 1118, - "name": "allMilestones", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1100, - "src": "626:13:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - } - }, - { - "argumentTypes": null, - "id": 1119, - "name": "durationInSeconds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1102, - "src": "653:17:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1120, - "name": "milestoneVotingPeriodInSeconds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1104, - "src": "684:30:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - { - "argumentTypes": null, - "id": 1121, - "name": "immediateFirstMilestonePayout", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1106, - "src": "728:29:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_address", - "typeString": "address" - }, - { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[] memory" - }, - { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[] memory" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - ], - "id": 1114, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "nodeType": "NewExpression", - "src": "512:13:1", - "typeDescriptions": { - "typeIdentifier": "t_function_creation_nonpayable$_t_uint256_$_t_address_$_t_array$_t_address_$dyn_memory_ptr_$_t_array$_t_uint256_$dyn_memory_ptr_$_t_uint256_$_t_uint256_$_t_bool_$returns$_t_contract$_CrowdFund_$1080_$", - "typeString": "function (uint256,address,address[] memory,uint256[] memory,uint256,uint256,bool) returns (contract CrowdFund)" - }, - "typeName": { - "contractScope": null, - "id": 1113, - "name": "CrowdFund", - "nodeType": "UserDefinedTypeName", - "referencedDeclaration": 1080, - "src": "516:9:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - } - }, - "id": 1122, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "512:255:1", - "typeDescriptions": { - "typeIdentifier": "t_contract$_CrowdFund_$1080", - "typeString": "contract CrowdFund" - } - }, - "nodeType": "VariableDeclarationStatement", - "src": "481:286:1" - }, - { - "eventCall": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1125, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "798:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "id": 1124, - "name": "ContractCreated", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1090, - "src": "782:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", - "typeString": "function (address)" - } - }, - "id": 1126, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "782:37:1", - "typeDescriptions": { - "typeIdentifier": "t_tuple$__$", - "typeString": "tuple()" - } - }, - "id": 1127, - "nodeType": "EmitStatement", - "src": "777:42:1" - }, - { - "expression": { - "argumentTypes": null, - "arguments": [ - { - "argumentTypes": null, - "id": 1131, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "845:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - } - ], - "expression": { - "argumentTypes": [ - { - "typeIdentifier": "t_address", - "typeString": "address" - } - ], - "expression": { - "argumentTypes": null, - "id": 1128, - "name": "crowdfunds", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1086, - "src": "829:10:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage", - "typeString": "address[] storage ref" - } - }, - "id": 1130, - "isConstant": false, - "isLValue": false, - "isPure": false, - "lValueRequested": false, - "memberName": "push", - "nodeType": "MemberAccess", - "referencedDeclaration": null, - "src": "829:15:1", - "typeDescriptions": { - "typeIdentifier": "t_function_arraypush_nonpayable$_t_address_$returns$_t_uint256_$", - "typeString": "function (address) returns (uint256)" - } - }, - "id": 1132, - "isConstant": false, - "isLValue": false, - "isPure": false, - "kind": "functionCall", - "lValueRequested": false, - "names": [], - "nodeType": "FunctionCall", - "src": "829:37:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1133, - "nodeType": "ExpressionStatement", - "src": "829:37:1" - }, - { - "expression": { - "argumentTypes": null, - "id": 1134, - "name": "newCrowdFundContract", - "nodeType": "Identifier", - "overloadedDeclarations": [], - "referencedDeclaration": 1112, - "src": "883:20:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "functionReturnParameters": 1110, - "id": 1135, - "nodeType": "Return", - "src": "876:27:1" - } - ] - }, - "documentation": null, - "id": 1137, - "implemented": true, - "isConstructor": false, - "isDeclaredConst": false, - "modifiers": [], - "name": "createCrowdFund", - "nodeType": "FunctionDefinition", - "parameters": { - "id": 1107, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1092, - "name": "raiseGoalAmount", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "194:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1091, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "194:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1094, - "name": "payOutAddress", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "225:21:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1093, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "225:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1097, - "name": "trusteesAddresses", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "257:27:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_memory_ptr", - "typeString": "address[]" - }, - "typeName": { - "baseType": { - "id": 1095, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "257:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "id": 1096, - "length": null, - "nodeType": "ArrayTypeName", - "src": "257:9:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", - "typeString": "address[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1100, - "name": "allMilestones", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "295:20:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr", - "typeString": "uint256[]" - }, - "typeName": { - "baseType": { - "id": 1098, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "295:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "id": 1099, - "length": null, - "nodeType": "ArrayTypeName", - "src": "295:6:1", - "typeDescriptions": { - "typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr", - "typeString": "uint256[]" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1102, - "name": "durationInSeconds", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "325:22:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1101, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "325:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1104, - "name": "milestoneVotingPeriodInSeconds", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "357:35:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - }, - "typeName": { - "id": 1103, - "name": "uint", - "nodeType": "ElementaryTypeName", - "src": "357:4:1", - "typeDescriptions": { - "typeIdentifier": "t_uint256", - "typeString": "uint256" - } - }, - "value": null, - "visibility": "internal" - }, - { - "constant": false, - "id": 1106, - "name": "immediateFirstMilestonePayout", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "402:34:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - }, - "typeName": { - "id": 1105, - "name": "bool", - "nodeType": "ElementaryTypeName", - "src": "402:4:1", - "typeDescriptions": { - "typeIdentifier": "t_bool", - "typeString": "bool" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "184:262:1" - }, - "payable": false, - "returnParameters": { - "id": 1110, - "nodeType": "ParameterList", - "parameters": [ - { - "constant": false, - "id": 1109, - "name": "", - "nodeType": "VariableDeclaration", - "scope": 1137, - "src": "462:7:1", - "stateVariable": false, - "storageLocation": "default", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - }, - "typeName": { - "id": 1108, - "name": "address", - "nodeType": "ElementaryTypeName", - "src": "462:7:1", - "typeDescriptions": { - "typeIdentifier": "t_address", - "typeString": "address" - } - }, - "value": null, - "visibility": "internal" - } - ], - "src": "461:9:1" - }, - "scope": 1138, - "src": "159:751:1", - "stateMutability": "nonpayable", - "superFunction": null, - "visibility": "public" - } - ], - "scope": 1139, - "src": "52:860:1" - } - ], - "src": "0:912:1" - }, - "compiler": { - "name": "solc", - "version": "0.4.24+commit.e67f0147.Emscripten.clang" - }, - "networks": { - "3": { - "events": {}, - "links": {}, - "address": "0x2bfade54e1afc13d50bcb14b8134aafc0be59558", - "transactionHash": "0xf9aa2d035873d9ae6f3bf1d3a254ca774c22b2cd37c3d92ee41218fe3677e5f2" - }, - "1537836920395": { - "events": {}, - "links": {}, - "address": "0xf313d4b4f8c2467d6552c51392076ba90aa233b3", - "transactionHash": "0x6158097c6dcb93aeaad4b21ea540bf2a97d52050c04d36e54558df1aff60bbb8" - } - }, - "schemaVersion": "2.0.1", - "updatedAt": "2018-09-26T04:00:55.909Z" -} \ No newline at end of file diff --git a/frontend/.envexample b/frontend/.envexample index 47777cc6..9e4b4151 100644 --- a/frontend/.envexample +++ b/frontend/.envexample @@ -5,4 +5,7 @@ FUND_ETH_ADDRESSES=0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520,0xDECAF9CD2367cdbb NO_DEV_TS_CHECK=true # Set the public host url (no trailing slash) -PUBLIC_HOST_URL=https://demo.grant.io \ No newline at end of file +PUBLIC_HOST_URL=https://demo.grant.io + +CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" +CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" \ No newline at end of file diff --git a/frontend/.nvmrc b/frontend/.nvmrc index e4ecad26..85943544 100644 --- a/frontend/.nvmrc +++ b/frontend/.nvmrc @@ -1 +1 @@ -8.11.4 \ No newline at end of file +8.13.0 \ No newline at end of file diff --git a/frontend/Procfile b/frontend/Procfile new file mode 100644 index 00000000..709e0a25 --- /dev/null +++ b/frontend/Procfile @@ -0,0 +1 @@ +web: yarn start \ No newline at end of file diff --git a/frontend/client/api/api.ts b/frontend/client/api/api.ts index 79df6f12..952cd471 100644 --- a/frontend/client/api/api.ts +++ b/frontend/client/api/api.ts @@ -1,9 +1,9 @@ import axios from './axios'; import { Proposal, TeamMember, Update } from 'types'; import { + formatProposalFromGet, formatTeamMemberForPost, formatTeamMemberFromGet, - formatProposalFromGet, } from 'utils/api'; import { PROPOSAL_CATEGORY } from './constants'; @@ -91,6 +91,16 @@ export function verifyEmail(code: string): Promise { return axios.post(`/api/v1/email/${code}/verify`); } +export async function fetchCrowdFundFactoryJSON(): Promise { + const res = await axios.get(process.env.CROWD_FUND_FACTORY_URL as string); + return res.data; +} + +export async function fetchCrowdFundJSON(): Promise { + const res = await axios.get(process.env.CROWD_FUND_URL as string); + return res.data; +} + export function postProposalUpdate( proposalId: number, title: string, diff --git a/frontend/client/lib/crowdFundContracts.ts b/frontend/client/lib/crowdFundContracts.ts index 58b9bc52..679765a9 100644 --- a/frontend/client/lib/crowdFundContracts.ts +++ b/frontend/client/lib/crowdFundContracts.ts @@ -1,6 +1,6 @@ import Web3 from 'web3'; import getContractInstance from './getContract'; -import CrowdFund from 'lib/contracts/CrowdFund.json'; +import { fetchCrowdFundJSON } from 'api/api'; const contractCache = {} as { [key: string]: any }; @@ -9,6 +9,12 @@ export async function getCrowdFundContract(web3: Web3 | null, deployedAddress: s throw new Error('getCrowdFundAddress: web3 was null but is required!'); } if (!contractCache[deployedAddress]) { + let CrowdFund; + if (process.env.CROWD_FUND_FACTORY_URL) { + CrowdFund = await fetchCrowdFundJSON(); + } else { + CrowdFund = await import('./contracts/CrowdFund.json'); + } try { contractCache[deployedAddress] = await getContractInstance( web3, diff --git a/frontend/client/modules/web3/sagas.ts b/frontend/client/modules/web3/sagas.ts index 6c683b10..01bbea98 100644 --- a/frontend/client/modules/web3/sagas.ts +++ b/frontend/client/modules/web3/sagas.ts @@ -1,18 +1,22 @@ import { SagaIterator } from 'redux-saga'; -import { put, all, fork, take, takeLatest, select, call } from 'redux-saga/effects'; -import { setWeb3, setAccounts, setContract } from './actions'; +import { all, call, fork, put, select, take, takeLatest } from 'redux-saga/effects'; +import { setAccounts, setContract, setWeb3 } from './actions'; import { selectWeb3 } from './selectors'; import { safeEnable } from 'utils/web3'; import types from './types'; +import { fetchCrowdFundFactoryJSON } from 'api/api'; /* tslint:disable no-var-requires --- TODO: find a better way to import contract */ -const CrowdFundFactory = require('lib/contracts/CrowdFundFactory.json'); +let CrowdFundFactory = require('lib/contracts/CrowdFundFactory.json'); export function* bootstrapWeb3(): SagaIterator { // Don't attempt to bootstrap web3 on SSR if (process.env.SERVER_SIDE_RENDER) { return; } + if (process.env.CROWD_FUND_FACTORY_URL) { + CrowdFundFactory = yield call(fetchCrowdFundFactoryJSON); + } yield put(setWeb3()); yield take(types.WEB3_FULFILLED); diff --git a/frontend/config/env.js b/frontend/config/env.js index 85696cc8..08c611c2 100644 --- a/frontend/config/env.js +++ b/frontend/config/env.js @@ -26,14 +26,29 @@ dotenvFiles.forEach(dotenvFile => { } }); -if (!process.env.PUBLIC_HOST_URL) { - if (process.env.NODE_ENV === 'production') { - throw new Error( - 'The process.env.PUBLIC_HOST_URL environment variable is required but was not specified.', - ); +const envProductionRequiredHandler = (envVariable, fallbackValue) => { + if (!process.env[envVariable]) { + if (process.env.NODE_ENV === 'production') { + throw new Error( + `The process.env.${envVariable} environment variable is required but was not specified.`, + ); + } + process.env[envVariable] = fallbackValue; } - process.env.PUBLIC_HOST_URL = 'http://localhost:' + (process.env.PORT || 3000); -} +}; + +envProductionRequiredHandler( + 'PUBLIC_HOST_URL', + 'http://localhost:' + (process.env.PORT || 3000), +); +envProductionRequiredHandler( + 'CROWD_FUND_URL', + 'https://eip-712.herokuapp.com/contract/crowd-fund', +); +envProductionRequiredHandler( + 'CROWD_FUND_FACTORY_URL', + 'https://eip-712.herokuapp.com/contract/factory', +); const appDirectory = fs.realpathSync(process.cwd()); process.env.NODE_PATH = (process.env.NODE_PATH || '') diff --git a/frontend/package.json b/frontend/package.json index 5322e8ee..9ef3cc1f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "grant", - "version": "1.0.1", + "version": "1.0.2", "main": "index.js", "license": "MIT", "scripts": { @@ -10,12 +10,16 @@ "lint": "tslint --project ./tsconfig.json --config ./tslint.json -e \"**/build/**\"", "start": "NODE_ENV=production node ./build/server/server.js", "now": "npm run build && now -e BACKEND_URL=https://grant-stage.herokuapp.com", + "heroku-postbuild": "yarn build", "tsc": "tsc", "link-contracts": "cd client/lib && ln -s ../../build/contracts contracts", "ganache": "ganache-cli -b 5", "truffle": "truffle exec ./bin/init-truffle.js && cd client/lib/contracts && truffle console", "storybook": "start-storybook -p 9001 -c .storybook" }, + "engines": { + "node": "8.13.0" + }, "husky": { "hooks": { "pre-commit": "lint-staged", From a95a8ff080b3bcd41c0e7700be33e888bdc03f4f Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 21 Nov 2018 21:17:49 -0600 Subject: [PATCH 12/17] Server-side API calling/preloading. (#224) * make sure BACKEND_URL gets set for server in production mode * ssr api calls by path * turn off redux logger on server * massage preloaded state (BNify JSONed BNs) * make sure fetchProposal returns async/promise * make sure render works on ssr (check window refs) * linting issue --- frontend/client/components/Proposal/index.tsx | 10 ++-- frontend/client/index.tsx | 4 +- frontend/client/modules/proposals/actions.ts | 4 +- frontend/client/store/configure.tsx | 2 +- frontend/client/utils/api.ts | 48 +++++++++++++++---- frontend/config/env.js | 8 +++- frontend/server/index.tsx | 4 +- frontend/server/render.tsx | 2 + frontend/server/ssrAsync.ts | 46 ++++++++++++++++++ 9 files changed, 107 insertions(+), 21 deletions(-) create mode 100644 frontend/server/ssrAsync.ts diff --git a/frontend/client/components/Proposal/index.tsx b/frontend/client/components/Proposal/index.tsx index 283e3823..f038a0a8 100644 --- a/frontend/client/components/Proposal/index.tsx +++ b/frontend/client/components/Proposal/index.tsx @@ -63,11 +63,15 @@ export class ProposalDetail extends React.Component { } else { this.checkBodyOverflow(); } - window.addEventListener('resize', this.checkBodyOverflow); + if (typeof window !== 'undefined') { + window.addEventListener('resize', this.checkBodyOverflow); + } } componentWillUnmount() { - window.removeEventListener('resize', this.checkBodyOverflow); + if (typeof window !== 'undefined') { + window.removeEventListener('resize', this.checkBodyOverflow); + } } componentDidUpdate() { @@ -121,7 +125,7 @@ export class ProposalDetail extends React.Component {
) => { - dispatch({ + return async (dispatch: Dispatch) => { + return dispatch({ type: types.PROPOSAL_DATA, payload: async () => { return (await getProposal(proposalId)).data; diff --git a/frontend/client/store/configure.tsx b/frontend/client/store/configure.tsx index 13daf97e..b55eab71 100644 --- a/frontend/client/store/configure.tsx +++ b/frontend/client/store/configure.tsx @@ -13,7 +13,7 @@ const sagaMiddleware = createSagaMiddleware(); type MiddleWare = ThunkMiddleware | SagaMiddleware | any; const bindMiddleware = (middleware: MiddleWare[]) => { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') { const { createLogger } = require('redux-logger'); const logger = createLogger({ collapsed: true, diff --git a/frontend/client/utils/api.ts b/frontend/client/utils/api.ts index 72af1486..e4f36279 100644 --- a/frontend/client/utils/api.ts +++ b/frontend/client/utils/api.ts @@ -1,6 +1,7 @@ import BN from 'bn.js'; -import { TeamMember, CrowdFund, ProposalWithCrowdFund } from 'types'; +import { TeamMember, CrowdFund, ProposalWithCrowdFund, UserProposal } from 'types'; import { socialAccountsToUrls, socialUrlsToAccounts } from 'utils/social'; +import { AppState } from 'store/reducers'; export function formatTeamMemberForPost(user: TeamMember) { return { @@ -28,35 +29,35 @@ export function formatTeamMemberFromGet(user: any): TeamMember { }; } -export function formatCrowdFundFromGet(crowdFund: CrowdFund): CrowdFund { +export function formatCrowdFundFromGet(crowdFund: CrowdFund, base = 10): CrowdFund { const bnKeys = ['amountVotingForRefund', 'balance', 'funded', 'target'] as Array< keyof CrowdFund >; bnKeys.forEach(k => { - crowdFund[k] = new BN(crowdFund[k] as string); + crowdFund[k] = new BN(crowdFund[k] as string, base); }); crowdFund.milestones = crowdFund.milestones.map(ms => { - ms.amount = new BN(ms.amount); - ms.amountAgainstPayout = new BN(ms.amountAgainstPayout); + ms.amount = new BN(ms.amount, base); + ms.amountAgainstPayout = new BN(ms.amountAgainstPayout, base); return ms; }); crowdFund.contributors = crowdFund.contributors.map(c => { - c.contributionAmount = new BN(c.contributionAmount); + c.contributionAmount = new BN(c.contributionAmount, base); return c; }); return crowdFund; } export function formatProposalFromGet(proposal: ProposalWithCrowdFund) { + proposal.team = proposal.team.map(formatTeamMemberFromGet); + proposal.proposalUrlId = generateProposalUrl(proposal.proposalId, proposal.title); + proposal.crowdFund = formatCrowdFundFromGet(proposal.crowdFund); for (let i = 0; i < proposal.crowdFund.milestones.length; i++) { proposal.milestones[i] = { ...proposal.milestones[i], ...proposal.crowdFund.milestones[i], }; } - proposal.team = proposal.team.map(formatTeamMemberFromGet); - proposal.proposalUrlId = generateProposalUrl(proposal.proposalId, proposal.title); - proposal.crowdFund = formatCrowdFundFromGet(proposal.crowdFund); return proposal; } @@ -79,3 +80,32 @@ export function extractProposalIdFromUrl(slug: string) { } return proposalId; } + +// pre-hydration massage (BNify JSONed BNs) +export function massageSerializedState(state: AppState) { + // proposals + state.proposal.proposals.forEach(p => { + formatCrowdFundFromGet(p.crowdFund, 16); + for (let i = 0; i < p.crowdFund.milestones.length; i++) { + p.milestones[i] = { + ...p.milestones[i], + ...p.crowdFund.milestones[i], + }; + } + }); + // users + const bnUserProp = (p: UserProposal) => { + p.funded = new BN(p.funded, 16); + p.target = new BN(p.target, 16); + return p; + }; + Object.values(state.users.map).forEach(user => { + user.createdProposals.forEach(bnUserProp); + user.fundedProposals.forEach(bnUserProp); + user.comments.forEach(c => { + c.proposal = bnUserProp(c.proposal); + }); + }); + + return state; +} diff --git a/frontend/config/env.js b/frontend/config/env.js index 08c611c2..be0d9e43 100644 --- a/frontend/config/env.js +++ b/frontend/config/env.js @@ -50,6 +50,10 @@ envProductionRequiredHandler( 'https://eip-712.herokuapp.com/contract/factory', ); +if (!process.env.BACKEND_URL) { + process.env.BACKEND_URL = 'http://localhost:5000'; +} + const appDirectory = fs.realpathSync(process.cwd()); process.env.NODE_PATH = (process.env.NODE_PATH || '') .split(path.delimiter) @@ -59,9 +63,9 @@ process.env.NODE_PATH = (process.env.NODE_PATH || '') module.exports = () => { const raw = { - PORT: process.env.PORT || 3000, + BACKEND_URL: process.env.BACKEND_URL, NODE_ENV: process.env.NODE_ENV || 'development', - BACKEND_URL: process.env.BACKEND_URL || 'http://localhost:5000', + PORT: process.env.PORT || 3000, PUBLIC_HOST_URL: process.env.PUBLIC_HOST_URL, }; diff --git a/frontend/server/index.tsx b/frontend/server/index.tsx index 2b9d033f..7e6e4e4d 100644 --- a/frontend/server/index.tsx +++ b/frontend/server/index.tsx @@ -4,10 +4,10 @@ import * as path from 'path'; import chalk from 'chalk'; import manifestHelpers from 'express-manifest-helpers'; import * as bodyParser from 'body-parser'; -import dotenv from 'dotenv'; import expressWinston from 'express-winston'; import i18nMiddleware from 'i18next-express-middleware'; +import '../config/env'; // @ts-ignore import * as paths from '../config/paths'; import log from './log'; @@ -17,8 +17,6 @@ import i18n from './i18n'; process.env.SERVER_SIDE_RENDER = 'true'; const isDev = process.env.NODE_ENV === 'development'; -dotenv.config(); - const app = express(); // log requests diff --git a/frontend/server/render.tsx b/frontend/server/render.tsx index 66c99c2a..2d240fa6 100644 --- a/frontend/server/render.tsx +++ b/frontend/server/render.tsx @@ -18,6 +18,7 @@ import i18n from './i18n'; // @ts-ignore import * as paths from '../config/paths'; +import { storeActionsForPath } from './ssrAsync'; const isDev = process.env.NODE_ENV === 'development'; let cachedStats: any; @@ -78,6 +79,7 @@ const chunkExtractFromLoadables = (loadableState: any) => const serverRenderer = () => async (req: Request, res: Response) => { const { store } = configureStore(); + await storeActionsForPath(req.url, store); // i18n const locale = (req as any).language; diff --git a/frontend/server/ssrAsync.ts b/frontend/server/ssrAsync.ts new file mode 100644 index 00000000..270bdc96 --- /dev/null +++ b/frontend/server/ssrAsync.ts @@ -0,0 +1,46 @@ +import { Store } from 'redux'; +import { fetchProposal } from 'modules/proposals/actions'; +import { + fetchUser, + fetchUserCreated, + fetchUserFunded, + fetchUserComments, +} from 'modules/users/actions'; +import { extractProposalIdFromUrl } from 'utils/api'; + +const pathActions = [ + { + matcher: /^\/proposals\/(.+)$/, + action: (match: RegExpMatchArray, store: Store) => { + const proposalId = extractProposalIdFromUrl(match[1]); + if (proposalId) { + return store.dispatch(fetchProposal(proposalId)); + } + }, + }, + { + matcher: /^\/profile\/(.+)$/, + action: (match: RegExpMatchArray, store: Store) => { + const userId = match[1]; + if (userId) { + return Promise.all([ + store.dispatch(fetchUser(userId)), + store.dispatch(fetchUserCreated(userId)), + store.dispatch(fetchUserFunded(userId)), + store.dispatch(fetchUserComments(userId)), + ]); + } + }, + }, +]; + +export function storeActionsForPath(path: string, store: Store) { + const pathAction = pathActions.find(pa => !!path.match(pa.matcher)); + if (pathAction) { + const matches = path.match(pathAction.matcher); + if (matches) { + return pathAction.action(matches, store); + } + } + return Promise.resolve(); +} From d367e6e474727de66f3caedb556813320b94d317 Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 21 Nov 2018 21:18:22 -0600 Subject: [PATCH 13/17] Track proposal contributions (#219) * BE proposal contribution tracking * FE proposal contribution tracking * validate contributions * make sure we catch errors in the 'confirmation' listener * remove console.log * lowercase from address compare * remove validate_contribution_tx from post_proposal_contribution --- backend/grant/proposal/models.py | 57 ++++++++++ backend/grant/proposal/views.py | 62 ++++++++++- backend/grant/web3/proposal.py | 11 ++ backend/migrations/versions/1d06a5e43324_.py | 38 +++++++ backend/tests/proposal/test_api.py | 108 +++++++++++++++++++ frontend/client/api/api.ts | 15 ++- frontend/client/modules/proposals/actions.ts | 15 +++ frontend/client/modules/proposals/types.ts | 6 +- frontend/client/modules/web3/actions.ts | 45 +++++--- frontend/types/contribution.ts | 9 ++ frontend/types/index.ts | 1 + 11 files changed, 349 insertions(+), 18 deletions(-) create mode 100644 backend/migrations/versions/1d06a5e43324_.py create mode 100644 frontend/types/contribution.ts diff --git a/backend/grant/proposal/models.py b/backend/grant/proposal/models.py index b523f7e1..af453edd 100644 --- a/backend/grant/proposal/models.py +++ b/backend/grant/proposal/models.py @@ -45,6 +45,33 @@ class ProposalUpdate(db.Model): self.date_created = datetime.datetime.now() +class ProposalContribution(db.Model): + __tablename__ = "proposal_contribution" + + tx_id = db.Column(db.String(255), primary_key=True) + date_created = db.Column(db.DateTime, nullable=False) + + proposal_id = db.Column(db.Integer, db.ForeignKey("proposal.id"), nullable=False) + user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=True) + from_address = db.Column(db.String(255), nullable=False) + amount = db.Column(db.String(255), nullable=False) # in eth + + def __init__( + self, + tx_id: str, + proposal_id: int, + user_id: int, + from_address: str, + amount: str + ): + self.tx_id = tx_id + self.proposal_id = proposal_id + self.user_id = user_id + self.from_address = from_address + self.amount = amount + self.date_created = datetime.datetime.now() + + class Proposal(db.Model): __tablename__ = "proposal" @@ -60,6 +87,7 @@ class Proposal(db.Model): team = db.relationship("User", secondary=proposal_team) comments = db.relationship(Comment, backref="proposal", lazy=True) updates = db.relationship(ProposalUpdate, backref="proposal", lazy=True) + contributions = db.relationship(ProposalContribution, backref="proposal", lazy=True) milestones = db.relationship("Milestone", backref="proposal", lazy=True) def __init__( @@ -110,6 +138,7 @@ class ProposalSchema(ma.Schema): "body", "comments", "updates", + "contributions", "milestones", "category", "team" @@ -121,6 +150,7 @@ class ProposalSchema(ma.Schema): comments = ma.Nested("CommentSchema", many=True) updates = ma.Nested("ProposalUpdateSchema", many=True) + contributions = ma.Nested("ProposalContributionSchema", many=True) team = ma.Nested("UserSchema", many=True) milestones = ma.Nested("MilestoneSchema", many=True) @@ -166,3 +196,30 @@ class ProposalUpdateSchema(ma.Schema): proposal_update_schema = ProposalUpdateSchema() proposals_update_schema = ProposalUpdateSchema(many=True) + + +class ProposalContributionSchema(ma.Schema): + class Meta: + model = ProposalContribution + # Fields to expose + fields = ( + "id", + "tx_id", + "proposal_id", + "user_id", + "from_address", + "amount", + "date_created", + ) + id = ma.Method("get_id") + date_created = ma.Method("get_date_created") + + def get_id(self, obj): + return obj.tx_id + + def get_date_created(self, obj): + return dt_to_unix(obj.date_created) + + +proposal_contribution_schema = ProposalContributionSchema() +proposals_contribution_schema = ProposalContributionSchema(many=True) diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index bafc9caa..3d2e0e39 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -8,8 +8,17 @@ from grant.comment.models import Comment, comment_schema from grant.milestone.models import Milestone from grant.user.models import User, SocialMedia, Avatar from grant.utils.auth import requires_sm, requires_team_member_auth -from grant.web3.proposal import read_proposal -from .models import Proposal, proposals_schema, proposal_schema, ProposalUpdate, proposal_update_schema, db +from grant.web3.proposal import read_proposal, validate_contribution_tx +from .models import( + Proposal, + proposals_schema, + proposal_schema, + ProposalUpdate, + proposal_update_schema, + ProposalContribution, + proposal_contribution_schema, + db +) blueprint = Blueprint("proposal", __name__, url_prefix="/api/v1/proposals") @@ -209,3 +218,52 @@ def post_proposal_update(proposal_id, title, content): dumped_update = proposal_update_schema.dump(update) return dumped_update, 201 + + +@blueprint.route("//contributions", methods=["GET"]) +@endpoint.api() +def get_proposal_contributions(proposal_id): + proposal = Proposal.query.filter_by(id=proposal_id).first() + if proposal: + dumped_proposal = proposal_schema.dump(proposal) + return dumped_proposal["contributions"] + else: + return {"message": "No proposal matching id"}, 404 + + +@blueprint.route("//contributions/", methods=["GET"]) +@endpoint.api() +def get_proposal_contribution(proposal_id, contribution_id): + proposal = Proposal.query.filter_by(id=proposal_id).first() + if proposal: + contribution = ProposalContribution.query.filter_by(tx_id=contribution_id).first() + if contribution: + return proposal_contribution_schema.dump(contribution) + else: + return {"message": "No contribution matching id"} + else: + return {"message": "No proposal matching id"}, 404 + + +@blueprint.route("//contributions", methods=["POST"]) +@requires_sm +@endpoint.api( + parameter('txId', type=str, required=True), + parameter('fromAddress', type=str, required=True), + parameter('amount', type=str, required=True) +) +def post_proposal_contribution(proposal_id, tx_id, from_address, amount): + proposal = Proposal.query.filter_by(id=proposal_id).first() + if proposal: + contribution = ProposalContribution( + tx_id=tx_id, + proposal_id=proposal_id, + user_id=g.current_user.id, + from_address=from_address, + amount=amount + ) + db.session.add(contribution) + db.session.commit() + dumped_contribution = proposal_contribution_schema.dump(contribution) + return dumped_contribution, 201 + return {"message": "No proposal matching id"}, 404 diff --git a/backend/grant/web3/proposal.py b/backend/grant/web3/proposal.py index 7eb105a0..b67c36cc 100644 --- a/backend/grant/web3/proposal.py +++ b/backend/grant/web3/proposal.py @@ -136,3 +136,14 @@ def read_proposal(address): crowd_fund[k] = str(crowd_fund[k]) return crowd_fund + + +def validate_contribution_tx(tx_id, from_address, to_address, amount): + amount_wei = current_web3.toWei(amount, 'ether') + tx = current_web3.eth.getTransaction(tx_id) + if tx: + if from_address.lower() == tx.get("from").lower() and \ + to_address == tx.get("to") and \ + amount_wei == tx.get("value"): + return True + return False diff --git a/backend/migrations/versions/1d06a5e43324_.py b/backend/migrations/versions/1d06a5e43324_.py new file mode 100644 index 00000000..e72d493a --- /dev/null +++ b/backend/migrations/versions/1d06a5e43324_.py @@ -0,0 +1,38 @@ +"""empty message + +Revision ID: 1d06a5e43324 +Revises: 312db8611967 +Create Date: 2018-11-17 11:07:40.413141 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '1d06a5e43324' +down_revision = '312db8611967' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.create_table('proposal_contribution', + sa.Column('tx_id', sa.String(length=255), nullable=False), + sa.Column('date_created', sa.DateTime(), nullable=False), + sa.Column('proposal_id', sa.Integer(), nullable=False), + sa.Column('user_id', sa.Integer(), nullable=True), + sa.Column('from_address', sa.String(length=255), nullable=False), + sa.Column('amount', sa.String(length=255), nullable=False), + sa.ForeignKeyConstraint(['proposal_id'], ['proposal.id'], ), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('tx_id') + ) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('proposal_contribution') + # ### end Alembic commands ### diff --git a/backend/tests/proposal/test_api.py b/backend/tests/proposal/test_api.py index 9c219222..efd7a02c 100644 --- a/backend/tests/proposal/test_api.py +++ b/backend/tests/proposal/test_api.py @@ -1,4 +1,5 @@ import json +from mock import patch from grant.proposal.models import Proposal from grant.user.models import SocialMedia, Avatar @@ -71,3 +72,110 @@ class TestAPI(BaseUserConfig): ) self.assertEqual(proposal_res2.status_code, 409) + + @patch('grant.proposal.views.validate_contribution_tx', return_value=True) + def test_create_proposal_contribution(self, mock_validate_contribution_tx): + proposal_res = self.app.post( + "/api/v1/proposals/", + data=json.dumps(test_proposal), + headers=self.headers, + content_type='application/json' + ) + proposal_json = proposal_res.json + proposal_id = proposal_json["proposalId"] + + contribution = { + "txId": "0x12345", + "fromAddress": "0x23456", + "amount": "1.2345" + } + + contribution_res = self.app.post( + "/api/v1/proposals/{}/contributions".format(proposal_id), + data=json.dumps(contribution), + headers=self.headers, + content_type='application/json' + ) + res = contribution_res.json + exp = contribution + + def eq(k): + self.assertEqual(exp[k], res[k]) + eq("txId") + eq("fromAddress") + eq("amount") + self.assertEqual(proposal_id, res["proposalId"]) + + @patch('grant.proposal.views.validate_contribution_tx', return_value=True) + def test_get_proposal_contribution(self, mock_validate_contribution_tx): + proposal_res = self.app.post( + "/api/v1/proposals/", + data=json.dumps(test_proposal), + headers=self.headers, + content_type='application/json' + ) + proposal_json = proposal_res.json + proposal_id = proposal_json["proposalId"] + + contribution = { + "txId": "0x12345", + "fromAddress": "0x23456", + "amount": "1.2345" + } + + self.app.post( + "/api/v1/proposals/{}/contributions".format(proposal_id), + data=json.dumps(contribution), + headers=self.headers, + content_type='application/json' + ) + + contribution_res = self.app.get( + "/api/v1/proposals/{0}/contributions/{1}".format(proposal_id, contribution["txId"]) + ) + res = contribution_res.json + exp = contribution + + def eq(k): + self.assertEqual(exp[k], res[k]) + eq("txId") + eq("fromAddress") + eq("amount") + self.assertEqual(proposal_id, res["proposalId"]) + + @patch('grant.proposal.views.validate_contribution_tx', return_value=True) + def test_get_proposal_contributions(self, mock_validate_contribution_tx): + proposal_res = self.app.post( + "/api/v1/proposals/", + data=json.dumps(test_proposal), + headers=self.headers, + content_type='application/json' + ) + proposal_json = proposal_res.json + proposal_id = proposal_json["proposalId"] + + contribution = { + "txId": "0x12345", + "fromAddress": "0x23456", + "amount": "1.2345" + } + + self.app.post( + "/api/v1/proposals/{}/contributions".format(proposal_id), + data=json.dumps(contribution), + headers=self.headers, + content_type='application/json' + ) + + contributions_res = self.app.get( + "/api/v1/proposals/{0}/contributions".format(proposal_id) + ) + res = contributions_res.json[0] + exp = contribution + + def eq(k): + self.assertEqual(exp[k], res[k]) + eq("txId") + eq("fromAddress") + eq("amount") + self.assertEqual(proposal_id, res["proposalId"]) diff --git a/frontend/client/api/api.ts b/frontend/client/api/api.ts index 952cd471..c35a8b0f 100644 --- a/frontend/client/api/api.ts +++ b/frontend/client/api/api.ts @@ -1,5 +1,5 @@ import axios from './axios'; -import { Proposal, TeamMember, Update } from 'types'; +import { Proposal, TeamMember, Update, Contribution } from 'types'; import { formatProposalFromGet, formatTeamMemberForPost, @@ -111,3 +111,16 @@ export function postProposalUpdate( content, }); } + +export function postProposalContribution( + proposalId: number, + txId: string, + fromAddress: string, + amount: string, +): Promise<{ data: Contribution }> { + return axios.post(`/api/v1/proposals/${proposalId}/contributions`, { + txId, + fromAddress, + amount, + }); +} diff --git a/frontend/client/modules/proposals/actions.ts b/frontend/client/modules/proposals/actions.ts index bb4a4a30..d7f6ea58 100644 --- a/frontend/client/modules/proposals/actions.ts +++ b/frontend/client/modules/proposals/actions.ts @@ -4,6 +4,7 @@ import { getProposal, getProposalComments, getProposalUpdates, + postProposalContribution as apiPostProposalContribution, } from 'api/api'; import { Dispatch } from 'redux'; import { ProposalWithCrowdFund, Comment } from 'types'; @@ -108,3 +109,17 @@ export function postProposalComment( } }; } + +export function postProposalContribution( + proposalId: number, + txId: string, + account: string, + amount: string, +) { + return async (dispatch: Dispatch) => { + await dispatch({ + type: types.POST_PROPOSAL_CONTRIBUTION, + payload: apiPostProposalContribution(proposalId, txId, account, amount), + }); + }; +} diff --git a/frontend/client/modules/proposals/types.ts b/frontend/client/modules/proposals/types.ts index a8ca8af3..d5d25f61 100644 --- a/frontend/client/modules/proposals/types.ts +++ b/frontend/client/modules/proposals/types.ts @@ -1,4 +1,4 @@ -enum clockTypes { +enum proposalTypes { PROPOSALS_DATA = 'PROPOSALS_DATA', PROPOSALS_DATA_FULFILLED = 'PROPOSALS_DATA_FULFILLED', PROPOSALS_DATA_REJECTED = 'PROPOSALS_DATA_REJECTED', @@ -23,6 +23,8 @@ enum clockTypes { POST_PROPOSAL_COMMENT_FULFILLED = 'POST_PROPOSAL_COMMENT_FULFILLED', POST_PROPOSAL_COMMENT_REJECTED = 'POST_PROPOSAL_COMMENT_REJECTED', POST_PROPOSAL_COMMENT_PENDING = 'POST_PROPOSAL_COMMENT_PENDING', + + POST_PROPOSAL_CONTRIBUTION = 'POST_PROPOSAL_CONTRIBUTION', } -export default clockTypes; +export default proposalTypes; diff --git a/frontend/client/modules/web3/actions.ts b/frontend/client/modules/web3/actions.ts index cb1d7257..e411ee13 100644 --- a/frontend/client/modules/web3/actions.ts +++ b/frontend/client/modules/web3/actions.ts @@ -5,7 +5,11 @@ import { postProposal } from 'api/api'; import getContract, { WrongNetworkError } from 'lib/getContract'; import { sleep } from 'utils/helpers'; import { web3ErrorToString } from 'utils/web3'; -import { fetchProposal, fetchProposals } from 'modules/proposals/actions'; +import { + fetchProposal, + fetchProposals, + postProposalContribution, +} from 'modules/proposals/actions'; import { PROPOSAL_CATEGORY } from 'api/constants'; import { AppState } from 'store/reducers'; import { Wei } from 'utils/units'; @@ -278,6 +282,14 @@ export function fundCrowdFund(proposal: ProposalWithCrowdFund, value: number | s const { proposalAddress, proposalId } = proposal; const crowdFundContract = await getCrowdFundContract(web3, proposalAddress); + const handleErr = (err: Error) => { + dispatch({ + type: types.SEND_REJECTED, + payload: err.message || err.toString(), + error: true, + }); + }; + try { if (!web3) { throw new Error('No web3 instance available'); @@ -285,20 +297,27 @@ export function fundCrowdFund(proposal: ProposalWithCrowdFund, value: number | s await crowdFundContract.methods .contribute() .send({ from: account, value: web3.utils.toWei(String(value), 'ether') }) - .once('confirmation', async () => { - await sleep(5000); - await dispatch(fetchProposal(proposalId)); - dispatch({ - type: types.SEND_FULFILLED, - }); + .once('confirmation', async (_: number, receipt: any) => { + try { + await sleep(5000); + await dispatch( + postProposalContribution( + proposalId, + receipt.transactionHash, + account, + String(value), + ), + ); + await dispatch(fetchProposal(proposalId)); + dispatch({ + type: types.SEND_FULFILLED, + }); + } catch (err) { + handleErr(err); + } }); } catch (err) { - console.log(err); - dispatch({ - type: types.SEND_REJECTED, - payload: err.message || err.toString(), - error: true, - }); + handleErr(err); } }; } diff --git a/frontend/types/contribution.ts b/frontend/types/contribution.ts new file mode 100644 index 00000000..2b5c8e8b --- /dev/null +++ b/frontend/types/contribution.ts @@ -0,0 +1,9 @@ +export interface Contribution { + id: string; + txId: string; + proposalId: number; + userId: number; + fromAddress: string; + amount: string; + dateCreated: number; +} diff --git a/frontend/types/index.ts b/frontend/types/index.ts index 2ccc8fa8..cb9ea4ed 100644 --- a/frontend/types/index.ts +++ b/frontend/types/index.ts @@ -2,6 +2,7 @@ export * from './user'; export * from './social'; export * from './create'; export * from './comment'; +export * from './contribution'; export * from './milestone'; export * from './update'; export * from './proposal'; From 968974d8d7b20d7c9d3b49bde57e6d9a18850117 Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 21 Nov 2018 21:20:09 -0600 Subject: [PATCH 14/17] E2E - Web3 interaction & more tests (#202) * account switching & setting gas for e2e web3 * e2e web3 interaction + new specs * refund after payout spec * use send instead of sendAsync + update ganache script cmd * sign intercept + deterministic accounts * add authentication to creation tests * adjust cy.request call * refactor + WIP fiddle with xhr * xhook to modify incoming api requests --- e2e/cypress.json | 4 +- e2e/cypress/helpers.ts | 232 +++++++++++++++++- e2e/cypress/integration/authenticate.spec.ts | 14 ++ e2e/cypress/integration/browse.spec.ts | 4 +- e2e/cypress/integration/create.cancel.spec.ts | 47 ++++ e2e/cypress/integration/create.flow.spec.ts | 173 +++++++++++++ .../integration/create.fund.cancel.spec.ts | 61 +++++ ...te.fund.complete.minority-no-votes.spec.ts | 126 ++++++++++ .../integration/create.fund.complete.spec.ts | 103 ++++++++ .../create.fund.ms2.majority-no-vote.spec.ts | 60 +++++ .../create.fund.ms2.no-vote.re-vote.spec.ts | 87 +++++++ ...reate.fund.ms2.refund-after-payout.spec.ts | 69 ++++++ .../create.fund.ms2.revert-no-vote.spec.ts | 93 +++++++ e2e/cypress/integration/create.spec.ts | 192 --------------- e2e/cypress/integration/sandbox.ts | 15 ++ e2e/cypress/parts.ts | 107 ++++++++ e2e/cypress/typings.d.ts | 4 + e2e/package.json | 1 + e2e/yarn.lock | 115 ++++++++- frontend/client/lib/getContract.ts | 8 +- frontend/client/modules/web3/actions.ts | 2 +- frontend/package.json | 2 +- 22 files changed, 1310 insertions(+), 209 deletions(-) create mode 100644 e2e/cypress/integration/authenticate.spec.ts create mode 100644 e2e/cypress/integration/create.cancel.spec.ts create mode 100644 e2e/cypress/integration/create.flow.spec.ts create mode 100644 e2e/cypress/integration/create.fund.cancel.spec.ts create mode 100644 e2e/cypress/integration/create.fund.complete.minority-no-votes.spec.ts create mode 100644 e2e/cypress/integration/create.fund.complete.spec.ts create mode 100644 e2e/cypress/integration/create.fund.ms2.majority-no-vote.spec.ts create mode 100644 e2e/cypress/integration/create.fund.ms2.no-vote.re-vote.spec.ts create mode 100644 e2e/cypress/integration/create.fund.ms2.refund-after-payout.spec.ts create mode 100644 e2e/cypress/integration/create.fund.ms2.revert-no-vote.spec.ts delete mode 100644 e2e/cypress/integration/create.spec.ts create mode 100644 e2e/cypress/integration/sandbox.ts create mode 100644 e2e/cypress/parts.ts diff --git a/e2e/cypress.json b/e2e/cypress.json index 0967ef42..17ef242e 100644 --- a/e2e/cypress.json +++ b/e2e/cypress.json @@ -1 +1,3 @@ -{} +{ + "baseUrl": "http://localhost:3000" +} diff --git a/e2e/cypress/helpers.ts b/e2e/cypress/helpers.ts index 587b2932..607aa11a 100644 --- a/e2e/cypress/helpers.ts +++ b/e2e/cypress/helpers.ts @@ -1,13 +1,227 @@ import Web3 = require("web3"); import * as CrowdFundFactory from "../../contract/build/contracts/CrowdFundFactory.json"; +import { WebsocketProvider } from "web3/providers"; +import * as sigUtil from "eth-sig-util"; -export const loadWeb3 = (window: any) => { - window.web3 = new Web3(`ws://localhost:8545`); - return window.web3.eth.net.getId().then((id: string) => { - console.log("loadWeb3: connected to networkId: " + id); +const WEB3_PROVIDER = `ws://localhost:8545`; + +// accounts generated using `ganache -s testGrantIo` +export const testAccounts = [ + [ + "0x0a4ab0753416ce1bebef3855fd081c170ae0194f", + "872017489e13bc3d7fec343d14691ac3c95a7904651113ce018a6ee21ae70a6e" + ], + [ + "0x926604d5a2383eae9d88eb4e884b1a34b3546194", + "492e6984a9faa04e5aad31219db4db9c927ed011b2b56b3068b1ff2b34e43f00" + ], + [ + "0xf277b4a0b9c89c07cc331b38d87a5a382501ed1a", + "c6aba74cc839af98def2819a85949847f80af42d11fefab4ecb713752261099a" + ], + [ + "0x6e6324d0927fb0aee2cbb1c915bcdc47c4f45a37", + "c66b30565895ef84c9e1cda943d828f9a91e6a0c0624caae76a661e35c2dc722" + ], + [ + "0xa696d8f7cfd0136c971492d0e9312c139cb18173", + "5f33d8df218aaf0b2bfa640d04f69aa234a1997fa08b4db606e6b022aa18cc8c" + ], + [ + "0xf90685b1a48259e192876744ff7829c1ba995093", + "9d1e415439a8411e354e72acd944cae82c3c4296c5bef6ef5d848a97a94f9ea8" + ], + [ + "0x9a4e6001044e16c5fe1c98f1ee71ce0b0005ad9b", + "cb9c060f86cec728b11a6d1143de09d221bc3a417ea9ac3e3b2922589c259ed5" + ], + [ + "0x3d03d67dbb26d13fafeebba55f5b6346213f602a", + "68e1c39abdcc8fc7d801237eb730b8e0f3199e1841209944f8c63580749a6f61" + ], + [ + "0x78ae7d98a2291093a4ff9e5003de4ab0d2a82169", + "f4c9cf60f3f91559af004f7a8de8dfebe3121a2ac418ea4f00ec34b5c841ed42" + ], + [ + "0x3cdbcc74770a13cba2045da4740c4c91ddd99b9e", + "d5c02d0db53291c4074a249e983a2f117d3ebd4155d606edde51a9be7e5deee6" + ] +]; + +// keep our own web3 to avoid messing with App's Provider +let e2eWeb3: Web3; +let appWeb3: Web3; +// open(method: string, url: string, async: boolean, username?: string | null, password?: string | null): void; +export const loadWeb3 = (swapAcctIndex: number) => (window: any) => { + if (appWeb3) { + ((appWeb3.currentProvider as WebsocketProvider) + .connection as WebSocket).close(); + } + if (e2eWeb3) { + ((e2eWeb3.currentProvider as WebsocketProvider) + .connection as WebSocket).close(); + } + appWeb3 = new Web3(WEB3_PROVIDER); + e2eWeb3 = new Web3(WEB3_PROVIDER); + + // modify backend proposal fields derived using server time + modifyProposalsApi(window); + + // window.web3.provider gets passed into new Web3 by frontend + // we will inject this for setting contract.options.gas in frontend + // this solves gas exhaustion issues + (appWeb3.currentProvider as any)._e2eContractGas = 5000000; + + // intercept eth_signTypedData_v3 calls and sign (ganache doesn't support yet) + // intercept eth_accounts RPC calls and fiddle with account[0] + const origSend = appWeb3.currentProvider.send; + const newSend = makeSendSpy(origSend, swapAcctIndex); + appWeb3.currentProvider.send = newSend; + window.web3 = appWeb3; +}; + +// intercept and modify/replace json rpc calls +const makeSendSpy = (origSend: any, swapAcctIndex: number) => { + return function(opts: any, cb: any) { + let interceptedCb = cb; + if (opts.method === "eth_signTypedData_v3") { + const [acct, data] = opts.params; + console.log(`e2e: eth_signTypedData_v3 signing for ${acct}`); + const rawTypedData = JSON.parse(data); + const signedMessage = signTypedData(acct, rawTypedData); + interceptedCb(null, { result: signedMessage }); + } else { + if (opts.method === "eth_accounts") { + interceptedCb = (err: any, res: any) => { + console.log( + `e2e: swapping account[0] with account[${swapAcctIndex}] (${ + res.result[swapAcctIndex] + })` + ); + const acctZero = res.result[0]; + res.result[0] = res.result[swapAcctIndex]; + res.result[swapAcctIndex] = acctZero; + cb(err, res); + }; + } + origSend.bind(appWeb3.currentProvider)(opts, interceptedCb); + } + }; +}; + +// sign data using ganache determined private keys + eth-sig-util +const signTypedData = (account: string, typedData: any) => { + const testAccount = testAccounts.find(ta => ta[0] === account.toLowerCase()); + if (testAccount) { + const privateKey = new Buffer(testAccount[1], "hex"); + const sig = sigUtil.signTypedData(privateKey, { data: typedData }); + return sig; + } else { + throw new Error( + `e2e helpers.sign: Could not find privateKey for account ${account}` + ); + } +}; + +// cypress doesn't yet support modifying incoming xhr requests +// https://github.com/cypress-io/cypress/tree/full-network-stubbing-687 +const modifyProposalsApi = (window: any) => { + patchXMLHttpRequest(window, /proposals\/([0-9]+)?/, text => { + const json = JSON.parse(text); + const mod = (proposal: any) => { + if (proposal.crowdFund) { + proposal.crowdFund.milestones.forEach((ms: any) => { + if (ms.state === "ACTIVE") { + // ms.state based on server time, let's use browser time + ms.state = + (ms.payoutRequestVoteDeadline > window.Date.now() && "ACTIVE") || + (ms.percentAgainstPayout >= 50 && "REJECTED") || + "PAID"; + if (ms.state != "ACTIVE") { + console.log( + `e2e modifyProposalApi changed ms.state to ${ms.state}` + ); + } + } + return ms; + }); + } + return proposal; + }; + if (Array.isArray(json)) { + json.forEach(mod); + } else { + mod(json); + } + return JSON.stringify(json); }); }; +// patch the window's XMLHttpRequest with modify fn +const patchXMLHttpRequest = ( + window: any, + urlMatch: RegExp, + modify: (text: string) => string +) => { + const script = window.document.createElement("script"); + script.text = xhookText; + window.__afterxhook__ = function() { + console.log("xhook.after declaration"); + window.xhook.after(function(request: any, response: any) { + if (urlMatch.test(request.url)) response.text = modify(response.text); + }); + }; + window.document.head.appendChild(script); +}; + +const mineBlock = () => + e2eWeb3.currentProvider.send( + { + jsonrpc: "2.0", + method: "evm_mine", + params: [], + id: Date.now() + }, + () => null + ); + +const evmIncreaseTime = (seconds: number) => + new Promise((res, rej) => { + e2eWeb3.currentProvider.send( + { + jsonrpc: "2.0", + method: "evm_increaseTime", + params: [seconds], + id: Date.now() + }, + (err, _) => (err && rej(err)) || res() + ); + }); + +export const increaseTime = (cy: Cypress.Chainable, ms: number) => { + console.log("increasetime", ms); + cy.log("INCREASE TIME", ms + "ms"); + cy.window({ log: false }) + .then(w => evmIncreaseTime(Math.round(ms / 1000))) + .then(() => syncTimeWithEvm(cy)); +}; + +export const syncTimeWithEvm = (cy: Cypress.Chainable) => { + cy.window({ log: false }) + .then(w => { + mineBlock(); + return e2eWeb3.eth + .getBlock("latest") + .then((x: any) => x.timestamp * 1000); + }) + .then(t => { + cy.log("SYNC TIME WITH EVM", new Date(t).toString()); + cy.clock({ log: false }).then(x => x.restore()); // important for repeated calls! + cy.clock(t, ["Date"] as any, { log: false }); + }); +}; + export const createCrowdFund = (web3: Web3) => { const HOUR = 3600; const DAY = HOUR * 24; @@ -41,9 +255,9 @@ export const createCrowdFund = (web3: Web3) => { immediateFirstMilestonePayout ) .send({ - from: accounts[4], + from: accounts[4] // important - gas: 3695268 + // gas: 3695268 }) .then( (receipt: any) => @@ -70,3 +284,9 @@ export const randomHex = function(len: number) { } return r; }; + +// XHook - v1.4.9 - https://github.com/jpillora/xhook +// Jaime Pillora - MIT Copyright 2018 +const xhookText = + '(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H=[].indexOf||function(a){for(var b=0,c=this.length;b=0||(f=f===b?d[a].length:f,d[a].splice(f,0,c))},c[m]=function(a,c){var f;if(a===b)return void(d={});c===b&&(d[a]=[]),f=e(a).indexOf(c),f!==-1&&e(a).splice(f,1)},c[h]=function(){var b,d,f,g,h,i,j,k;for(b=D(arguments),d=b.shift(),a||(b[0]=z(b[0],y(d))),g=c["on"+d],g&&g.apply(c,b),k=e(d).concat(e("*")),f=i=0,j=k.length;i2)throw"invalid hook";return F[n](d,a,b)},F[c]=function(a,b){if(a.length<2||a.length>3)throw"invalid hook";return F[n](c,a,b)},F.enable=function(){q[u]=t,"function"==typeof r&&(q[g]=r),k&&(q[i]=s)},F.disable=function(){q[u]=F[u],q[g]=F[g],k&&(q[i]=k)},v=F.headers=function(a,b){var c,d,e,f,g,h,i,j,k;switch(null==b&&(b={}),typeof a){case"object":d=[];for(e in a)g=a[e],f=e.toLowerCase(),d.push(f+":\\t"+g);return d.join("\\n")+"\\n";case"string":for(d=a.split("\\n"),i=0,j=d.length;ib&&b<4;)k[o]=++b,1===b&&k[h]("loadstart",{}),2===b&&G(),4===b&&(G(),E()),k[h]("readystatechange",{}),4===b&&(t.async===!1?g():setTimeout(g,0))},g=function(){l||k[h]("load",{}),k[h]("loadend",{}),l&&(k[o]=0)},b=0,x=function(a){var b,d;if(4!==a)return void i(a);b=F.listeners(c),(d=function(){var a;return b.length?(a=b.shift(),2===a.length?(a(t,w),d()):3===a.length&&t.async?a(t,w,d):d()):i(4)})()},k=t.xhr=f(),I.onreadystatechange=function(a){try{2===I[o]&&r()}catch(a){}4===I[o]&&(D=!1,r(),q()),x(I[o])},m=function(){l=!0},k[n]("error",m),k[n]("timeout",m),k[n]("abort",m),k[n]("progress",function(){b<3?x(3):k[h]("readystatechange",{})}),("withCredentials"in I||F.addWithCredentials)&&(k.withCredentials=!1),k.status=0,L=e.concat(p);for(J=0,K=L.length;J +import { + loadWeb3, + increaseTime, + syncTimeWithEvm, + randomString +} from "../helpers"; +import { createDemoProposal, authenticateUser } from "../parts"; + +describe("authenticate", () => { + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); +}); diff --git a/e2e/cypress/integration/browse.spec.ts b/e2e/cypress/integration/browse.spec.ts index 237ceac2..ab3c5a94 100644 --- a/e2e/cypress/integration/browse.spec.ts +++ b/e2e/cypress/integration/browse.spec.ts @@ -3,13 +3,13 @@ import { loadWeb3, randomString, randomHex } from "../helpers"; describe("browse", () => { it("should load and be able to browse pages", () => { - cy.visit("http://localhost:3000", { onBeforeLoad: loadWeb3 }); + cy.visit("http://localhost:3000", { onBeforeLoad: loadWeb3(0) }); cy.title().should("include", "Grant.io - Home"); // test hero create link cy.get('.Home-hero-buttons a[href="/create"]') // {force: true} here overcomes a strange issue where the button moves up under the header - // this is likely a cypress-related problem + // this is likely a cypress scroll related problem .click({ force: true }); cy.title().should("include", "Grant.io - Create a Proposal"); diff --git a/e2e/cypress/integration/create.cancel.spec.ts b/e2e/cypress/integration/create.cancel.spec.ts new file mode 100644 index 00000000..b1c682af --- /dev/null +++ b/e2e/cypress/integration/create.cancel.spec.ts @@ -0,0 +1,47 @@ +/// +import { + loadWeb3, + increaseTime, + syncTimeWithEvm, + randomString +} from "../helpers"; +import { createDemoProposal, authenticateUser } from "../parts"; + +describe("proposal", () => { + const id = randomString(); + const title = `[${id}] e2e create cancel`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + (Cypress as any).runner.stop(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("cancels the proposal", () => { + cy.contains(".Proposal-top-main-menu > .ant-btn", "Actions").click(); + cy.contains(".ant-dropdown-menu-item", "Cancel proposal").click(); + cy.contains(".ant-modal-footer > div button", "Confirm").click(); + cy.contains("body", "Proposal didn’t get funded", { timeout: 20000 }); + cy.get(".ant-modal-wrap").should("not.be.visible"); + cy.contains(".Proposal-top-main-menu > .ant-btn", "Actions").click(); + cy.contains(".ant-dropdown-menu-item", "Cancel proposal").should( + "have.attr", + "aria-disabled", + "true" + ); + }); + + it("should appear unfunded to outsiders (account 9)", () => { + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(9) })); + cy.contains("body", "Proposal didn’t get funded", { timeout: 20000 }); + }); +}); diff --git a/e2e/cypress/integration/create.flow.spec.ts b/e2e/cypress/integration/create.flow.spec.ts new file mode 100644 index 00000000..bb8f493a --- /dev/null +++ b/e2e/cypress/integration/create.flow.spec.ts @@ -0,0 +1,173 @@ +/// +import { loadWeb3, randomString, randomHex, syncTimeWithEvm } from "../helpers"; +import { authenticateUser } from "../parts"; + +describe("create.flow", () => { + const time = new Date().toLocaleString(); + const id = randomString(); + const randomEthHex = randomHex(32); + const nextYear = new Date().getUTCFullYear() + 1; + const proposal = { + title: `[${id}] e2e create flow`, + brief: "e2e brief", + category: "Community", // .anticon-team + targetAmount: 5, + body: `#### e2e Proposal ${id} {enter} **created** ${time} `, + team: [ + { + name: "Alisha Endtoend", + title: "QA Robot0", + ethAddress: `0x0000${randomEthHex}0000`, + emailAddress: `qa.alisha.${id}@grant.io` + }, + { + name: "Billy Endtoend", + title: "QA Robot1", + ethAddress: `0x1111${randomEthHex}1111`, + emailAddress: `qa.billy.${id}@grant.io` + } + ], + milestones: [ + { + title: `e2e Milestone ${id} 0`, + body: `e2e Milestone ${id} {enter} body 0`, + date: { + y: nextYear, + m: "Jan", + expect: "January " + nextYear + } + }, + { + title: `e2e Milestone ${id} 1`, + body: `e2e Milestone ${id} {enter} body 1`, + date: { + y: nextYear, + m: "Feb", + expect: "February " + nextYear + } + } + ] + }; + + afterEach(function() { + if (this.currentTest.state === "failed") { + (Cypress as any).runner.stop(); + } + }); + + context("create flow wizard", () => { + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("create flow step 1", () => { + cy.get('[href="/create"]').click(); + syncTimeWithEvm(cy); + cy.get('.CreateFlow input[name="title"]').type(proposal.title); + cy.get('.CreateFlow textarea[name="brief"]').type(proposal.brief); + cy.contains("Select a category").click(); + cy.get(".ant-select-dropdown li .anticon-team").click(); + cy.get('.CreateFlow input[name="amountToRaise"]').type( + "" + proposal.targetAmount + ); + cy.wait(1000); + cy.contains(".CreateFlow-footer-button", "Continue").click(); + }); + + it("create flow step 2", () => { + cy.get("button.TeamForm-add").click(); + cy.get('.TeamMember-info input[name="name"]').type(proposal.team[1].name); + cy.get('.TeamMember-info input[name="title"]').type( + proposal.team[1].title + ); + cy.get('.TeamMember-info input[name="ethAddress"]').type( + proposal.team[1].ethAddress + ); + cy.get('.TeamMember-info input[name="emailAddress"]').type( + proposal.team[1].emailAddress + ); + cy.get("button") + .contains("Save changes") + .click({ force: true }); + cy.wait(1000); + cy.contains(".CreateFlow-footer-button", "Continue").click(); + }); + + it("create flow step 3", () => { + cy.get(".DraftEditor-editorContainer > div").type(proposal.body); + cy.get(".mde-tabs > :nth-child(2)").click(); + cy.wait(1000); + cy.contains(".CreateFlow-footer-button", "Continue").click(); + }); + + it("create flow step 4", () => { + cy.get('input[name="title"]').type(proposal.milestones[0].title); + cy.get('textarea[name="body"]').type(proposal.milestones[0].body); + cy.get('input[placeholder="Expected completion date"]').click(); + cy.get(".ant-calendar-month-panel-next-year-btn").click(); + cy.get(".ant-calendar-month-panel-month") + .contains(proposal.milestones[0].date.m) + .click(); + cy.get(".ant-calendar-picker-input").should( + "have.value", + proposal.milestones[0].date.expect + ); + cy.get("button") + .contains("Add another milestone") + .click({ force: true }); + cy.get('input[name="title"]') + .eq(1) + .type(proposal.milestones[1].title); + cy.get('textarea[name="body"]') + .eq(1) + .type(proposal.milestones[1].body); + cy.get('input[placeholder="Expected completion date"]') + .eq(1) + .click(); + cy.get(".ant-calendar-month-panel-next-year-btn").click(); + cy.get(".ant-calendar-month-panel-month") + .contains(proposal.milestones[1].date.m) + .click(); + cy.get(".ant-calendar-picker-input") + .eq(1) + .should("have.value", proposal.milestones[1].date.expect); + cy.wait(1000); + cy.contains(".CreateFlow-footer-button", "Continue").click(); + }); + + it("create flow step 5", () => { + cy.window() + .then(w => (w as any).web3.eth.getAccounts()) + .then(accts => { + cy.get('input[name="payOutAddress"]').type(accts[0]); + cy.get("button") + .contains("Add another trustee") + .click({ force: true }); + cy.get( + 'input[placeholder="0x8B0B72F8bDE212991135668922fD5acE557DE6aB"]' + ) + .eq(1) + .type(accts[1]); + cy.get('input[name="deadline"][value="2592000"]').click({ + force: true + }); + cy.get('input[name="milestoneDeadline"][value="259200"]').click({ + force: true + }); + }); + cy.wait(1000); + cy.contains(".CreateFlow-footer-button", "Continue").click(); + }); + + it("publishes the proposal", () => { + cy.get("button") + .contains("Publish") + .click(); + cy.get(".CreateFinal-loader-text").contains("Deploying contract..."); + cy.get(".CreateFinal-message-text a", { timeout: 20000 }) + .contains("Click here") + .click(); + cy.get(".Proposal-top-main-title").contains(proposal.title); + }); + }); +}); diff --git a/e2e/cypress/integration/create.fund.cancel.spec.ts b/e2e/cypress/integration/create.fund.cancel.spec.ts new file mode 100644 index 00000000..85250d42 --- /dev/null +++ b/e2e/cypress/integration/create.fund.cancel.spec.ts @@ -0,0 +1,61 @@ +/// +import { + loadWeb3, + increaseTime, + syncTimeWithEvm, + randomString +} from "../helpers"; +import { createDemoProposal, authenticateUser } from "../parts"; + +describe("create.fund.cancel", () => { + const id = randomString(); + const title = `[${id}] e2e create fund cancel`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + (Cypress as any).runner.stop(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("create demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("funds the proposal with account 5", () => { + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.get(".ant-input", { timeout: 20000 }).type(amount); + cy.get(".ant-form > .ant-btn").click(); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("cancels the proposal (refund contributors)", () => { + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains(".Proposal-top-main-menu > .ant-btn", "Actions").click(); + cy.contains(".ant-dropdown-menu-item", "Refund contributors").click(); + cy.contains(".ant-modal-footer > div button", "Confirm").click(); + cy.get(".ant-modal-wrap", { timeout: 20000 }).should("not.be.visible"); + cy.contains(".Proposal-top-main-menu > .ant-btn", "Actions").click(); + cy.contains(".ant-dropdown-menu-item", "Refund contributors").should( + "have.attr", + "aria-disabled", + "true" + ); + }); + + it("refunds the contributor (account 5)", () => { + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-tabs-nav > :nth-child(1) > :nth-child(4)", "Refund", { + timeout: 20000 + }).click(); + // force disables cypress' auto scrolling which messes up UI in this case + cy.contains(".ant-btn", "Get your refund").click({ force: true }); + cy.contains("body", "Your refund has been processed", { timeout: 20000 }); + }); +}); diff --git a/e2e/cypress/integration/create.fund.complete.minority-no-votes.spec.ts b/e2e/cypress/integration/create.fund.complete.minority-no-votes.spec.ts new file mode 100644 index 00000000..9fa5580a --- /dev/null +++ b/e2e/cypress/integration/create.fund.complete.minority-no-votes.spec.ts @@ -0,0 +1,126 @@ +/// +import { + loadWeb3, + randomString, + syncTimeWithEvm, + increaseTime +} from "../helpers"; +import { createDemoProposal, fundProposal, authenticateUser } from "../parts"; + +describe("create.fund.complete.minority-no-votes", () => { + const id = randomString(); + const title = `[${id}] e2e minority no-votes complete`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + //(Cypress as any).runner.stop(); + this.skip(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("funds the proposal from accounts 5, 6 & 7", () => { + fundProposal(cy, 5, 0.1); + fundProposal(cy, 6, 0.2); + fundProposal(cy, 7, 0.7); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout", () => { + // MILESTONE 1 + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.get(".MilestoneAction-top > div > .ant-btn", { timeout: 20000 }).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + }); + + it("requests milestone 2 payout", () => { + // MILESTONE 2 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); + + it("minority funder (acct 5) votes no", () => { + // VOTE NO + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }) + .click() + .should("have.class", "ant-btn-loading"); + cy.contains(".ant-btn", "Revert vote against payout", { timeout: 20000 }); + }); + + it("expires milestone 2 voting period & receives payout", () => { + // EXPIRE + increaseTime(cy, 70000); + // RECEIVE PAYOUT + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).click(); + }); + + it("requests milestone 3 payout", () => { + // MILESTONE 3 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); + + it("minority funder (acct 5) votes no", () => { + // VOTE NO + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }) + .click() + .should("have.class", "ant-btn-loading"); + cy.contains(".ant-btn", "Revert vote against payout", { timeout: 20000 }); + }); + + it("expires milestone 3 voting period & receives payout", () => { + // EXPIRE + increaseTime(cy, 70000); + // RECEIVE PAYOUT + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).click(); + }); + + it("should not have receive button", () => { + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).should("not.exist"); + }); +}); diff --git a/e2e/cypress/integration/create.fund.complete.spec.ts b/e2e/cypress/integration/create.fund.complete.spec.ts new file mode 100644 index 00000000..ae819fe0 --- /dev/null +++ b/e2e/cypress/integration/create.fund.complete.spec.ts @@ -0,0 +1,103 @@ +/// +import { + loadWeb3, + increaseTime, + syncTimeWithEvm, + randomString +} from "../helpers"; +import { createDemoProposal, authenticateUser } from "../parts"; + +describe("create.fund.complete", () => { + const id = randomString(); + const title = `[${id}] e2e create fund complete`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + //(Cypress as any).runner.stop(); + this.skip(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("create demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("funds the proposal with account 5", () => { + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.get(".ant-input", { timeout: 20000 }).type(amount); + cy.get(".ant-form > .ant-btn").click(); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout", () => { + // MILESTONE 1 + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request initial payout", + { timeout: 20000 } + ) + .as("RequestPayout") + .click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + }); + + it("requests and receives milestone 2 payout", () => { + // MILESTONE 2 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + // EXPIRE + increaseTime(cy, 70000); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).click(); + }); + + it("requests and receives milestone 3 payout", () => { + // MILESTONE 3 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + // EXPIRE + increaseTime(cy, 70000); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).click(); + }); + + it("should not have receive button", () => { + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout", + { timeout: 20000 } + ).should("not.exist"); + }); +}); diff --git a/e2e/cypress/integration/create.fund.ms2.majority-no-vote.spec.ts b/e2e/cypress/integration/create.fund.ms2.majority-no-vote.spec.ts new file mode 100644 index 00000000..41b40f77 --- /dev/null +++ b/e2e/cypress/integration/create.fund.ms2.majority-no-vote.spec.ts @@ -0,0 +1,60 @@ +/// +import { loadWeb3, randomString, syncTimeWithEvm } from "../helpers"; +import { createDemoProposal, fundProposal, authenticateUser } from "../parts"; + +describe("create.fund.ms2.majority-no-vote", () => { + const id = randomString(); + const title = `[${id}] e2e ms2 majority no-vote`; + const amount = "1"; + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("fund the proposal with 5th account", () => { + fundProposal(cy, 5, 1); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout for milestone 1", () => { + // MILESTONE 1 + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.get(".MilestoneAction-top > div > .ant-btn", { timeout: 20000 }).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ); + }); + + it("requests milestone 2 payout", () => { + // MILESTONE 2 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); + + it("vote against milestone 2 payout as account 5", () => { + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }).click(); + cy.contains(".ant-btn", "Revert vote against payout", { timeout: 20000 }); + }); +}); diff --git a/e2e/cypress/integration/create.fund.ms2.no-vote.re-vote.spec.ts b/e2e/cypress/integration/create.fund.ms2.no-vote.re-vote.spec.ts new file mode 100644 index 00000000..c361e1c5 --- /dev/null +++ b/e2e/cypress/integration/create.fund.ms2.no-vote.re-vote.spec.ts @@ -0,0 +1,87 @@ +/// +import { + loadWeb3, + randomString, + syncTimeWithEvm, + increaseTime +} from "../helpers"; +import { createDemoProposal, fundProposal, authenticateUser } from "../parts"; + +describe("create.fund.ms2.no-vote.re-vote", () => { + const id = randomString(); + const title = `[${id}] e2e ms2 no-vote expire re-vote`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + //(Cypress as any).runner.stop(); + this.skip(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("fund the proposal with 5th account", () => { + fundProposal(cy, 5, 1); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout for milestone 1", () => { + // MILESTONE 1 + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.get(".MilestoneAction-top > div > .ant-btn", { timeout: 20000 }).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + }); + + it("request milestone 2 payout", () => { + // MILESTONE 2 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); + + it("vote against milestone 2 payout as 5th account", () => { + // reload page with 5th account + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }) + .click() + .should("have.class", "ant-btn-loading"); + cy.contains(".ant-btn", "Revert vote against payout", { timeout: 20000 }); + }); + + it("milestone 2 vote expires and payout is requested again", () => { + // EXPIRE + increaseTime(cy, 70000); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains("Payout was voted against"); + // RE-REQUEST PAYOUT + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + // TODO: fix this bug (the following fails) + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); +}); diff --git a/e2e/cypress/integration/create.fund.ms2.refund-after-payout.spec.ts b/e2e/cypress/integration/create.fund.ms2.refund-after-payout.spec.ts new file mode 100644 index 00000000..f52f2fb0 --- /dev/null +++ b/e2e/cypress/integration/create.fund.ms2.refund-after-payout.spec.ts @@ -0,0 +1,69 @@ +/// +import { + loadWeb3, + randomString, + syncTimeWithEvm, + increaseTime +} from "../helpers"; +import { createDemoProposal, fundProposal, authenticateUser } from "../parts"; + +describe("create.fund.ms2.refund-after-payout", () => { + const id = randomString(); + const title = `[${id}] e2e ms2 refund after payout`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + //(Cypress as any).runner.stop(); + this.skip(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("fund the proposal with account 5", () => { + fundProposal(cy, 5, 1); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout for milestone 1", () => { + // MILESTONE 1 + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.get(".MilestoneAction-top > div > .ant-btn", { timeout: 20000 }).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ); + }); + + it("majority refund vote and get refund (account 5)", () => { + // REFUND + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-tabs-nav > :nth-child(1) > :nth-child(4)", "Refund", { + timeout: 20000 + }).click(); + // INCREASE TIME + increaseTime(cy, 70000); + // force disables cypress' auto scrolling which messes up UI in this case + cy.contains(".ant-btn", "Vote for refund").click({ force: true }); + cy.contains(".ant-btn", "Get your refund", { timeout: 20000 }).click({ + force: true + }); + cy.contains("body", "Your refund has been processed", { timeout: 20000 }); + }); +}); diff --git a/e2e/cypress/integration/create.fund.ms2.revert-no-vote.spec.ts b/e2e/cypress/integration/create.fund.ms2.revert-no-vote.spec.ts new file mode 100644 index 00000000..ca7ddf7a --- /dev/null +++ b/e2e/cypress/integration/create.fund.ms2.revert-no-vote.spec.ts @@ -0,0 +1,93 @@ +/// +import { + loadWeb3, + randomString, + syncTimeWithEvm, + increaseTime +} from "../helpers"; +import { createDemoProposal, fundProposal, authenticateUser } from "../parts"; + +describe("create.fund.ms2.revert-no-vote", () => { + const id = randomString(); + const title = `[${id}] e2e ms2 revert no-vote`; + const amount = "1"; + + afterEach(function() { + if (this.currentTest.state === "failed") { + //(Cypress as any).runner.stop(); + this.skip(); + } + }); + + it("authenticates and creates if necessary", () => { + authenticateUser(cy, 0); + }); + + it("creates demo proposal", () => { + createDemoProposal(cy, title, amount); + }); + + it("funds the proposal with 5th account", () => { + fundProposal(cy, 5, 1); + cy.get(".ProposalCampaignBlock-fundingOver", { timeout: 20000 }).contains( + "Proposal has been funded" + ); + }); + + it("receives initial payout for milestone 1", () => { + // MILESTONE 1 + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.get(".MilestoneAction-top > div > .ant-btn", { timeout: 20000 }).click(); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive initial payout", + { timeout: 20000 } + ).click(); + }); + + it("requests milestone 2 payout", () => { + // MILESTONE 2 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ).click(); + cy.contains(".MilestoneAction-progress-text", "voted against payout", { + timeout: 20000 + }); + }); + + it("votes against milestone 2 payout as account 5 and then reverts the vote", () => { + // NO VOTE... REVERT + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(5) })); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }) + .click() + .should("have.class", "ant-btn-loading"); + cy.contains(".ant-btn", "Revert vote against payout", { timeout: 20000 }) + .click() + .should("have.class", "ant-btn-loading"); + cy.contains(".ant-btn", "Vote against payout", { timeout: 20000 }); + }); + + it("milestone 2 vote expires and payout is received", () => { + // EXPIRE + increaseTime(cy, 70000); + // PAYOUT + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(0) })); + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Receive milestone payout" + ).click(); + }); + + it("milestone 3 becomes active", () => { + // MILESTONE 3 + cy.contains( + ".MilestoneAction-top > div > .ant-btn", + "Request milestone payout", + { timeout: 20000 } + ); + }); +}); diff --git a/e2e/cypress/integration/create.spec.ts b/e2e/cypress/integration/create.spec.ts deleted file mode 100644 index 98ef3477..00000000 --- a/e2e/cypress/integration/create.spec.ts +++ /dev/null @@ -1,192 +0,0 @@ -/// -import { loadWeb3, randomString, randomHex } from "../helpers"; - -describe("create proposal", () => { - it("should load and be able to browse pages", () => { - cy.visit("http://localhost:3000/create", { onBeforeLoad: loadWeb3 }); - - // populate ethAccounts - cy.wait(1000); - cy.window() - .then(w => (w as any).web3.eth.getAccounts()) - .as("EthAccounts"); - - // demo proposal - // cy.get("button.CreateFlow-footer-example").click(); - - const time = new Date().toLocaleString(); - const id = randomString(); - const randomEthHex = randomHex(32); - const nextYear = new Date().getUTCFullYear() + 1; - const proposal = { - title: "e2e - smoke - create " + time, - brief: "e2e brief", - category: "Community", // .anticon-team - targetAmount: 5, - body: `#### e2e Proposal ${id} {enter} **created** ${time} `, - team: [ - { - name: "Alisha Endtoend", - title: "QA Robot0", - ethAddress: `0x0000${randomEthHex}0000`, - emailAddress: `qa.alisha.${id}@grant.io` - }, - { - name: "Billy Endtoend", - title: "QA Robot1", - ethAddress: `0x1111${randomEthHex}1111`, - emailAddress: `qa.billy.${id}@grant.io` - } - ], - milestones: [ - { - title: `e2e Milestone ${id} 0`, - body: `e2e Milestone ${id} {enter} body 0`, - date: { - y: nextYear, - m: "Jan", - expect: "January " + nextYear - } - }, - { - title: `e2e Milestone ${id} 1`, - body: `e2e Milestone ${id} {enter} body 1`, - date: { - y: nextYear, - m: "Feb", - expect: "February " + nextYear - } - } - ] - }; - - // step 1 - cy.get('.CreateFlow input[name="title"]', { timeout: 20000 }).type( - proposal.title - ); - cy.get('.CreateFlow textarea[name="brief"]').type(proposal.brief); - cy.contains("Select a category").click(); - cy.get(".ant-select-dropdown li .anticon-team").click(); - cy.get('.CreateFlow input[name="amountToRaise"]').type( - "" + proposal.targetAmount - ); - cy.get(".CreateFlow-footer-button") - .contains("Continue") - .as("Continue") - .click(); - - // step 2 - cy.get('.TeamMember-info input[name="name"]').type(proposal.team[0].name); - cy.get('.TeamMember-info input[name="title"]').type(proposal.team[0].title); - cy.get("@EthAccounts").then(accts => { - cy.get('.TeamMember-info input[name="ethAddress"]').type( - accts[0].toString() - ); - }); - cy.get('.TeamMember-info input[name="emailAddress"]').type( - proposal.team[0].emailAddress - ); - cy.get("button") - .contains("Save changes") - .click({ force: true }); - - cy.get("button.TeamForm-add").click(); - cy.get('.TeamMember-info input[name="name"]').type(proposal.team[1].name); - cy.get('.TeamMember-info input[name="title"]').type(proposal.team[1].title); - cy.get("@EthAccounts").then(accts => { - cy.get('.TeamMember-info input[name="ethAddress"]').type( - accts[1].toString() - ); - }); - cy.get('.TeamMember-info input[name="emailAddress"]').type( - proposal.team[1].emailAddress - ); - cy.get("button") - .contains("Save changes") - .click({ force: true }); - - cy.wait(1000); - cy.get("@Continue").click(); - - // step 3 - cy.get(".DraftEditor-editorContainer > div").type(proposal.body); - cy.get(".mde-tabs > :nth-child(2)").click(); - - cy.wait(1000); - cy.get("@Continue").click(); - - // step 4 - cy.get('input[name="title"]').type(proposal.milestones[0].title); - cy.get('textarea[name="body"]').type(proposal.milestones[0].body); - cy.get('input[placeholder="Expected completion date"]').click(); - cy.get(".ant-calendar-month-panel-next-year-btn").click(); - cy.get(".ant-calendar-month-panel-month") - .contains(proposal.milestones[0].date.m) - .click(); - cy.get(".ant-calendar-picker-input").should( - "have.value", - proposal.milestones[0].date.expect - ); - - cy.get("button") - .contains("Add another milestone") - .click({ force: true }); - - cy.get('input[name="title"]') - .eq(1) - .type(proposal.milestones[1].title); - cy.get('textarea[name="body"]') - .eq(1) - .type(proposal.milestones[1].body); - cy.get('input[placeholder="Expected completion date"]') - .eq(1) - .click(); - cy.get(".ant-calendar-month-panel-next-year-btn").click(); - cy.get(".ant-calendar-month-panel-month") - .contains(proposal.milestones[1].date.m) - .click(); - cy.get(".ant-calendar-picker-input") - .eq(1) - .should("have.value", proposal.milestones[1].date.expect); - - cy.wait(1000); - cy.get("@Continue").click(); - - // step 5 - cy.window() - .then(w => (w as any).web3.eth.getAccounts()) - .then(accts => { - cy.get('input[name="payOutAddress"]').type(accts[0]); - cy.get("button") - .contains("Add another trustee") - .click({ force: true }); - cy.get( - 'input[placeholder="0x8B0B72F8bDE212991135668922fD5acE557DE6aB"]' - ) - .eq(1) - .type(accts[1]); - cy.get('input[name="deadline"][value="2592000"]').click({ - force: true - }); - cy.get('input[name="milestoneDeadline"][value="259200"]').click({ - force: true - }); - }); - - cy.wait(1000); - cy.get("@Continue").click(); - - // final - cy.get("button") - .contains("Publish") - .click(); - cy.get(".CreateFinal-loader-text").contains("Deploying contract..."); - - cy.get(".CreateFinal-message-text a", { timeout: 20000 }) - .contains("Click here") - .click(); - - // done - cy.get(".Proposal-top-main-title").contains(proposal.title); - }); -}); diff --git a/e2e/cypress/integration/sandbox.ts b/e2e/cypress/integration/sandbox.ts new file mode 100644 index 00000000..48267885 --- /dev/null +++ b/e2e/cypress/integration/sandbox.ts @@ -0,0 +1,15 @@ +/// +import { + loadWeb3, + increaseTime, + randomString, + syncTimeWithEvm +} from "../helpers"; + +// describe("sandbox", () => { +// it("how to increase time", () => { +// cy.visit("http://localhost:3000", { onBeforeLoad: loadWeb3(0) }); +// // increase time on browser and ganache +// increaseTime(cy, 60000); +// }); +// }); diff --git a/e2e/cypress/parts.ts b/e2e/cypress/parts.ts new file mode 100644 index 00000000..4ef50564 --- /dev/null +++ b/e2e/cypress/parts.ts @@ -0,0 +1,107 @@ +/// +import { syncTimeWithEvm, loadWeb3, testAccounts } from "./helpers"; + +export const authenticateUser = ( + cy: Cypress.Chainable, + accountIndex: number +) => { + const name = `Qual Itty ${accountIndex}`; + const ethAccount = testAccounts[accountIndex][0]; + const title = `QA Robot ${accountIndex}`; + const email = `qa.robot.${accountIndex}@grant.io`; + cy.visit("http://localhost:3000", { onBeforeLoad: loadWeb3(accountIndex) }); + syncTimeWithEvm(cy); + cy.get(".AuthButton").click(); + cy.request({ + url: `http://localhost:5000/api/v1/users/${ethAccount}`, + method: "GET", + failOnStatusCode: false + }) + .its("status") + .then(status => { + if (status === 200) { + cy.contains("button", "Prove identity").click(); + } else { + cy.get("input[name='name']").type(name); + cy.get("input[name='title']").type(title); + cy.get("input[name='email']").type(email); + cy.contains("button", "Claim Identity").click(); + } + cy.contains(".ProfileUser", email); + }); +}; + +export const createDemoProposal = ( + cy: Cypress.Chainable, + title: string, + amount: string +) => { + cy.get('[href="/create"]').click(); + + // expects to be @ /create + cy.url().should("contain", "/create"); + + cy.log("CREATE DEMO PROPOSAL", title, amount); + + // demo proposal + cy.get("button.CreateFlow-footer-example").click(); + + // change name + cy.get(".ant-steps > :nth-child(1)").click(); + cy.get('.CreateFlow input[name="title"]', { timeout: 20000 }) + .clear() + .type(title) + .blur(); + cy.get('.CreateFlow input[name="amountToRaise"]') + .clear() + .type(amount) + .blur(); + cy.wait(1000); + + // remove extra trustees + cy.get(".ant-steps > :nth-child(5)").click(); + cy.get( + ":nth-child(11) > .ant-form-item-control-wrapper div > button" + ).click(); + cy.get( + ":nth-child(10) > .ant-form-item-control-wrapper div > button" + ).click(); + cy.get(":nth-child(9) > .ant-form-item-control-wrapper div > button").click(); + cy.get(":nth-child(8) > .ant-form-item-control-wrapper div > button").click(); + cy.get(":nth-child(7) > .ant-form-item-control-wrapper div > button").click(); + cy.wait(1000); + cy.get(".CreateFlow-footer-button") + .contains("Continue") + .click(); + + // final + cy.get("button") + .contains("Publish") + .click(); + cy.get(".CreateFinal-loader-text").contains("Deploying contract..."); + cy.get(".CreateFinal-message-text a", { timeout: 30000 }) + .contains("Click here") + .click(); + + // created + cy.get(".Proposal-top-main-title").contains(title); +}; + +export const fundProposal = ( + cy: Cypress.Chainable, + accountIndex: number, + amount: number +) => { + // expects to be @ /proposals/ + cy.url().should("contain", "/proposals/"); + + // reload page with accountIndex account + syncTimeWithEvm(cy); + cy.url().then(url => cy.visit(url, { onBeforeLoad: loadWeb3(accountIndex) })); + + // fund proposal + cy.get(".ant-input", { timeout: 20000 }).type(amount + ""); + cy.contains(".ant-form > .ant-btn", "Fund this project", { timeout: 20000 }) + .click() + .should("not.have.attr", "loading"); +}; diff --git a/e2e/cypress/typings.d.ts b/e2e/cypress/typings.d.ts index f3f59664..721f4b18 100644 --- a/e2e/cypress/typings.d.ts +++ b/e2e/cypress/typings.d.ts @@ -2,3 +2,7 @@ declare module "*.json" { const value: any; export default value; } + +declare module "eth-sig-util" { + export function signTypedData(k: any, d: any): string; +} diff --git a/e2e/package.json b/e2e/package.json index 641f382c..dd36cf1e 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -11,6 +11,7 @@ "@cypress/webpack-preprocessor": "^2.0.1", "@types/web3": "^1.0.3", "cypress": "^3.1.0", + "eth-sig-util": "^2.1.0", "ts-loader": "^5.0.0", "typescript": "^3.0.3", "web3": "^1.0.0-beta.36", diff --git a/e2e/yarn.lock b/e2e/yarn.lock index 873d4e72..5ee8e43b 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -1011,6 +1011,16 @@ binary-extensions@^1.0.0: version "1.11.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" +bindings@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" + +bip66@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" + dependencies: + safe-buffer "^5.0.1" + bl@^1.0.0: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" @@ -1040,7 +1050,7 @@ bn.js@4.11.6: version "4.11.6" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.11.6, bn.js@^4.4.0: +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.4.0, bn.js@^4.8.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" @@ -1100,7 +1110,7 @@ brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" -browserify-aes@^1.0.0, browserify-aes@^1.0.4: +browserify-aes@^1.0.0, browserify-aes@^1.0.4, browserify-aes@^1.0.6: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" dependencies: @@ -1213,7 +1223,7 @@ buffer@^4.3.0: ieee754 "^1.1.4" isarray "^1.0.0" -buffer@^5.0.5: +buffer@^5.0.5, buffer@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" dependencies: @@ -1779,6 +1789,14 @@ domain-browser@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" +drbg.js@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" + dependencies: + browserify-aes "^1.0.6" + create-hash "^1.1.2" + create-hmac "^1.1.4" + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -1820,7 +1838,7 @@ elliptic@6.3.3: hash.js "^1.0.0" inherits "^2.0.1" -elliptic@^6.0.0, elliptic@^6.4.0: +elliptic@^6.0.0, elliptic@^6.2.3, elliptic@^6.4.0: version "6.4.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.1.tgz#c2d0b7776911b86722c632c3c06c60f2f819939a" dependencies: @@ -1920,6 +1938,46 @@ eth-lib@0.2.7: elliptic "^6.4.0" xhr-request-promise "^0.1.2" +eth-sig-util@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.1.0.tgz#33e60e5486897a2ddeb4bf5a0993b2c6d5cc9e19" + dependencies: + buffer "^5.2.1" + elliptic "^6.4.0" + ethereumjs-abi "0.6.5" + ethereumjs-util "^5.1.1" + tweetnacl "^1.0.0" + tweetnacl-util "^0.15.0" + +ethereumjs-abi@0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.5.tgz#5a637ef16ab43473fa72a29ad90871405b3f5241" + dependencies: + bn.js "^4.10.0" + ethereumjs-util "^4.3.0" + +ethereumjs-util@^4.3.0: + version "4.5.0" + resolved "http://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-4.5.0.tgz#3e9428b317eebda3d7260d854fddda954b1f1bc6" + dependencies: + bn.js "^4.8.0" + create-hash "^1.1.2" + keccakjs "^0.2.0" + rlp "^2.0.0" + secp256k1 "^3.0.1" + +ethereumjs-util@^5.1.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-5.2.0.tgz#3e0c0d1741471acf1036052d048623dee54ad642" + dependencies: + bn.js "^4.11.0" + create-hash "^1.1.2" + ethjs-util "^0.1.3" + keccak "^1.0.2" + rlp "^2.0.0" + safe-buffer "^5.1.1" + secp256k1 "^3.0.1" + ethers@4.0.0-beta.1: version "4.0.0-beta.1" resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.0-beta.1.tgz#0648268b83e0e91a961b1af971c662cdf8cbab6d" @@ -1942,6 +2000,13 @@ ethjs-unit@0.1.6: bn.js "4.11.6" number-to-bn "1.7.0" +ethjs-util@^0.1.3: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + eventemitter3@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.1.1.tgz#47786bdaa087caf7b1b75e73abc5c7d540158cd0" @@ -2872,7 +2937,16 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -keccakjs@^0.2.1: +keccak@^1.0.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-1.4.0.tgz#572f8a6dbee8e7b3aa421550f9e6408ca2186f80" + dependencies: + bindings "^1.2.1" + inherits "^2.0.3" + nan "^2.2.1" + safe-buffer "^5.1.0" + +keccakjs@^0.2.0, keccakjs@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/keccakjs/-/keccakjs-0.2.1.tgz#1d633af907ef305bbf9f2fa616d56c44561dfa4d" dependencies: @@ -3238,6 +3312,10 @@ nan@^2.0.8, nan@^2.3.3, nan@^2.9.2: version "2.11.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" +nan@^2.2.1: + version "2.11.1" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.1.tgz#90e22bccb8ca57ea4cd37cc83d3819b52eea6766" + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -3926,6 +4004,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rlp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.1.0.tgz#e4f9886d5a982174f314543831e36e1a658460f9" + dependencies: + safe-buffer "^5.1.1" + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -3990,6 +4074,19 @@ scryptsy@^1.2.1: dependencies: pbkdf2 "^3.0.3" +secp256k1@^3.0.1: + version "3.5.2" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.5.2.tgz#f95f952057310722184fe9c914e6b71281f2f2ae" + dependencies: + bindings "^1.2.1" + bip66 "^1.1.3" + bn.js "^4.11.3" + create-hash "^1.1.2" + drbg.js "^1.0.1" + elliptic "^6.2.3" + nan "^2.2.1" + safe-buffer "^5.1.0" + seek-bzip@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/seek-bzip/-/seek-bzip-1.0.5.tgz#cfe917cb3d274bcffac792758af53173eb1fabdc" @@ -4526,10 +4623,18 @@ tunnel-agent@^0.6.0: dependencies: safe-buffer "^5.0.1" +tweetnacl-util@^0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.0.tgz#4576c1cee5e2d63d207fee52f1ba02819480bc75" + tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" +tweetnacl@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.0.tgz#713d8b818da42068740bf68386d0479e66fc8a7b" + type-is@~1.6.15, type-is@~1.6.16: version "1.6.16" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.16.tgz#f89ce341541c672b25ee7ae3c73dee3b2be50194" diff --git a/frontend/client/lib/getContract.ts b/frontend/client/lib/getContract.ts index 3d9bf4cf..67dcf31a 100644 --- a/frontend/client/lib/getContract.ts +++ b/frontend/client/lib/getContract.ts @@ -16,7 +16,13 @@ const getContractInstance = async ( deployedAddress = deployedAddress || contractDefinition.networks[networkId].address; // create the instance - return new web3.eth.Contract(contractDefinition.abi, deployedAddress); + const contract = new web3.eth.Contract(contractDefinition.abi, deployedAddress); + + // use gas from e2e injected window.web3.provider + if ((web3.currentProvider as any)._e2eContractGas) { + contract.options.gas = (web3.currentProvider as any)._e2eContractGas; + } + return contract; }; export default getContractInstance; diff --git a/frontend/client/modules/web3/actions.ts b/frontend/client/modules/web3/actions.ts index e411ee13..cf6c35e1 100644 --- a/frontend/client/modules/web3/actions.ts +++ b/frontend/client/modules/web3/actions.ts @@ -508,7 +508,7 @@ export function signData(data: object, dataTypes: object, primaryType: string) { primaryType, }; - (web3.currentProvider as any).sendAsync( + (web3.currentProvider as any).send( { method: 'eth_signTypedData_v3', params: [accounts[0], JSON.stringify(rawTypedData)], diff --git a/frontend/package.json b/frontend/package.json index 9ef3cc1f..d4fb59f1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,7 +13,7 @@ "heroku-postbuild": "yarn build", "tsc": "tsc", "link-contracts": "cd client/lib && ln -s ../../build/contracts contracts", - "ganache": "ganache-cli -b 5", + "ganache": "ganache-cli -b 5 -s testGrantIo -e 1000", "truffle": "truffle exec ./bin/init-truffle.js && cd client/lib/contracts && truffle console", "storybook": "start-storybook -p 9001 -c .storybook" }, From 7abeac7bd73a84c55df6a5ebbf97ab570d11d06a Mon Sep 17 00:00:00 2001 From: AMStrix Date: Wed, 21 Nov 2018 23:45:29 -0600 Subject: [PATCH 15/17] Sentry Integration (#221) * BE sentry setup w/ user scope * FE sentry integration + user scope * FE env adjustments * FE: use NODE_ENV for Sentry * BE: use FLASK_ENV for Sentry * BE: remove email, acct & ip from Sentry user scope * comment .env.example SENTRY* for CI * fix merge artifact --- backend/.env.example | 3 +- backend/grant/app.py | 8 +++ backend/grant/settings.py | 5 ++ backend/grant/utils/auth.py | 5 ++ backend/requirements/prod.txt | 3 + frontend/.envexample | 8 ++- frontend/client/index.tsx | 7 +++ frontend/client/modules/auth/actions.ts | 9 ++- frontend/config/env.js | 12 ++++ frontend/package.json | 2 + frontend/server/index.tsx | 11 ++++ frontend/yarn.lock | 78 ++++++++++++++++++++++++- 12 files changed, 146 insertions(+), 5 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index 46e54c35..40df3430 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -11,6 +11,7 @@ SENDGRID_API_KEY="optional, but emails won't send without it" ETHEREUM_ENDPOINT_URI = "http://localhost:8545" CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" +# SENTRY_DSN="https://PUBLICKEY@sentry.io/PROJECTID" +# SENTRY_RELEASE="optional, overrides git hash" UPLOAD_DIRECTORY = "/tmp" UPLOAD_URL = "http://localhost:5000" # for constructing download url - diff --git a/backend/grant/app.py b/backend/grant/app.py index 18916a25..35628322 100644 --- a/backend/grant/app.py +++ b/backend/grant/app.py @@ -2,9 +2,12 @@ """The app module, containing the app factory function.""" from flask import Flask from flask_cors import CORS +from sentry_sdk.integrations.flask import FlaskIntegration +import sentry_sdk from grant import commands, proposal, user, comment, milestone, admin, email from grant.extensions import bcrypt, migrate, db, ma, mail, web3 +from grant.settings import SENTRY_RELEASE, ENV def create_app(config_object="grant.settings"): @@ -15,6 +18,11 @@ def create_app(config_object="grant.settings"): register_blueprints(app) register_shellcontext(app) register_commands(app) + sentry_sdk.init( + environment=ENV, + release=SENTRY_RELEASE, + integrations=[FlaskIntegration()] + ) return app diff --git a/backend/grant/settings.py b/backend/grant/settings.py index 96b481c3..210b5642 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -6,8 +6,11 @@ Most configuration is set via environment variables. For local development, use a .env file to set environment variables. """ +import subprocess from environs import Env +git_revision_short_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) + env = Env() env.read_env() @@ -29,6 +32,8 @@ SENDGRID_API_KEY = env.str("SENDGRID_API_KEY", default="") SENDGRID_DEFAULT_FROM = "noreply@grant.io" ETHEREUM_PROVIDER = "http" ETHEREUM_ENDPOINT_URI = env.str("ETHEREUM_ENDPOINT_URI") +SENTRY_DSN = env.str("SENTRY_DSN", default=None) +SENTRY_RELEASE = env.str("SENTRY_RELEASE", default=git_revision_short_hash) UPLOAD_DIRECTORY = env.str("UPLOAD_DIRECTORY") UPLOAD_URL = env.str("UPLOAD_URL") MAX_CONTENT_LENGTH = 5 * 1024 * 1024 # 5MB (limits file uploads, raises RequestEntityTooLarge) diff --git a/backend/grant/utils/auth.py b/backend/grant/utils/auth.py index 76e4cf2d..bdf71480 100644 --- a/backend/grant/utils/auth.py +++ b/backend/grant/utils/auth.py @@ -6,6 +6,7 @@ import requests from flask import request, g, jsonify from itsdangerous import SignatureExpired, BadSignature from itsdangerous import TimedJSONWebSignatureSerializer as Serializer +import sentry_sdk from grant.settings import SECRET_KEY, AUTH_URL from ..proposal.models import Proposal @@ -69,6 +70,10 @@ def requires_sm(f): return jsonify(message="No user exists with address: {}".format(auth_address)), 401 g.current_user = user + with sentry_sdk.configure_scope() as scope: + scope.user = { + "id": user.id, + } return f(*args, **kwargs) return jsonify(message="Authentication is required to access this resource"), 401 diff --git a/backend/requirements/prod.txt b/backend/requirements/prod.txt index 6e59c149..0e4cb1fa 100644 --- a/backend/requirements/prod.txt +++ b/backend/requirements/prod.txt @@ -60,3 +60,6 @@ flask-yolo2API==0.2.6 #web3 flask-web3==0.1.1 web3==4.8.1 + +#sentry +sentry-sdk[flask]==0.5.5 \ No newline at end of file diff --git a/frontend/.envexample b/frontend/.envexample index 9e4b4151..74862750 100644 --- a/frontend/.envexample +++ b/frontend/.envexample @@ -7,5 +7,11 @@ NO_DEV_TS_CHECK=true # Set the public host url (no trailing slash) PUBLIC_HOST_URL=https://demo.grant.io + +# sentry +SENTRY_DSN="https://PUBLICKEY@sentry.io/PROJECTID" +SENTRY_RELEASE="optional, overrides git hash" + CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" -CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" \ No newline at end of file +CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" + diff --git a/frontend/client/index.tsx b/frontend/client/index.tsx index 1fc82772..ae28e77c 100644 --- a/frontend/client/index.tsx +++ b/frontend/client/index.tsx @@ -6,12 +6,19 @@ import { loadComponents } from 'loadable-components'; import { Provider } from 'react-redux'; import { BrowserRouter as Router } from 'react-router-dom'; import { PersistGate } from 'redux-persist/integration/react'; +import * as Sentry from '@sentry/browser'; import { I18nextProvider } from 'react-i18next'; import { configureStore } from 'store/configure'; import { massageSerializedState } from 'utils/api'; import Routes from './Routes'; import i18n from './i18n'; + +Sentry.init({ + dsn: process.env.SENTRY_DSN, + release: process.env.SENTRY_RELEASE, + environment: process.env.NODE_ENV, +}); const initialState = window && massageSerializedState((window as any).__PRELOADED_STATE__); const { store, persistor } = configureStore(initialState); diff --git a/frontend/client/modules/auth/actions.ts b/frontend/client/modules/auth/actions.ts index 9b39b128..1e803745 100644 --- a/frontend/client/modules/auth/actions.ts +++ b/frontend/client/modules/auth/actions.ts @@ -1,5 +1,6 @@ import types from './types'; import { Dispatch } from 'redux'; +import * as Sentry from '@sentry/browser'; import { sleep } from 'utils/helpers'; import { generateAuthSignatureData } from 'utils/auth'; import { AppState } from 'store/reducers'; @@ -37,7 +38,13 @@ export function authUser(address: string, authSignature?: Falsy | AuthSignatureD signedMessage: authSignature.signedMessage, rawTypedData: JSON.stringify(authSignature.rawTypedData), }); - + // sentry user scope + Sentry.configureScope(scope => { + scope.setUser({ + email: res.data.emailAddress, + accountAddress: res.data.ethAddress, + }); + }); dispatch({ type: types.AUTH_USER_FULFILLED, payload: { diff --git a/frontend/config/env.js b/frontend/config/env.js index be0d9e43..717ad9be 100644 --- a/frontend/config/env.js +++ b/frontend/config/env.js @@ -1,9 +1,15 @@ const fs = require('fs'); const path = require('path'); const paths = require('./paths'); +const childProcess = require('child_process'); delete require.cache[require.resolve('./paths')]; +const gitRevisionShortHash = childProcess + .execSync('git rev-parse --short HEAD') + .toString() + .trim(); + if (!process.env.NODE_ENV) { throw new Error( 'The process.env.NODE_ENV environment variable is required but was not specified.', @@ -54,6 +60,10 @@ if (!process.env.BACKEND_URL) { process.env.BACKEND_URL = 'http://localhost:5000'; } +if (!process.env.SENTRY_RELEASE) { + process.env.SENTRY_RELEASE = gitRevisionShortHash; +} + const appDirectory = fs.realpathSync(process.cwd()); process.env.NODE_PATH = (process.env.NODE_PATH || '') .split(path.delimiter) @@ -67,6 +77,8 @@ module.exports = () => { NODE_ENV: process.env.NODE_ENV || 'development', PORT: process.env.PORT || 3000, PUBLIC_HOST_URL: process.env.PUBLIC_HOST_URL, + SENTRY_DSN: process.env.SENTRY_DSN || null, + SENTRY_RELEASE: process.env.SENTRY_RELEASE, }; // Stringify all values so we can feed into Webpack DefinePlugin diff --git a/frontend/package.json b/frontend/package.json index d4fb59f1..b7ea7db7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -45,6 +45,8 @@ "@babel/register": "^7.0.0", "@ledgerhq/hw-app-eth": "4.23.0", "@ledgerhq/hw-transport-u2f": "4.21.0", + "@sentry/browser": "^4.3.2", + "@sentry/node": "^4.3.2", "@svgr/webpack": "^2.4.0", "@types/classnames": "^2.2.6", "@types/cors": "^2.8.4", diff --git a/frontend/server/index.tsx b/frontend/server/index.tsx index 7e6e4e4d..a7773bd2 100644 --- a/frontend/server/index.tsx +++ b/frontend/server/index.tsx @@ -6,6 +6,7 @@ import manifestHelpers from 'express-manifest-helpers'; import * as bodyParser from 'body-parser'; import expressWinston from 'express-winston'; import i18nMiddleware from 'i18next-express-middleware'; +import * as Sentry from '@sentry/node'; import '../config/env'; // @ts-ignore @@ -17,8 +18,17 @@ import i18n from './i18n'; process.env.SERVER_SIDE_RENDER = 'true'; const isDev = process.env.NODE_ENV === 'development'; +Sentry.init({ + dsn: process.env.SENTRY_DSN, + release: process.env.SENTRY_RELEASE, + environment: process.env.NODE_ENV, +}); + const app = express(); +// sentry +app.use(Sentry.Handlers.requestHandler()); + // log requests app.use(expressWinston.logger({ winstonInstance: log })); @@ -59,6 +69,7 @@ app.use( app.use(serverRender()); +app.use(Sentry.Handlers.errorHandler()); app.use(expressWinston.errorLogger({ winstonInstance: log })); app.listen(process.env.PORT || 3000, () => { diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 1ad8dd0f..8155de23 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -1612,6 +1612,60 @@ dependencies: any-observable "^0.3.0" +"@sentry/browser@^4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-4.3.2.tgz#430b83583c5c25d33041dd80bf6ed19216086f70" + dependencies: + "@sentry/core" "4.3.2" + "@sentry/types" "4.3.2" + "@sentry/utils" "4.3.2" + +"@sentry/core@4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-4.3.2.tgz#e8a2850a11316d865ed7d3030ee2c4a1608bb1d8" + dependencies: + "@sentry/hub" "4.3.2" + "@sentry/minimal" "4.3.2" + "@sentry/types" "4.3.2" + "@sentry/utils" "4.3.2" + +"@sentry/hub@4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-4.3.2.tgz#1ea10038e2080035d2bc09f5f26829cd106a1516" + dependencies: + "@sentry/types" "4.3.2" + "@sentry/utils" "4.3.2" + +"@sentry/minimal@4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-4.3.2.tgz#c0958e5858b2105a6a0b523787e459a03af603cc" + dependencies: + "@sentry/hub" "4.3.2" + "@sentry/types" "4.3.2" + +"@sentry/node@^4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-4.3.2.tgz#3c7cd3aff238f3b1eb3252147b963cbdf520aa45" + dependencies: + "@sentry/core" "4.3.2" + "@sentry/hub" "4.3.2" + "@sentry/types" "4.3.2" + "@sentry/utils" "4.3.2" + cookie "0.3.1" + lsmod "1.0.0" + md5 "2.2.1" + stack-trace "0.0.10" + +"@sentry/types@4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-4.3.2.tgz#28b143979482fcbc9f9e520250482dde015b13fa" + +"@sentry/utils@4.3.2": + version "4.3.2" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-4.3.2.tgz#de14046eba972af9d62508f78cd998b0352d634a" + dependencies: + "@sentry/types" "4.3.2" + "@storybook/addons@4.0.0-alpha.22": version "4.0.0-alpha.22" resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-4.0.0-alpha.22.tgz#08d89396fff216c0d5aa305f7ac851b6bc34b6cf" @@ -4105,6 +4159,10 @@ chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + check-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -4812,6 +4870,10 @@ cross-spawn@^3.0.0: lru-cache "^4.0.1" which "^1.2.9" +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + cryptiles@3.x.x: version "3.1.2" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" @@ -8082,7 +8144,7 @@ is-boolean-object@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" -is-buffer@^1.0.2, is-buffer@^1.1.5: +is-buffer@^1.0.2, is-buffer@^1.1.5, is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -9658,6 +9720,10 @@ lru-cache@^4.1.1, lru-cache@^4.1.2, lru-cache@^4.1.3: pseudomap "^1.0.2" yallist "^2.1.2" +lsmod@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lsmod/-/lsmod-1.0.0.tgz#9a00f76dca36eb23fa05350afe1b585d4299e64b" + make-dir@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" @@ -9751,6 +9817,14 @@ md5.js@^1.3.4: hash-base "^3.0.0" inherits "^2.0.1" +md5@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + mdn-data@~1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" @@ -14230,7 +14304,7 @@ stable@~0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/stable/-/stable-0.1.8.tgz#836eb3c8382fe2936feaf544631017ce7d47a3cf" -stack-trace@0.0.x: +stack-trace@0.0.10, stack-trace@0.0.x: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" From 8a97142d822a984d5d688e79730dc74d4859ab87 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Thu, 22 Nov 2018 15:42:07 -0600 Subject: [PATCH 16/17] Avoid childprocess until neccesasary --- frontend/config/env.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/frontend/config/env.js b/frontend/config/env.js index 717ad9be..34af2c06 100644 --- a/frontend/config/env.js +++ b/frontend/config/env.js @@ -5,11 +5,6 @@ const childProcess = require('child_process'); delete require.cache[require.resolve('./paths')]; -const gitRevisionShortHash = childProcess - .execSync('git rev-parse --short HEAD') - .toString() - .trim(); - if (!process.env.NODE_ENV) { throw new Error( 'The process.env.NODE_ENV environment variable is required but was not specified.', @@ -61,7 +56,10 @@ if (!process.env.BACKEND_URL) { } if (!process.env.SENTRY_RELEASE) { - process.env.SENTRY_RELEASE = gitRevisionShortHash; + process.env.SENTRY_RELEASE = childProcess + .execSync('git rev-parse --short HEAD') + .toString() + .trim(); } const appDirectory = fs.realpathSync(process.cwd()); From 00219e65c8064ff27b8485cf646f78b3b85688cf Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Sun, 25 Nov 2018 22:02:35 -0600 Subject: [PATCH 17/17] Only Runtime Contracts (#225) --- .travis.yml | 5 +- backend/.env.example | 10 +++- backend/grant/app.py | 5 +- backend/grant/proposal/views.py | 17 ++++-- backend/grant/settings.py | 8 ++- backend/grant/web3/__init__.py | 1 + backend/grant/web3/dev_contracts.py | 19 +++++++ backend/grant/web3/proposal.py | 26 ++++----- backend/tests/web3/test_proposal_read.py | 19 ++----- contract/.nvmrc | 1 + frontend/.envexample | 11 +++- frontend/bin/truffle-util.js | 55 +++++++++++++++---- frontend/client/lib/crowdFundContracts.ts | 6 +- frontend/client/lib/getContract.ts | 6 +- frontend/client/modules/web3/sagas.ts | 8 +-- frontend/config/env.js | 28 +++++----- .../module-dependency-warning.js | 2 +- frontend/package.json | 8 +-- frontend/yarn.lock | 9 +-- 19 files changed, 146 insertions(+), 98 deletions(-) create mode 100644 backend/grant/web3/dev_contracts.py create mode 100644 contract/.nvmrc diff --git a/.travis.yml b/.travis.yml index 762c72c2..4ac831d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ matrix: - language: node_js node_js: 8.13.0 before_install: - - cd frontend/ + - cd frontend install: yarn script: - yarn run lint @@ -16,8 +16,7 @@ matrix: - cd backend/ - cp .env.example .env env: - - FLASK_APP=app.py FLASK_DEBUG=1 CROWD_FUND_URL=https://eip-712.herokuapp.com/contract/crowd-fund - CROWD_FUND_FACTORY_URL=https://eip-712.herokuapp.com/contract/factory + - CROWD_FUND_URL=https://eip-712.herokuapp.com/contract/crowd-fund CROWD_FUND_FACTORY_URL=https://eip-712.herokuapp.com/contract/factory install: pip install -r requirements/dev.txt script: - flask test diff --git a/backend/.env.example b/backend/.env.example index 40df3430..bbeced82 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -6,12 +6,18 @@ DATABASE_URL="sqlite:////tmp/dev.db" REDISTOGO_URL="redis://localhost:6379" SECRET_KEY="not-so-secret" SENDGRID_API_KEY="optional, but emails won't send without it" + # for ropsten use the following # ETHEREUM_ENDPOINT_URI = "https://ropsten.infura.io/API_KEY" ETHEREUM_ENDPOINT_URI = "http://localhost:8545" -CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" -CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" + +# CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" +# CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" +CROWD_FUND_URL = "http://localhost:5000/dev-contracts/CrowdFund.json" +CROWD_FUND_FACTORY_URL = "http://localhost:5000/dev-contracts/CrowdFundFactory.json" + # SENTRY_DSN="https://PUBLICKEY@sentry.io/PROJECTID" # SENTRY_RELEASE="optional, overrides git hash" + UPLOAD_DIRECTORY = "/tmp" UPLOAD_URL = "http://localhost:5000" # for constructing download url diff --git a/backend/grant/app.py b/backend/grant/app.py index 35628322..03bc26f3 100644 --- a/backend/grant/app.py +++ b/backend/grant/app.py @@ -5,7 +5,7 @@ from flask_cors import CORS from sentry_sdk.integrations.flask import FlaskIntegration import sentry_sdk -from grant import commands, proposal, user, comment, milestone, admin, email +from grant import commands, proposal, user, comment, milestone, admin, email, web3 as web3module from grant.extensions import bcrypt, migrate, db, ma, mail, web3 from grant.settings import SENTRY_RELEASE, ENV @@ -46,6 +46,9 @@ def register_blueprints(app): app.register_blueprint(milestone.views.blueprint) app.register_blueprint(admin.views.blueprint) app.register_blueprint(email.views.blueprint) + # Only add these routes locally + if ENV == 'development': + app.register_blueprint(web3module.dev_contracts.blueprint) def register_shellcontext(app): diff --git a/backend/grant/proposal/views.py b/backend/grant/proposal/views.py index 3d2e0e39..0aaa5a61 100644 --- a/backend/grant/proposal/views.py +++ b/backend/grant/proposal/views.py @@ -19,6 +19,7 @@ from .models import( proposal_contribution_schema, db ) +import traceback blueprint = Blueprint("proposal", __name__, url_prefix="/api/v1/proposals") @@ -88,12 +89,16 @@ def get_proposals(stage): else: proposals = Proposal.query.order_by(Proposal.date_created.desc()).all() dumped_proposals = proposals_schema.dump(proposals) - for p in dumped_proposals: - proposal_contract = read_proposal(p['proposal_address']) - p['crowd_fund'] = proposal_contract - filtered_proposals = list(filter(lambda p: p['crowd_fund'] is not None, dumped_proposals)) - return filtered_proposals - + try: + for p in dumped_proposals: + proposal_contract = read_proposal(p['proposal_address']) + p['crowd_fund'] = proposal_contract + filtered_proposals = list(filter(lambda p: p['crowd_fund'] is not None, dumped_proposals)) + return filtered_proposals + except Exception as e: + print(e) + print(traceback.format_exc()) + return {"message": "Oops! Something went wrong."}, 500 @blueprint.route("/", methods=["POST"]) @requires_sm diff --git a/backend/grant/settings.py b/backend/grant/settings.py index 210b5642..11b14a5e 100644 --- a/backend/grant/settings.py +++ b/backend/grant/settings.py @@ -9,7 +9,11 @@ environment variables. import subprocess from environs import Env -git_revision_short_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) +def git_revision_short_hash(): + try: + return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']) + except subprocess.CalledProcessError: + return 0 env = Env() env.read_env() @@ -33,7 +37,7 @@ SENDGRID_DEFAULT_FROM = "noreply@grant.io" ETHEREUM_PROVIDER = "http" ETHEREUM_ENDPOINT_URI = env.str("ETHEREUM_ENDPOINT_URI") SENTRY_DSN = env.str("SENTRY_DSN", default=None) -SENTRY_RELEASE = env.str("SENTRY_RELEASE", default=git_revision_short_hash) +SENTRY_RELEASE = env.str("SENTRY_RELEASE", default=git_revision_short_hash()) UPLOAD_DIRECTORY = env.str("UPLOAD_DIRECTORY") UPLOAD_URL = env.str("UPLOAD_URL") MAX_CONTENT_LENGTH = 5 * 1024 * 1024 # 5MB (limits file uploads, raises RequestEntityTooLarge) diff --git a/backend/grant/web3/__init__.py b/backend/grant/web3/__init__.py index e69de29b..dc348e3a 100644 --- a/backend/grant/web3/__init__.py +++ b/backend/grant/web3/__init__.py @@ -0,0 +1 @@ +from . import dev_contracts \ No newline at end of file diff --git a/backend/grant/web3/dev_contracts.py b/backend/grant/web3/dev_contracts.py new file mode 100644 index 00000000..465930bf --- /dev/null +++ b/backend/grant/web3/dev_contracts.py @@ -0,0 +1,19 @@ +import json + +from flask import Blueprint, jsonify + +blueprint = Blueprint('dev-contracts', __name__, url_prefix='/dev-contracts') + + +@blueprint.route("/CrowdFundFactory.json", methods=["GET"]) +def factory(): + with open("../contract/build/contracts/CrowdFundFactory.json", "r") as read_file: + crowd_fund_factory_json = json.load(read_file) + return jsonify(crowd_fund_factory_json) + + +@blueprint.route("/CrowdFund.json", methods=["GET"]) +def crowd_find(): + with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: + crowd_fund_json = json.load(read_file) + return jsonify(crowd_fund_json) diff --git a/backend/grant/web3/proposal.py b/backend/grant/web3/proposal.py index b67c36cc..c1868977 100644 --- a/backend/grant/web3/proposal.py +++ b/backend/grant/web3/proposal.py @@ -1,10 +1,10 @@ -import json import time -from flask_web3 import current_web3 -from .util import batch_call, call_array, RpcError -import requests -from grant.settings import CROWD_FUND_URL +import requests +from flask_web3 import current_web3 + +from grant.settings import CROWD_FUND_URL +from .util import batch_call, call_array, RpcError crowd_fund_abi = None @@ -14,19 +14,14 @@ def get_crowd_fund_abi(): if crowd_fund_abi: return crowd_fund_abi - if CROWD_FUND_URL: - crowd_fund_json = requests.get(CROWD_FUND_URL).json() - crowd_fund_abi = crowd_fund_json['abi'] - return crowd_fund_abi - - with open("../contract/build/contracts/CrowdFund.json", "r") as read_file: - crowd_fund_abi = json.load(read_file)['abi'] - return crowd_fund_abi - + crowd_fund_json = requests.get(CROWD_FUND_URL).json() + crowd_fund_abi = crowd_fund_json['abi'] + return crowd_fund_abi def read_proposal(address): - current_web3.eth.defaultAccount = current_web3.eth.accounts[0] + current_web3.eth.defaultAccount = '0x537680D921C000fC52Af9962ceEb4e359C50F424' if not current_web3.eth.accounts else \ + current_web3.eth.accounts[0] crowd_fund_abi = get_crowd_fund_abi() contract = current_web3.eth.contract(address=address, abi=crowd_fund_abi) @@ -106,6 +101,7 @@ def read_proposal(address): def get_no_vote(i): return derived_results['getContributorMilestoneVote' + contrib_address + str(i)] + no_votes = list(map(get_no_vote, range(len(crowd_fund['milestones'])))) contrib = { diff --git a/backend/tests/web3/test_proposal_read.py b/backend/tests/web3/test_proposal_read.py index 344d5282..634da15f 100644 --- a/backend/tests/web3/test_proposal_read.py +++ b/backend/tests/web3/test_proposal_read.py @@ -1,14 +1,14 @@ -import json import time import eth_tester.backends.pyevm.main as py_evm_main +import requests from flask_web3 import current_web3 + from grant.extensions import web3 from grant.settings import CROWD_FUND_URL, CROWD_FUND_FACTORY_URL from grant.web3.proposal import read_proposal - from ..config import BaseTestConfig -import requests + # increase gas limit on eth-tester # https://github.com/ethereum/web3.py/issues/1013 # https://gitter.im/ethereum/py-evm?at=5b7eb68c4be56c5918854337 @@ -24,17 +24,8 @@ class TestWeb3ProposalRead(BaseTestConfig): BaseTestConfig.setUp(self) # the following will properly configure web3 with test config web3.init_app(self.real_app) - if CROWD_FUND_FACTORY_URL: - crowd_fund_factory_json = requests.get(CROWD_FUND_FACTORY_URL).json() - else: - with open("../frontend/client/lib/contracts/CrowdFundFactory.json", "r") as read_file: - crowd_fund_factory_json = json.load(read_file) - - if CROWD_FUND_URL: - self.crowd_fund_json = requests.get(CROWD_FUND_URL).json() - else: - with open("../frontend/client/lib/contracts/CrowdFund.json", "r") as read_file: - self.crowd_fund_json = json.load(read_file) + crowd_fund_factory_json = requests.get(CROWD_FUND_FACTORY_URL).json() + self.crowd_fund_json = requests.get(CROWD_FUND_URL).json() current_web3.eth.defaultAccount = current_web3.eth.accounts[0] CrowdFundFactory = current_web3.eth.contract( abi=crowd_fund_factory_json['abi'], bytecode=crowd_fund_factory_json['bytecode']) diff --git a/contract/.nvmrc b/contract/.nvmrc new file mode 100644 index 00000000..85943544 --- /dev/null +++ b/contract/.nvmrc @@ -0,0 +1 @@ +8.13.0 \ No newline at end of file diff --git a/frontend/.envexample b/frontend/.envexample index 74862750..6c76bffc 100644 --- a/frontend/.envexample +++ b/frontend/.envexample @@ -4,14 +4,19 @@ FUND_ETH_ADDRESSES=0x4bbeEB066eD09B7AEd07bF39EEe0460DFa261520,0xDECAF9CD2367cdbb # Disable typescript checking for dev building (reduce build time & resource usage) NO_DEV_TS_CHECK=true +NODE_ENV=development + # Set the public host url (no trailing slash) PUBLIC_HOST_URL=https://demo.grant.io +BACKEND_URL=http://localhost:5000 # sentry -SENTRY_DSN="https://PUBLICKEY@sentry.io/PROJECTID" +SENTRY_DSN=https://PUBLICKEY@sentry.io/PROJECTID SENTRY_RELEASE="optional, overrides git hash" -CROWD_FUND_URL = "https://eip-712.herokuapp.com/contract/crowd-fund" -CROWD_FUND_FACTORY_URL = "https://eip-712.herokuapp.com/contract/factory" +# CROWD_FUND_URL=https://eip-712.herokuapp.com/contract/crowd-fund +# CROWD_FUND_FACTORY_URL=https://eip-712.herokuapp.com/contract/factory +CROWD_FUND_URL=http://localhost:5000/dev-contracts/CrowdFund.json +CROWD_FUND_FACTORY_URL=http://localhost:5000/dev-contracts/CrowdFundFactory.json \ No newline at end of file diff --git a/frontend/bin/truffle-util.js b/frontend/bin/truffle-util.js index 8ddca4b4..203632e3 100644 --- a/frontend/bin/truffle-util.js +++ b/frontend/bin/truffle-util.js @@ -12,16 +12,30 @@ require('../config/env'); module.exports = {}; +const CHECK_CONTRACT_IDS = ['CrowdFundFactory.json'] + const clean = (module.exports.clean = () => { rimraf.sync(paths.contractsBuild); }); const compile = (module.exports.compile = () => { - childProcess.execSync('yarn build', { cwd: paths.contractsBase }); + logMessage('truffle compile, please wait...', 'info'); + try { + childProcess.execSync('yarn build', { cwd: paths.contractsBase }); + } catch (e) { + logMessage(e.stdout.toString('utf8'), 'error'); + process.exit(1); + } }); const migrate = (module.exports.migrate = () => { - childProcess.execSync('truffle migrate', { cwd: paths.contractsBase }); + logMessage('truffle migrate, please wait...', 'info'); + try { + childProcess.execSync('truffle migrate', { cwd: paths.contractsBase }); + } catch (e) { + logMessage(e.stdout.toString('utf8'), 'error'); + process.exit(1); + } }); const makeWeb3Conn = () => { @@ -62,20 +76,41 @@ const getGanacheNetworkId = (module.exports.getGanacheNetworkId = () => { .catch(() => -1); }); -const checkContractsNetworkIds = (module.exports.checkContractsNetworkIds = id => +const checkContractsNetworkIds = (module.exports.checkContractsNetworkIds = ( + id, + retry = false, +) => new Promise((res, rej) => { const buildDir = paths.contractsBuild; - fs.readdir(buildDir, (err, names) => { + fs.readdir(buildDir, (err) => { if (err) { logMessage(`No contracts build directory @ ${buildDir}`, 'error'); res(false); } else { - const allHaveId = names.reduce((ok, name) => { + const allHaveId = CHECK_CONTRACT_IDS.reduce((ok, name) => { const contract = require(path.join(buildDir, name)); - if (Object.keys(contract.networks).length > 0 && !contract.networks[id]) { - const actual = Object.keys(contract.networks).join(', '); - logMessage(`${name} should have networks[${id}], it has ${actual}`, 'error'); - return false; + const contractHasKeys = Object.keys(contract.networks).length > 0; + if (!contractHasKeys) { + if (retry) { + logMessage( + 'Contract does not contain network keys after retry. Exiting. Please manually debug Contract JSON.', + 'error', + ); + process.exit(1); + } else { + logMessage('Contract does not contain any keys. Will migrate.'); + migrate(); + return checkContractsNetworkIds(id, true); + } + } else { + if (contractHasKeys && !contract.networks[id]) { + const actual = Object.keys(contract.networks).join(', '); + logMessage( + `${name} should have networks[${id}], it has ${actual}`, + 'error', + ); + return false; + } } return true && ok; }, true); @@ -128,9 +163,7 @@ module.exports.ethereumCheck = () => if (!allHaveId) { logMessage('Contract problems, will compile & migrate.', 'warning'); clean(); - logMessage('truffle compile, please wait...', 'info'); compile(); - logMessage('truffle migrate, please wait...', 'info'); migrate(); fundWeb3v1(); } else { diff --git a/frontend/client/lib/crowdFundContracts.ts b/frontend/client/lib/crowdFundContracts.ts index 679765a9..cd8d420c 100644 --- a/frontend/client/lib/crowdFundContracts.ts +++ b/frontend/client/lib/crowdFundContracts.ts @@ -10,11 +10,7 @@ export async function getCrowdFundContract(web3: Web3 | null, deployedAddress: s } if (!contractCache[deployedAddress]) { let CrowdFund; - if (process.env.CROWD_FUND_FACTORY_URL) { - CrowdFund = await fetchCrowdFundJSON(); - } else { - CrowdFund = await import('./contracts/CrowdFund.json'); - } + CrowdFund = await fetchCrowdFundJSON(); try { contractCache[deployedAddress] = await getContractInstance( web3, diff --git a/frontend/client/lib/getContract.ts b/frontend/client/lib/getContract.ts index 67dcf31a..58cccd80 100644 --- a/frontend/client/lib/getContract.ts +++ b/frontend/client/lib/getContract.ts @@ -10,7 +10,11 @@ const getContractInstance = async ( // get network ID and the deployed address const networkId = await web3.eth.net.getId(); if (!deployedAddress && !contractDefinition.networks[networkId]) { - throw new WrongNetworkError('Wrong web3 network configured'); + throw new WrongNetworkError( + `Wrong web3 network configured. Deployed address: ${deployedAddress}; networkId: ${networkId}, contractDefinitionNetworks: ${JSON.stringify( + contractDefinition.networks, + )}`, + ); } deployedAddress = deployedAddress || contractDefinition.networks[networkId].address; diff --git a/frontend/client/modules/web3/sagas.ts b/frontend/client/modules/web3/sagas.ts index 01bbea98..95ce1765 100644 --- a/frontend/client/modules/web3/sagas.ts +++ b/frontend/client/modules/web3/sagas.ts @@ -6,18 +6,12 @@ import { safeEnable } from 'utils/web3'; import types from './types'; import { fetchCrowdFundFactoryJSON } from 'api/api'; -/* tslint:disable no-var-requires --- TODO: find a better way to import contract */ -let CrowdFundFactory = require('lib/contracts/CrowdFundFactory.json'); - export function* bootstrapWeb3(): SagaIterator { // Don't attempt to bootstrap web3 on SSR if (process.env.SERVER_SIDE_RENDER) { return; } - if (process.env.CROWD_FUND_FACTORY_URL) { - CrowdFundFactory = yield call(fetchCrowdFundFactoryJSON); - } - + const CrowdFundFactory = yield call(fetchCrowdFundFactoryJSON); yield put(setWeb3()); yield take(types.WEB3_FULFILLED); diff --git a/frontend/config/env.js b/frontend/config/env.js index 34af2c06..e45f5050 100644 --- a/frontend/config/env.js +++ b/frontend/config/env.js @@ -2,6 +2,8 @@ const fs = require('fs'); const path = require('path'); const paths = require('./paths'); const childProcess = require('child_process'); +const dotenv = require('dotenv'); +const { logMessage } = require('../bin/utils'); delete require.cache[require.resolve('./paths')]; @@ -11,21 +13,17 @@ if (!process.env.NODE_ENV) { ); } -// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use -const dotenvFiles = [ - `${paths.dotenv}.${process.env.NODE_ENV}.local`, - `${paths.dotenv}.${process.env.NODE_ENV}`, - process.env.NODE_ENV !== 'test' && `${paths.dotenv}.local`, - paths.dotenv, -].filter(Boolean); - -dotenvFiles.forEach(dotenvFile => { - if (fs.existsSync(dotenvFile)) { - require('dotenv').config({ - path: dotenvFile, - }); +// Override local ENV variables with .env +if (fs.existsSync(paths.dotenv)) { + const envConfig = dotenv.parse(fs.readFileSync(paths.dotenv)); + // tslint:disable-next-line + for (const k in envConfig) { + if (process.env[k]) { + logMessage(`Warning! Over-writing existing ENV Variable ${k}`); + } + process.env[k] = envConfig[k]; } -}); +} const envProductionRequiredHandler = (envVariable, fallbackValue) => { if (!process.env[envVariable]) { @@ -72,6 +70,8 @@ process.env.NODE_PATH = (process.env.NODE_PATH || '') module.exports = () => { const raw = { BACKEND_URL: process.env.BACKEND_URL, + CROWD_FUND_FACTORY_URL: process.env.CROWD_FUND_FACTORY_URL, + CROWD_FUND_URL: process.env.CROWD_FUND_URL, NODE_ENV: process.env.NODE_ENV || 'development', PORT: process.env.PORT || 3000, PUBLIC_HOST_URL: process.env.PUBLIC_HOST_URL, diff --git a/frontend/config/webpack.config.js/module-dependency-warning.js b/frontend/config/webpack.config.js/module-dependency-warning.js index f1b49560..dd1e5da5 100644 --- a/frontend/config/webpack.config.js/module-dependency-warning.js +++ b/frontend/config/webpack.config.js/module-dependency-warning.js @@ -1,6 +1,6 @@ const ModuleDependencyWarning = require('webpack/lib/ModuleDependencyWarning'); -// supress unfortunate warnings due to transpileOnly=true and certain ts export patterns +// suppress unfortunate warnings due to transpileOnly=true and certain ts export patterns // https://github.com/TypeStrong/ts-loader/issues/653#issuecomment-390889335 // https://github.com/TypeStrong/ts-loader/issues/751 diff --git a/frontend/package.json b/frontend/package.json index b7ea7db7..9f22ce6e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,10 +4,9 @@ "main": "index.js", "license": "MIT", "scripts": { - "analyze": "NODE_ENV=production ANALYZE=true next build ./client", - "build": "cross-env NODE_ENV=production node bin/build.js", - "dev": "rm -rf ./node_modules/.cache && cross-env NODE_ENV=development BACKEND_URL=http://localhost:5000 node bin/dev.js", - "lint": "tslint --project ./tsconfig.json --config ./tslint.json -e \"**/build/**\"", + "build": "node bin/build.js", + "dev": "rm -rf ./node_modules/.cache && node bin/dev.js", + "lint": "tslint --project ./tsconfig.json --config ./tslint.json -e \"**/build/**\" -e \"**/bin/**\"", "start": "NODE_ENV=production node ./build/server/server.js", "now": "npm run build && now -e BACKEND_URL=https://grant-stage.herokuapp.com", "heroku-postbuild": "yarn build", @@ -90,7 +89,6 @@ "copy-webpack-plugin": "^4.6.0", "core-js": "^2.5.7", "cors": "^2.8.4", - "cross-env": "^5.2.0", "css-loader": "^1.0.0", "dotenv": "^6.0.0", "ethereum-blockies-base64": "1.0.2", diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 8155de23..92f86eec 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4838,13 +4838,6 @@ cropperjs@v1.0.0-rc.3: version "1.0.0-rc.3" resolved "https://registry.yarnpkg.com/cropperjs/-/cropperjs-1.0.0-rc.3.tgz#50a7c7611befc442702f845ede77d7df4572e82b" -cross-env@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2" - dependencies: - cross-spawn "^6.0.5" - is-windows "^1.0.0" - cross-spawn@5.1.0, cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -8459,7 +8452,7 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"