tokenboost-solidity-erc20sale
Version:
Solidity contracts for TokenBoost (ERC20Sale)
1,536 lines (1,535 loc) • 658 kB
JSON
{
"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": "tokenboost-solidity/contracts/sale/Sale.sol",
"ast": {
"absolutePath": "tokenboost-solidity/contracts/sale/Sale.sol",
"exportedSymbols": {
"Sale": [
1959
]
},
"id": 1960,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1322,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:8"
},
{
"absolutePath": "zeppelin-solidity/contracts/math/SafeMath.sol",
"file": "zeppelin-solidity/contracts/math/SafeMath.sol",
"id": 1323,
"nodeType": "ImportDirective",
"scope": 1960,
"sourceUnit": 5270,
"src": "26:55:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "tokenboost-solidity/contracts/Contract.sol",
"file": "../Contract.sol",
"id": 1324,
"nodeType": "ImportDirective",
"scope": 1960,
"sourceUnit": 1321,
"src": "82:25:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "tokenboost-solidity/contracts/Activatable.sol",
"file": "../Activatable.sol",
"id": 1325,
"nodeType": "ImportDirective",
"scope": 1960,
"sourceUnit": 1277,
"src": "108:28:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "tokenboost-solidity/contracts/template/strategy/sale/SaleStrategyTemplate.sol",
"file": "../template/strategy/sale/SaleStrategyTemplate.sol",
"id": 1326,
"nodeType": "ImportDirective",
"scope": 1960,
"sourceUnit": 2398,
"src": "137:60:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "tokenboost-solidity/contracts/strategy/sale/SaleStrategy.sol",
"file": "../strategy/sale/SaleStrategy.sol",
"id": 1327,
"nodeType": "ImportDirective",
"scope": 1960,
"sourceUnit": 2092,
"src": "198:43:8",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 1328,
"name": "Contract",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1320,
"src": "260:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Contract_$1320",
"typeString": "contract Contract"
}
},
"id": 1329,
"nodeType": "InheritanceSpecifier",
"src": "260:8:8"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 1330,
"name": "Activatable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1276,
"src": "270:11:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Activatable_$1276",
"typeString": "contract Activatable"
}
},
"id": 1331,
"nodeType": "InheritanceSpecifier",
"src": "270:11:8"
}
],
"contractDependencies": [
1276,
1320,
5124,
5175,
5355
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": false,
"id": 1959,
"linearizedBaseContracts": [
1959,
1276,
1320,
5175,
5124,
5355
],
"name": "Sale",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 1334,
"libraryName": {
"contractScope": null,
"id": 1332,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5269,
"src": "294:8:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$5269",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "288:24:8",
"typeName": {
"id": 1333,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "307:4:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": true,
"id": 1337,
"name": "InterfaceId_Sale",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1299:52:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
},
"typeName": {
"id": 1335,
"name": "bytes4",
"nodeType": "ElementaryTypeName",
"src": "1299:6:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
},
"value": {
"argumentTypes": null,
"hexValue": "30783565666262303232",
"id": 1336,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1341:10:8",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1593552930_by_1",
"typeString": "int_const 1593552930"
},
"value": "0x5efbb022"
},
"visibility": "public"
},
{
"constant": false,
"id": 1339,
"name": "projectName",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1358:25:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1338,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1358:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1341,
"name": "projectSummary",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1389:28:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1340,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1389:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1343,
"name": "projectDescription",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1423:32:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1342,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1423:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1345,
"name": "logoUrl",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1461:21:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1344,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1461:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1347,
"name": "coverImageUrl",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1488:27:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1346,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1488:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1349,
"name": "websiteUrl",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1521:24:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1348,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1521:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1351,
"name": "whitepaperUrl",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1551:27:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1350,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1551:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1353,
"name": "videoUrl",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1584:22:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1352,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1584:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1355,
"name": "name",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1612:18:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string"
},
"typeName": {
"id": 1354,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1612:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1357,
"name": "weiRaised",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1637:24:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1356,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1637:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1359,
"name": "withdrawn",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1667:21:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1358,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1667:4:8",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 1362,
"name": "strategies",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1695:25:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_SaleStrategy_$2091_$dyn_storage",
"typeString": "contract SaleStrategy[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1360,
"name": "SaleStrategy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2091,
"src": "1695:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SaleStrategy_$2091",
"typeString": "contract SaleStrategy"
}
},
"id": 1361,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1695:14:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_SaleStrategy_$2091_$dyn_storage_ptr",
"typeString": "contract SaleStrategy[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1365,
"name": "activatedStrategies",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1726:34:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_SaleStrategy_$2091_$dyn_storage",
"typeString": "contract SaleStrategy[]"
},
"typeName": {
"baseType": {
"contractScope": null,
"id": 1363,
"name": "SaleStrategy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2091,
"src": "1726:12:8",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SaleStrategy_$2091",
"typeString": "contract SaleStrategy"
}
},
"id": 1364,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1726:14:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_contract$_SaleStrategy_$2091_$dyn_storage_ptr",
"typeString": "contract SaleStrategy[]"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1369,
"name": "paymentOfPurchaser",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1766:46:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 1368,
"keyType": {
"id": 1366,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1774:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "1766:27:8",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 1367,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1785:7:8",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1372,
"name": "purchasers",
"nodeType": "VariableDeclaration",
"scope": 1959,
"src": "1818:20:8",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage",
"typeString": "address[]"
},
"typeName": {
"baseType": {
"id": 1370,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1818:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 1371,
"length": null,
"nodeType": "ArrayTypeName",
"src": "1818:9:8",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_address_$dyn_storage_ptr",
"typeString": "address[]"
}
},
"value": null,
"visibility": "internal"
},
{
"body": {
"id": 1396,
"nodeType": "Block",
"src": "1962:112:8",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1386,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1384,
"name": "projectName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1339,
"src": "1972:11:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1385,
"name": "_projectName",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1376,
"src": "1986:12:8",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "1972:26:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 1387,
"nodeType": "ExpressionStatement",
"src": "1972:26:8"
},
{
"expression": {
"argumentTypes": null,
"id": 1390,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1388,
"name": "name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1355,
"src": "2008:4:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 1389,
"name": "_name",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1378,
"src": "2015:5:8",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"src": "2008:12:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage",
"typeString": "string storage ref"
}
},
"id": 1391,
"nodeType": "ExpressionStatement",
"src": "2008:12:8"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1393,
"name": "InterfaceId_Sale",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1337,
"src": "2050:16:8",
"typeDescriptions": {
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes4",
"typeString": "bytes4"
}
],
"id": 1392,
"name": "_registerInterface",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5174,
"src": "2031:18:8",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_bytes4_$returns$__$",
"typeString": "function (bytes4)"
}
},
"id": 1394,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2031:36:8",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1395,
"nodeType": "ExpressionStatement",
"src": "2031:36:8"
}
]
},
"documentation": null,
"id": 1397,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 1381,
"name": "_owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1374,
"src": "1954:6:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"id": 1382,
"modifierName": {
"argumentTypes": null,
"id": 1380,
"name": "Contract",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1320,
"src": "1945:8:8",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Contract_$1320_$",
"typeString": "type(contract Contract)"
}
},
"nodeType": "ModifierInvocation",
"src": "1945:16:8"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1379,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1374,
"name": "_owner",
"nodeType": "VariableDeclaration",
"scope": 1397,
"src": "1866:14:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1373,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1866:7:8",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1376,
"name": "_projectName",
"nodeType": "VariableDeclaration",
"scope": 1397,
"src": "1890:19:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 1375,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1890:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1378,
"name": "_name",
"nodeType": "VariableDeclaration",
"scope": 1397,
"src": "1919:12:8",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 1377,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1919:6:8",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,