UNPKG

tokenboost-solidity

Version:
1,532 lines 657 kB
{ "contractName": "Sale", "abi": [ { "constant": true, "inputs": [ { "name": "_interfaceId", "type": "bytes4" } ], "name": "supportsInterface", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "name", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "activated", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "InterfaceId_ERC165", "outputs": [ { "name": "", "type": "bytes4" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "whitepaperUrl", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "weiRaised", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "template", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "videoUrl", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "projectDescription", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "logoUrl", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "projectName", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "projectSummary", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "websiteUrl", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "withdrawn", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "InterfaceId_Sale", "outputs": [ { "name": "", "type": "bytes4" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "coverImageUrl", "outputs": [ { "name": "", "type": "string" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "InterfaceId_Contract", "outputs": [ { "name": "", "type": "bytes4" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "inputs": [ { "name": "_owner", "type": "address" }, { "name": "_projectName", "type": "string" }, { "name": "_name", "type": "string" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "payable": true, "stateMutability": "payable", "type": "fallback" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" } ], "name": "OwnershipRenounced", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "constant": false, "inputs": [ { "name": "_projectName", "type": "string" }, { "name": "_projectSummary", "type": "string" }, { "name": "_projectDescription", "type": "string" }, { "name": "_logoUrl", "type": "string" }, { "name": "_coverImageUrl", "type": "string" }, { "name": "_websiteUrl", "type": "string" }, { "name": "_whitepaperUrl", "type": "string" }, { "name": "_videoUrl", "type": "string" }, { "name": "_name", "type": "string" } ], "name": "update", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_template", "type": "address" }, { "name": "_bytecode", "type": "bytes" } ], "name": "addStrategy", "outputs": [], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": true, "inputs": [], "name": "numberOfStrategies", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "index", "type": "uint256" } ], "name": "strategyAt", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "numberOfActivatedStrategies", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "index", "type": "uint256" } ], "name": "activatedStrategyAt", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "activate", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "started", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "successful", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "finished", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_purchaser", "type": "address" } ], "name": "paymentOf", "outputs": [ { "name": "weiAmount", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "numberOfPurchasers", "outputs": [ { "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "_index", "type": "uint256" } ], "name": "purchaserAt", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "withdraw", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "claimRefund", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.4.24;\n\nimport \"zeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"../Contract.sol\";\nimport \"../Activatable.sol\";\nimport \"../template/strategy/sale/SaleStrategyTemplate.sol\";\nimport \"../strategy/sale/SaleStrategy.sol\";\n\ncontract Sale is Contract, Activatable {\n using SafeMath for uint;\n\n /**\n * @notice this.owner.selector ^ this.renounceOwnership.selector ^ this.transferOwnership.selector\n ^ this.template.selector ^ this.activate.selector\n ^ this.projectName.selector ^ this.projectSummary.selector ^ this.projectDescription.selector\n ^ this.logoUrl.selector ^ this.coverImageUrl.selector ^ this.websiteUrl.selector ^ this.whitepaperUrl.selector\n ^ this.videoUrl.selector ^ this.name.selector ^ this.weiRaised.selector ^ this.withdrawn.selector\n ^ this.started.selector ^ this.successful.selector ^ this.finished.selector\n ^ this.paymentOf.selector ^ this.update.selector ^ this.addStrategy.selector ^ this.numberOfStrategies.selector\n ^ this.strategyAt.selector ^ this.numberOfActivatedStrategies.selector ^ this.activatedStrategyAt.selector\n ^ this.withdraw.selector ^ this.claimRefund.selector ^ this.paymentOf.selector\n ^ this.numberOfPurchasers.selector ^ this.purchaserAt.selector\n */\n bytes4 public constant InterfaceId_Sale = 0x5efbb022;\n\n string public projectName;\n string public projectSummary;\n string public projectDescription;\n string public logoUrl;\n string public coverImageUrl;\n string public websiteUrl;\n string public whitepaperUrl;\n string public videoUrl;\n string public name;\n\n uint256 public weiRaised;\n bool public withdrawn;\n\n SaleStrategy[] strategies;\n SaleStrategy[] activatedStrategies;\n mapping(address => uint256) paymentOfPurchaser;\n address[] purchasers;\n\n constructor(\n address _owner,\n string _projectName,\n string _name\n ) public Contract(_owner) {\n projectName = _projectName;\n name = _name;\n\n _registerInterface(InterfaceId_Sale);\n }\n\n function update(\n string _projectName,\n string _projectSummary,\n string _projectDescription,\n string _logoUrl,\n string _coverImageUrl,\n string _websiteUrl,\n string _whitepaperUrl,\n string _videoUrl,\n string _name\n ) public onlyOwner whenNotActivated {\n projectName = _projectName;\n projectSummary = _projectSummary;\n projectDescription = _projectDescription;\n logoUrl = _logoUrl;\n coverImageUrl = _coverImageUrl;\n websiteUrl = _websiteUrl;\n whitepaperUrl = _whitepaperUrl;\n videoUrl = _videoUrl;\n name = _name;\n }\n\n function addStrategy(SaleStrategyTemplate _template, bytes _bytecode) onlyOwner whenNotActivated public payable {\n // InterfaceId_ERC165\n require(_template.supportsInterface(0x01ffc9a7));\n // InterfaceId_Template\n require(_template.supportsInterface(0xd48445ff));\n\n require(_isUniqueStrategy(_template));\n\n bytes memory args = abi.encode(msg.sender, address(this));\n SaleStrategy strategy = SaleStrategy(_template.instantiate.value(msg.value)(_bytecode, args));\n strategies.push(strategy);\n }\n\n function _isUniqueStrategy(SaleStrategyTemplate _template) private view returns (bool) {\n for (uint i = 0; i < strategies.length; i++) {\n SaleStrategy strategy = strategies[i];\n if (address(strategy.template()) == address(_template)) {\n return false;\n }\n }\n return true;\n }\n\n function numberOfStrategies() public view returns (uint256) {\n return strategies.length;\n }\n\n function strategyAt(uint256 index) public view returns (address) {\n return strategies[index];\n }\n\n function numberOfActivatedStrategies() public view returns (uint256) {\n return activatedStrategies.length;\n }\n\n function activatedStrategyAt(uint256 index) public view returns (address) {\n return activatedStrategies[index];\n }\n\n function activate() onlyOwner public returns (bool) {\n for (uint i = 0; i < strategies.length; i++) {\n SaleStrategy strategy = strategies[i];\n if (strategy.activated()) {\n activatedStrategies.push(strategy);\n }\n }\n return super.activate();\n }\n\n function started() public view returns (bool) {\n if (!activated) return false;\n\n bool s = false;\n for (uint i = 0; i < activatedStrategies.length; i++) {\n s = s || activatedStrategies[i].started();\n }\n return s;\n }\n\n function successful() public view returns (bool){\n if (!started()) return false;\n\n bool s = false;\n for (uint i = 0; i < activatedStrategies.length; i++) {\n s = s || activatedStrategies[i].successful();\n }\n return s;\n }\n\n function finished() public view returns (bool){\n if (!started()) return false;\n\n bool f = false;\n for (uint i = 0; i < activatedStrategies.length; i++) {\n f = f || activatedStrategies[i].finished();\n }\n return f;\n }\n\n function() external payable;\n\n function increasePaymentOf(address _purchaser, uint256 _weiAmount) internal {\n require(!finished());\n require(started());\n\n paymentOfPurchaser[_purchaser] = paymentOfPurchaser[_purchaser].add(_weiAmount);\n weiRaised = weiRaised.add(_weiAmount);\n for (uint i = 0; i < purchasers.length; i++) {\n if (purchasers[i] == _purchaser) {\n return;\n }\n }\n purchasers.push(_purchaser);\n }\n\n function paymentOf(address _purchaser) public view returns (uint256 weiAmount) {\n return paymentOfPurchaser[_purchaser];\n }\n\n function numberOfPurchasers() public view returns (uint256) {\n return purchasers.length;\n }\n\n function purchaserAt(uint256 _index) public view returns (address) {\n return purchasers[_index];\n }\n\n function withdraw() onlyOwner whenActivated public returns (bool) {\n require(!withdrawn);\n require(finished());\n require(successful());\n\n withdrawn = true;\n msg.sender.transfer(weiRaised);\n\n return true;\n }\n\n function claimRefund() whenActivated public returns (bool) {\n require(finished());\n require(!successful());\n\n uint256 amount = paymentOfPurchaser[msg.sender];\n require(amount > 0);\n\n paymentOfPurchaser[msg.sender] = 0;\n msg.sender.transfer(amount);\n\n return true;\n }\n}", "sourcePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/sale/Sale.sol", "ast": { "absolutePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/sale/Sale.sol", "exportedSymbols": { "Sale": [ 1352 ] }, "id": 1353, "nodeType": "SourceUnit", "nodes": [ { "id": 715, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:4" }, { "absolutePath": "zeppelin-solidity/contracts/math/SafeMath.sol", "file": "zeppelin-solidity/contracts/math/SafeMath.sol", "id": 716, "nodeType": "ImportDirective", "scope": 1353, "sourceUnit": 4799, "src": "26:55:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/Contract.sol", "file": "../Contract.sol", "id": 717, "nodeType": "ImportDirective", "scope": 1353, "sourceUnit": 90, "src": "82:25:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/Activatable.sol", "file": "../Activatable.sol", "id": 718, "nodeType": "ImportDirective", "scope": 1353, "sourceUnit": 34, "src": "108:28:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/template/strategy/sale/SaleStrategyTemplate.sol", "file": "../template/strategy/sale/SaleStrategyTemplate.sol", "id": 719, "nodeType": "ImportDirective", "scope": 1353, "sourceUnit": 1842, "src": "137:60:4", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "/Users/yoonjae/SolidityProjects/tokenboost-solidity/contracts/strategy/sale/SaleStrategy.sol", "file": "../strategy/sale/SaleStrategy.sol", "id": 720, "nodeType": "ImportDirective", "scope": 1353, "sourceUnit": 1485, "src": "198:43:4", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 721, "name": "Contract", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 89, "src": "260:8:4", "typeDescriptions": { "typeIdentifier": "t_contract$_Contract_$89", "typeString": "contract Contract" } }, "id": 722, "nodeType": "InheritanceSpecifier", "src": "260:8:4" }, { "arguments": null, "baseName": { "contractScope": null, "id": 723, "name": "Activatable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 33, "src": "270:11:4", "typeDescriptions": { "typeIdentifier": "t_contract$_Activatable_$33", "typeString": "contract Activatable" } }, "id": 724, "nodeType": "InheritanceSpecifier", "src": "270:11:4" } ], "contractDependencies": [ 33, 89, 4653, 4704, 4884 ], "contractKind": "contract", "documentation": null, "fullyImplemented": false, "id": 1352, "linearizedBaseContracts": [ 1352, 33, 89, 4704, 4653, 4884 ], "name": "Sale", "nodeType": "ContractDefinition", "nodes": [ { "id": 727, "libraryName": { "contractScope": null, "id": 725, "name": "SafeMath", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 4798, "src": "294:8:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SafeMath_$4798", "typeString": "library SafeMath" } }, "nodeType": "UsingForDirective", "src": "288:24:4", "typeName": { "id": 726, "name": "uint", "nodeType": "ElementaryTypeName", "src": "307:4:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, { "constant": true, "id": 730, "name": "InterfaceId_Sale", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1299:52:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" }, "typeName": { "id": 728, "name": "bytes4", "nodeType": "ElementaryTypeName", "src": "1299:6:4", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } }, "value": { "argumentTypes": null, "hexValue": "30783565666262303232", "id": 729, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1341:10:4", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_1593552930_by_1", "typeString": "int_const 1593552930" }, "value": "0x5efbb022" }, "visibility": "public" }, { "constant": false, "id": 732, "name": "projectName", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1358:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 731, "name": "string", "nodeType": "ElementaryTypeName", "src": "1358:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 734, "name": "projectSummary", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1389:28:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 733, "name": "string", "nodeType": "ElementaryTypeName", "src": "1389:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 736, "name": "projectDescription", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1423:32:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 735, "name": "string", "nodeType": "ElementaryTypeName", "src": "1423:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 738, "name": "logoUrl", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1461:21:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 737, "name": "string", "nodeType": "ElementaryTypeName", "src": "1461:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 740, "name": "coverImageUrl", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1488:27:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 739, "name": "string", "nodeType": "ElementaryTypeName", "src": "1488:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 742, "name": "websiteUrl", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1521:24:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 741, "name": "string", "nodeType": "ElementaryTypeName", "src": "1521:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 744, "name": "whitepaperUrl", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1551:27:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 743, "name": "string", "nodeType": "ElementaryTypeName", "src": "1551:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 746, "name": "videoUrl", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1584:22:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 745, "name": "string", "nodeType": "ElementaryTypeName", "src": "1584:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 748, "name": "name", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1612:18:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string" }, "typeName": { "id": 747, "name": "string", "nodeType": "ElementaryTypeName", "src": "1612:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 750, "name": "weiRaised", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1637:24:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 749, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1637:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 752, "name": "withdrawn", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1667:21:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 751, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1667:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "id": 755, "name": "strategies", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1695:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_SaleStrategy_$1484_$dyn_storage", "typeString": "contract SaleStrategy[]" }, "typeName": { "baseType": { "contractScope": null, "id": 753, "name": "SaleStrategy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1484, "src": "1695:12:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SaleStrategy_$1484", "typeString": "contract SaleStrategy" } }, "id": 754, "length": null, "nodeType": "ArrayTypeName", "src": "1695:14:4", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_SaleStrategy_$1484_$dyn_storage_ptr", "typeString": "contract SaleStrategy[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 758, "name": "activatedStrategies", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1726:34:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_SaleStrategy_$1484_$dyn_storage", "typeString": "contract SaleStrategy[]" }, "typeName": { "baseType": { "contractScope": null, "id": 756, "name": "SaleStrategy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1484, "src": "1726:12:4", "typeDescriptions": { "typeIdentifier": "t_contract$_SaleStrategy_$1484", "typeString": "contract SaleStrategy" } }, "id": 757, "length": null, "nodeType": "ArrayTypeName", "src": "1726:14:4", "typeDescriptions": { "typeIdentifier": "t_array$_t_contract$_SaleStrategy_$1484_$dyn_storage_ptr", "typeString": "contract SaleStrategy[]" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 762, "name": "paymentOfPurchaser", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1766:46:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "typeName": { "id": 761, "keyType": { "id": 759, "name": "address", "nodeType": "ElementaryTypeName", "src": "1774:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Mapping", "src": "1766:27:4", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_address_$_t_uint256_$", "typeString": "mapping(address => uint256)" }, "valueType": { "id": 760, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1785:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 765, "name": "purchasers", "nodeType": "VariableDeclaration", "scope": 1352, "src": "1818:20:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage", "typeString": "address[]" }, "typeName": { "baseType": { "id": 763, "name": "address", "nodeType": "ElementaryTypeName", "src": "1818:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 764, "length": null, "nodeType": "ArrayTypeName", "src": "1818:9:4", "typeDescriptions": { "typeIdentifier": "t_array$_t_address_$dyn_storage_ptr", "typeString": "address[]" } }, "value": null, "visibility": "internal" }, { "body": { "id": 789, "nodeType": "Block", "src": "1962:112:4", "statements": [ { "expression": { "argumentTypes": null, "id": 779, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 777, "name": "projectName", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 732, "src": "1972:11:4", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string storage ref" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 778, "name": "_projectName", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 769, "src": "1986:12:4", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "src": "1972:26:4", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string storage ref" } }, "id": 780, "nodeType": "ExpressionStatement", "src": "1972:26:4" }, { "expression": { "argumentTypes": null, "id": 783, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 781, "name": "name", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 748, "src": "2008:4:4", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string storage ref" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 782, "name": "_name", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 771, "src": "2015:5:4", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "src": "2008:12:4", "typeDescriptions": { "typeIdentifier": "t_string_storage", "typeString": "string storage ref" } }, "id": 784, "nodeType": "ExpressionStatement", "src": "2008:12:4" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 786, "name": "InterfaceId_Sale", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 730, "src": "2050:16:4", "typeDescriptions": { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes4", "typeString": "bytes4" } ], "id": 785, "name": "_registerInterface", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4703, "src": "2031:18:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_bytes4_$returns$__$", "typeString": "function (bytes4)" } }, "id": 787, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2031:36:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 788, "nodeType": "ExpressionStatement", "src": "2031:36:4" } ] }, "documentation": null, "id": 790, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 774, "name": "_owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 767, "src": "1954:6:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "id": 775, "modifierName": { "argumentTypes": null, "id": 773, "name": "Contract", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 89, "src": "1945:8:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Contract_$89_$", "typeString": "type(contract Contract)" } }, "nodeType": "ModifierInvocation", "src": "1945:16:4" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 772, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 767, "name": "_owner", "nodeType": "VariableDeclaration", "scope": 790, "src": "1866:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 766, "name": "address", "nodeType": "ElementaryTypeName", "src": "1866:7:4", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 769, "name": "_projectName", "nodeType": "VariableDeclaration", "scope": 790, "src": "1890:19:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 768, "name": "string", "nodeType": "ElementaryTypeName", "src": "1890:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 771, "name": "_name", "nodeType": "VariableDeclaration", "scope": 790, "src": "1919:12:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 770, "name": "string", "nodeType": "ElementaryTypeName", "src": "1919:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "stri