diff --git a/README.md b/README.md index dede6d7b..8845a88a 100644 --- a/README.md +++ b/README.md @@ -48,22 +48,11 @@ yarn coverage ``` ## [Roles](contracts/roles) -To understand the SDK, it's important to understand the 4 fundamental roles on the network: +There are generally 4 different roles on the platform. The `Investor`, the `AssetManager`, the `Operator`, and the `PlatformOwners`. `Investors` can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The continued functioning of the asset is ensured by the `AssetManager`, who receives a fee for his work and escrows tokens as collateral to investors. The `Operator` receives funds from the crowdsale and produces and installs the asset. `PlatformOwners` can choose how assets are governed, and whether or not a contract upgrade should happen. The platform owner can be a single account or a contract governed by many accounts. -#### Investor -Investors can contribute ETH or ERC20 tokens to invest in asset orders, receiving asset-tokens in return. To invest they must approve the burner contract. -#### AssetManager -The assets are managed and created by the AssetManager, who receives a fee for his work and escrows tokens as collateral to investors. The AssetManager must approve the burner contract to burn platform tokens. -#### Operator -The Operator is responsible for producing and installing the asset. They receive 99% of the crowdsale income as a fee for doing so. Platform owners must approve each Operator. - -#### Platform Owner(s) -Platform owners can choose how assets are governed, and whether or not a contract upgrade should happen. The platform owner can be a single account or a contract governed by many accounts. Platform owners receive 1% of crowdsale income as a fee. - - -## Setting Up The Platform +## Contract overview Before creating assets, certain variables and parameters have to be set: * All contracts must be registered in ContractManager before writing to database * All users must approve the current contract state, which changes everytime a contract is added/updated in ContractManager @@ -71,12 +60,14 @@ Before creating assets, certain variables and parameters have to be set: * Platform wallet and platform token must be set * Operators must be registered and choose which currencies they wish to accept -Basic functionality for these critical operations are outlined below. All contracts are found [here](contracts) +Basic functionality for these critical operations are outlined below. + +All contracts are found [here](contracts) ### [Database](contracts/database) Contracts in the SDK store all long-term data in a database contract, which allows for contracts to be upgraded without losing valuable data. The Database stores all data using a bytes32 type, which is often the keccak256 hash of the variableName, ID, address that make up that variable. -Storing an unsigned integer looks like this: +Storing an integer looks like this: ```javascript database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), 20000000); ``` @@ -121,7 +112,7 @@ To give a contract write access to the database, you must call `addContract(cont } ``` -Everytime a contract is added or updated the contract state will change, requiring approval from users before they interact with the platform. Users can also choose to ignore future state changes. This can be done by calling the following function: +Every time a contract is added or updated the contract state will change, requiring approval from users before they interact with the platform. Users can also choose to ignore future state changes. This can be done by calling the following function: ```javascript function setContractStatePreferences(bool _acceptCurrentState, bool _ignoreStateChanges) @@ -180,7 +171,7 @@ Before assets can be funded the platform owners must set the `platform token` an emit LogPlatformWallet(_walletAddress); } ``` -:heavy_plus_sign: +AND ```javascript // @notice diff --git a/accounts.json b/accounts.json index 1954395e..ff9763a5 100644 --- a/accounts.json +++ b/accounts.json @@ -1,12 +1,12 @@ [ - "0xeed17b217b1e0c63b1b525d8d2e59cad0546432d", - "0x0ec0e59bd4faf0a136c2ee638f3fcff19972a304", - "0xe273d3d13d69f82b8071365e110e13c0fbde0c59", - "0x4cbe9306228ff003fe5a47fe66f2e3d3162f0f37", - "0x0dcea99d96046de44f1ab2a4bf9b3e21f3ac2924", - "0x8bd581cca82af7cfff8ab46591803fe2f2061218", - "0xd6a41e3da4bdc4a27d5707b08612925347f5934f", - "0xd0702a4258c574ff15df4e65000dbb16843cbd24", - "0xc3dda1fc00ba83300b9ad2d00faa30166fabc657", - "0x45543e02e26442e6c95e3145f7d30a53b284f418" + "0x83ab44a76fc2e7238fca811e38e41845ed1a9fb3", + "0xbcccfb280ff402bc5a593dfce2b3dc736e17e7ba", + "0x6d929ebae40bbf96f52e3f82bd831c2891a0d75d", + "0x9916ebeef94abca7564ce7dabcbacd434f4015cd", + "0xf89f0b05980fb8c7b3d985206707f20a6189c5de", + "0x87460046866e93e99273a9f8a94d1e5764774dc9", + "0x65a67881065abe61de49c13c44f55a7916c252ae", + "0x557f883a3a7b4609ca1251c60253c79e275ba1a6", + "0x310ddb0d62b77fb195dcaebfadcebaf3978c198f", + "0x4449f9fcc41cf2275fd3631e044e3cf9d603efc2" ] \ No newline at end of file diff --git a/addresses.json b/addresses.json index de12e952..9617d672 100644 --- a/addresses.json +++ b/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x82e8ed40b49fa4682d58807e99eaed6daf20b1d4", - "ERC20Burner": "0xfa3066aa522b18e0243f7c098e9c72fa85c89ae2", - "Database": "0xf3a985536aa63fcc5e0732fef35a9d6e0881682c", - "ContractManager": "0x8397e224cc3f2560d6c989bc29bb6800517d6f97", - "API": "0x94e839af9b8ec45da92d8a76e0acd1ca45b710c5", - "SingleOwned": "0x6df2e96b18b909e6127137a4a8ddf40eb259b610", - "Pausible": "0xbea6ba1b1aa691fc07a5b722bc491df03f4c280a", - "AccessHierarchy": "0xe4f4aeefd5087eababbd73bdd4c8188cbd008ebb", - "PlatformFunds": "0x7bd53d17ebee6c87d9937c8cb4fb04297cdc83c2", - "Operators": "0x54ae7cc1c7ec065a84b84ea7f9e33a14cf3d95e6", - "AssetManagerEscrow": "0x860b672a9fcb0f12c156cc9c233cfc3ed18fc202", - "CrowdsaleETH": "0x8af6ac104c639a9011b83f3baf789271e6df6198", - "CrowdsaleGeneratorETH": "0xeed31156aa0eeb2ebf473cd16faf70d2bf463137", - "CrowdsaleERC20": "0x03a685558ffd806ca2c44ab5f2ebe84688b82d57", - "CrowdsaleGeneratorERC20": "0xede40300bea9631bddbf1ab91ca286b5cd591d14", - "AssetExchange": "0x57bff4f318c5fb88e742d89627ad0b3ee62ab536" + "MyBit": "0x8a36b3e2b97fceadb96f42975f6b2fd5af1cadd2", + "ERC20Burner": "0xedc8486aebbaeed27a2d14a0cb5f01586828cff4", + "Database": "0xacabd45a26baf228a6f753f63c75730edc377cea", + "ContractManager": "0xaa0a3786966d598686ba95897577b5443e76f4f3", + "API": "0x02ee482c286dfd1ae43d3bd3315dec0f6ee4ee6f", + "SingleOwned": "0x8e43584cbfdfe8a646b901363c810087574594cb", + "Pausible": "0xd1f82620bbd1f8eaa329c3250b6edc1db9515ae3", + "AccessHierarchy": "0xd96a07f8e1c81b5fec25d5b49a92030a2dfcab6f", + "PlatformFunds": "0xc01dc119cc3791a7e0cf2dd08eef3e143577794c", + "Operators": "0xdb17f66f6d536b092a72177311c45a31e59bc8e5", + "AssetManagerEscrow": "0x96e5fafbb47ff3a9f9d261d549b720e9f2120b84", + "CrowdsaleETH": "0xb85c21e4afdaa416c068ebf1e74e24e7a2e446c2", + "CrowdsaleGeneratorETH": "0x3e1553ae089cf495418786a5ffeb314bcdfef205", + "CrowdsaleERC20": "0xacd78e2db9c77e2242f74d47438c5824cf6e02ce", + "CrowdsaleGeneratorERC20": "0x1d96b9640ef47e5e8e6161bf30a1cb798ab9e7ef", + "AssetExchange": "0xf93210ea71bbd541b2362c4e1b1ff3ff5c3cfb5c" } \ No newline at end of file diff --git a/contracts/database/API.sol b/contracts/database/API.sol index 2595e0f8..3d96f44b 100644 --- a/contracts/database/API.sol +++ b/contracts/database/API.sol @@ -27,6 +27,7 @@ contract API { using SafeMath for uint256; DBView private database; + uint constant scalingFactor = 10e32; constructor(address _database) public { @@ -69,7 +70,7 @@ contract API { view returns (uint) { uint totalVotes = getTotalVotes(_executionID); - return (totalVotes * 100) / TokenView(_assetToken).totalSupply(); + return ( ( (totalVotes * 100) * scalingFactor) / TokenView(_assetToken).totalSupply() / scalingFactor); } function getAssetManagerParameterHash(bytes32 _assetID, address _oldAssetManager, address _newAssetManager, uint _amount, bool _burn) diff --git a/contracts/ownership/AssetGovernance.sol b/contracts/ownership/AssetGovernance.sol index e9cf0e95..73a4c899 100644 --- a/contracts/ownership/AssetGovernance.sol +++ b/contracts/ownership/AssetGovernance.sol @@ -21,6 +21,8 @@ contract AssetGovernance { DB public database; + uint public consensus = 66; // TODO: sub the assetmanager portion of tokens, since they can't be voted with + uint constant scalingFactor = 10e32; constructor(address _database) public { @@ -39,7 +41,7 @@ contract AssetGovernance { bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID, msg.sender)); uint256 numVotes = database.uintStorage(numVotesID); uint256 investorVotes = database.uintStorage(investorVotesID); - require(lockTokens(_assetID, msg.sender, _amountToLock)); + require(lockTokens(_assetID, msg.sender, _amountToLock), "unable to lock tokens"); database.setUint(numVotesID, numVotes.add(_amountToLock)); database.setUint(investorVotesID, investorVotes.add(_amountToLock)); return true; @@ -54,7 +56,7 @@ contract AssetGovernance { returns (bool) { bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash)); bytes32 voteTotalID = keccak256(abi.encodePacked("voteTotal", executionID)); - bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID)); + bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID, msg.sender)); uint investorVotes = database.uintStorage(investorVotesID); uint totalVotes = database.uintStorage(voteTotalID); require(investorVotes <= _amountToUnlock); // 1 vote = 1 token @@ -67,7 +69,7 @@ contract AssetGovernance { // Public Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // @notice Checks that 1/3 or more of token holders agreed on function call + // @notice Checks that 2/3 or more of token holders agreed on function call function isConsensusReached(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) public view @@ -76,7 +78,7 @@ contract AssetGovernance { bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash)); bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", executionID)); uint256 numTokens = assetToken.totalSupply(); - return database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33; + return database.uintStorage(numVotesID).mul(scalingFactor).mul(100).div(numTokens).div(scalingFactor) >= consensus; } @@ -101,12 +103,6 @@ contract AssetGovernance { // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // @notice add this modifer to functions that you want multi-sig requirements for - // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it - modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) { - require(isConsensusReached(address(this), _assetID, _methodID, _parameterHash)); // owners must have agreed on function + parameters - _; - } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(bytes32 _assetID) { @@ -114,4 +110,5 @@ contract AssetGovernance { _; } + event LogConsensus(bytes32 votesID, uint votes, uint tokens, bytes32 executionID, uint quorum); } diff --git a/contracts/roles/AssetManagerEscrow.sol b/contracts/roles/AssetManagerEscrow.sol index a4cd7158..f79a488e 100644 --- a/contracts/roles/AssetManagerEscrow.sol +++ b/contracts/roles/AssetManagerEscrow.sol @@ -15,6 +15,8 @@ DBInterface public database; + uint public consensus = 66; + // @notice constructor: initializes database // @param: the address for the database contract used by this platform constructor(address _database) @@ -27,17 +29,12 @@ function lockEscrow(bytes32 _assetID, uint _amount) public returns (bool) { - require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == address(0)); - bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, msg.sender)); - address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken"))); - require(BurnableERC20(tokenAddress).transferFrom(msg.sender, address(this), _amount)); - database.setUint(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID)), _amount); - database.setAddress(keccak256(abi.encodePacked("assetManager", _assetID)), msg.sender); - emit LogEscrowLocked(_assetID, assetManagerEscrowID, msg.sender, _amount); + require(lockEscrowInternal(msg.sender, _assetID, _amount)); return true; } + // @notice assetManager can unlock his escrow here once funding fails or asset returns sufficient ROI // @dev asset must have fundingDeadline = 0 or have ROI > 25% // @dev returns escrow according to ROI. 25% ROI returns 25% of escrow, 50% ROI returns 50% of escrow etc... @@ -73,23 +70,22 @@ // @notice investors can vote to call this function for the new assetManager to then call // @dev new assetManager must approve this contract to transfer in and lock _ amount of platform tokens - function becomeAssetManager(bytes32 _assetID, address _oldAssetManager, uint _amount, bool _burn) + function becomeAssetManager(bytes32 _assetID, address _oldAssetManager, uint256 _amount, bool _burn) external hasConsensus(_assetID, msg.sig, keccak256(abi.encodePacked(_assetID, _oldAssetManager, msg.sender, _amount, _burn))) returns (bool) { address currentAssetManager = database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))); require(currentAssetManager != msg.sender && currentAssetManager == _oldAssetManager); - bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, _oldAssetManager)); - uint oldEscrowRemaining = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).sub(database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID)))); + bytes32 oldAssetManagerEscrowID = keccak256(abi.encodePacked(_assetID, _oldAssetManager)); + uint oldEscrowRemaining = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", oldAssetManagerEscrowID))).sub(database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", oldAssetManagerEscrowID)))); BurnableERC20 token = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken")))); - require(removeAssetManager(_assetID, assetManagerEscrowID)); + require(removeAssetManager(_assetID, oldAssetManagerEscrowID)); if (_burn) { require(token.burn(oldEscrowRemaining)); } else { require(token.transfer(_oldAssetManager, oldEscrowRemaining)); } - require(lockEscrow(_assetID, _amount)); + require(lockEscrowInternal(msg.sender, _assetID, _amount)); return true; } - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Internal Functions ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -105,6 +101,21 @@ } + function lockEscrowInternal(address _assetManager, bytes32 _assetID, uint _amount) + internal + returns (bool) { + require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == address(0)); + bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, _assetManager)); + address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken"))); + require(BurnableERC20(tokenAddress).transferFrom(_assetManager, address(this), _amount)); + database.setUint(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID)), _amount); + database.setAddress(keccak256(abi.encodePacked("assetManager", _assetID)), _assetManager); + emit LogEscrowLocked(_assetID, assetManagerEscrowID, _assetManager, _amount); + return true; + } + + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -114,11 +125,12 @@ modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) { bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", keccak256(abi.encodePacked(address(this), _assetID, _methodID, _parameterHash)))); uint256 numTokens = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)))).totalSupply(); - require(database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33); + emit LogConsensus(numVotesID, database.uintStorage(numVotesID), numTokens, keccak256(abi.encodePacked(address(this), _assetID, _methodID, _parameterHash)), database.uintStorage(numVotesID).mul(100).div(numTokens)); + require(database.uintStorage(numVotesID).mul(100).div(numTokens) >= consensus, 'Consensus not reached'); _; } - + event LogConsensus(bytes32 votesID, uint votes, uint tokens, bytes32 executionID, uint quorum); event LogEscrowBurned(bytes32 indexed _assetID, address indexed _assetManager, uint _amountBurnt); event LogEscrowLocked(bytes32 indexed _assetID, bytes32 indexed _assetManagerEscrowID, address indexed _assetManager, uint _amount); diff --git a/coverage.json b/coverage.json new file mode 100644 index 00000000..3b71eaea --- /dev/null +++ b/coverage.json @@ -0,0 +1 @@ +{"contracts/access/AccessHierarchy.sol":{"l":{"16":4,"27":3,"28":2,"29":2,"30":2,"39":2,"40":2,"41":2,"42":2,"50":3,"51":2,"56":5,"57":4,"62":13,"63":10,"68":5,"69":4},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/access/AccessHierarchy.sol","s":{"1":4,"2":3,"3":2,"4":2,"5":2,"6":2,"7":2,"8":3,"9":2,"10":5,"11":13,"12":5},"b":{"1":[2,1],"2":[2,1],"3":[4,1],"4":[10,3],"5":[4,1]},"f":{"1":4,"2":3,"3":2,"4":3,"5":5,"6":13,"7":5},"fnMap":{"1":{"name":null,"line":14,"loc":{"start":{"line":14,"column":2},"end":{"line":15,"column":11}}},"2":{"name":"approveUser","line":22,"loc":{"start":{"line":22,"column":2},"end":{"line":26,"column":18}}},"3":{"name":"removeUser","line":35,"loc":{"start":{"line":35,"column":2},"end":{"line":38,"column":18}}},"4":{"name":"setUpperAccessLevel","line":47,"loc":{"start":{"line":47,"column":2},"end":{"line":49,"column":13}}},"5":{"name":"noEmptyAddress","line":55,"loc":{"start":{"line":55,"column":2},"end":{"line":55,"column":41}}},"6":{"name":"onlyOwner","line":61,"loc":{"start":{"line":61,"column":2},"end":{"line":61,"column":20}}},"7":{"name":"onlyPlatform","line":67,"loc":{"start":{"line":67,"column":2},"end":{"line":67,"column":23}}}},"statementMap":{"1":{"start":{"line":16,"column":4},"end":{"line":16,"column":33}},"2":{"start":{"line":27,"column":4},"end":{"line":27,"column":71}},"3":{"start":{"line":29,"column":4},"end":{"line":29,"column":48}},"4":{"start":{"line":30,"column":4},"end":{"line":30,"column":15}},"5":{"start":{"line":39,"column":4},"end":{"line":39,"column":92}},"6":{"start":{"line":41,"column":4},"end":{"line":41,"column":43}},"7":{"start":{"line":42,"column":4},"end":{"line":42,"column":15}},"8":{"start":{"line":50,"column":4},"end":{"line":50,"column":37}},"9":{"start":{"line":51,"column":4},"end":{"line":51,"column":36}},"10":{"start":{"line":56,"column":4},"end":{"line":56,"column":32}},"11":{"start":{"line":62,"column":4},"end":{"line":62,"column":82}},"12":{"start":{"line":68,"column":4},"end":{"line":68,"column":85}}},"branchMap":{"1":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"2":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":50,"column":4}},{"start":{"line":50,"column":4},"end":{"line":50,"column":4}}]},"3":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"4":{"line":62,"type":"if","locations":[{"start":{"line":62,"column":4},"end":{"line":62,"column":4}},{"start":{"line":62,"column":4},"end":{"line":62,"column":4}}]},"5":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":4},"end":{"line":68,"column":4}},{"start":{"line":68,"column":4},"end":{"line":68,"column":4}}]}}},"contracts/access/ERC20Burner.sol":{"l":{"20":6,"21":6,"22":6,"33":40,"34":39,"35":39,"47":15,"48":15,"49":15,"57":1,"66":15,"67":15,"72":45,"73":43,"78":43,"79":43,"80":40},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/access/ERC20Burner.sol","s":{"1":6,"2":6,"3":6,"4":40,"5":39,"6":39,"7":15,"8":15,"9":1,"10":15,"11":45,"12":43,"13":43},"b":{"1":[6,0],"2":[39,1],"3":[15,0],"4":[43,2],"5":[40,3]},"f":{"1":6,"2":40,"3":15,"4":1,"5":15,"6":45,"7":43},"fnMap":{"1":{"name":null,"line":18,"loc":{"start":{"line":18,"column":2},"end":{"line":19,"column":10}}},"2":{"name":"burn","line":28,"loc":{"start":{"line":28,"column":2},"end":{"line":32,"column":18}}},"3":{"name":"setFee","line":42,"loc":{"start":{"line":42,"column":2},"end":{"line":45,"column":18}}},"4":{"name":null,"line":54,"loc":{"start":{"line":54,"column":2},"end":{"line":56,"column":11}}},"5":{"name":"onlyOwner","line":65,"loc":{"start":{"line":65,"column":2},"end":{"line":65,"column":20}}},"6":{"name":"onlyPlatformContracts","line":71,"loc":{"start":{"line":71,"column":2},"end":{"line":71,"column":49}}},"7":{"name":"acceptedState","line":77,"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":43}}}},"statementMap":{"1":{"start":{"line":20,"column":4},"end":{"line":20,"column":36}},"2":{"start":{"line":21,"column":4},"end":{"line":21,"column":95}},"3":{"start":{"line":22,"column":4},"end":{"line":22,"column":40}},"4":{"start":{"line":33,"column":4},"end":{"line":33,"column":49}},"5":{"start":{"line":34,"column":4},"end":{"line":34,"column":56}},"6":{"start":{"line":35,"column":4},"end":{"line":35,"column":15}},"7":{"start":{"line":48,"column":4},"end":{"line":48,"column":58}},"8":{"start":{"line":49,"column":4},"end":{"line":49,"column":15}},"9":{"start":{"line":57,"column":4},"end":{"line":57,"column":11}},"10":{"start":{"line":66,"column":4},"end":{"line":66,"column":82}},"11":{"start":{"line":72,"column":4},"end":{"line":72,"column":82}},"12":{"start":{"line":78,"column":4},"end":{"line":78,"column":94}},"13":{"start":{"line":79,"column":4},"end":{"line":79,"column":172}}},"branchMap":{"1":{"line":22,"type":"if","locations":[{"start":{"line":22,"column":4},"end":{"line":22,"column":4}},{"start":{"line":22,"column":4},"end":{"line":22,"column":4}}]},"2":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":4},"end":{"line":33,"column":4}},{"start":{"line":33,"column":4},"end":{"line":33,"column":4}}]},"3":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]},"4":{"line":72,"type":"if","locations":[{"start":{"line":72,"column":4},"end":{"line":72,"column":4}},{"start":{"line":72,"column":4},"end":{"line":72,"column":4}}]},"5":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":4},"end":{"line":79,"column":4}},{"start":{"line":79,"column":4},"end":{"line":79,"column":4}}]}}},"contracts/access/Expirable.sol":{"l":{"27":1,"28":1,"29":1,"30":1,"40":1,"41":1,"42":1,"51":1,"52":1,"53":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/access/Expirable.sol","s":{"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"b":{"1":[1,0],"2":[1,0]},"f":{"1":1,"2":1,"3":1,"4":1},"fnMap":{"1":{"name":null,"line":14,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":65}}},"2":{"name":"approveTemporaryUser","line":22,"loc":{"start":{"line":22,"column":2},"end":{"line":26,"column":18}}},"3":{"name":"removeTemporaryUser","line":36,"loc":{"start":{"line":36,"column":2},"end":{"line":39,"column":18}}},"4":{"name":"changeExpirationLength","line":48,"loc":{"start":{"line":48,"column":2},"end":{"line":50,"column":13}}}},"statementMap":{"1":{"start":{"line":27,"column":4},"end":{"line":27,"column":47}},"2":{"start":{"line":28,"column":4},"end":{"line":28,"column":32}},"3":{"start":{"line":30,"column":4},"end":{"line":30,"column":15}},"4":{"start":{"line":40,"column":4},"end":{"line":40,"column":29}},"5":{"start":{"line":42,"column":4},"end":{"line":42,"column":15}},"6":{"start":{"line":51,"column":4},"end":{"line":51,"column":40}},"7":{"start":{"line":52,"column":4},"end":{"line":52,"column":42}},"8":{"start":{"line":53,"column":4},"end":{"line":53,"column":68}}},"branchMap":{"1":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"2":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]}}},"contracts/access/KYC.sol":{"l":{"17":1,"18":1,"25":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/access/KYC.sol","s":{"1":1},"b":{},"f":{"1":1,"2":1,"3":1},"fnMap":{"1":{"name":null,"line":11,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":65}}},"2":{"name":"approveKYC","line":14,"loc":{"start":{"line":14,"column":2},"end":{"line":16,"column":12}}},"3":{"name":"revokeKYC","line":22,"loc":{"start":{"line":22,"column":2},"end":{"line":24,"column":13}}}},"statementMap":{"1":{"start":{"line":18,"column":4},"end":{"line":18,"column":42}}},"branchMap":{}},"contracts/crowdsale/CrowdsaleERC20.sol":{"l":{"23":2,"24":2,"39":5,"40":5,"41":5,"42":5,"43":5,"44":3,"45":3,"46":3,"47":3,"48":3,"49":3,"52":2,"53":2,"55":4,"56":4,"69":1,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"76":1,"77":1,"90":3,"91":3,"92":3,"93":3,"94":2,"95":2,"96":2,"97":2,"98":2,"99":2,"106":0,"107":0,"108":0,"115":0,"116":0,"130":3,"131":3,"132":3,"133":3,"142":0,"143":0,"148":9,"149":8,"154":5,"155":5,"160":9,"161":9,"166":7,"167":6,"172":2,"173":1,"178":7,"179":6},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleERC20.sol","s":{"1":2,"2":2,"3":5,"4":5,"5":5,"6":5,"7":5,"8":3,"9":3,"10":3,"11":3,"12":3,"13":3,"14":2,"15":2,"16":4,"17":4,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":3,"25":3,"26":3,"27":3,"28":2,"29":2,"30":2,"31":2,"32":0,"33":0,"34":0,"35":0,"36":3,"37":0,"38":9,"39":5,"40":9,"41":7,"42":2,"43":7},"b":{"1":[3,2],"2":[3,0],"3":[3,0],"4":[3,0],"5":[3,0],"6":[3,0],"7":[2,1],"8":[2,0],"9":[2,0],"10":[1,0],"11":[2,1],"12":[0,0],"13":[8,1],"14":[5,0],"15":[9,0],"16":[6,1],"17":[1,1],"18":[6,1]},"f":{"1":2,"2":5,"3":1,"4":3,"5":0,"6":0,"7":3,"8":0,"9":9,"10":5,"11":9,"12":7,"13":2,"14":7},"fnMap":{"1":{"name":null,"line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":22,"column":9}}},"2":{"name":"buyAssetOrderERC20","line":32,"loc":{"start":{"line":32,"column":2},"end":{"line":38,"column":18}}},"3":{"name":"refund","line":62,"loc":{"start":{"line":62,"column":2},"end":{"line":68,"column":18}}},"4":{"name":"payoutERC20","line":86,"loc":{"start":{"line":86,"column":2},"end":{"line":89,"column":18}}},"5":{"name":"recoverTokens","line":103,"loc":{"start":{"line":103,"column":2},"end":{"line":105,"column":12}}},"6":{"name":"destroy","line":112,"loc":{"start":{"line":112,"column":2},"end":{"line":114,"column":12}}},"7":{"name":"finalizeCrowdsale","line":126,"loc":{"start":{"line":126,"column":2},"end":{"line":129,"column":18}}},"8":{"name":"onlyOwner","line":141,"loc":{"start":{"line":141,"column":2},"end":{"line":141,"column":20}}},"9":{"name":"whenNotPaused","line":147,"loc":{"start":{"line":147,"column":2},"end":{"line":147,"column":24}}},"10":{"name":"burnRequired","line":153,"loc":{"start":{"line":153,"column":2},"end":{"line":153,"column":23}}},"11":{"name":"validAsset","line":159,"loc":{"start":{"line":159,"column":2},"end":{"line":159,"column":39}}},"12":{"name":"beforeDeadline","line":165,"loc":{"start":{"line":165,"column":2},"end":{"line":165,"column":43}}},"13":{"name":"afterDeadline","line":171,"loc":{"start":{"line":171,"column":2},"end":{"line":171,"column":42}}},"14":{"name":"notFinalized","line":177,"loc":{"start":{"line":177,"column":2},"end":{"line":177,"column":41}}}},"statementMap":{"1":{"start":{"line":23,"column":6},"end":{"line":23,"column":38}},"2":{"start":{"line":24,"column":6},"end":{"line":24,"column":106}},"3":{"start":{"line":39,"column":4},"end":{"line":39,"column":141}},"4":{"start":{"line":40,"column":4},"end":{"line":40,"column":109}},"5":{"start":{"line":41,"column":4},"end":{"line":41,"column":100}},"6":{"start":{"line":42,"column":4},"end":{"line":42,"column":69}},"7":{"start":{"line":43,"column":4},"end":{"line":43,"column":1944}},"8":{"start":{"line":44,"column":6},"end":{"line":44,"column":83}},"9":{"start":{"line":45,"column":6},"end":{"line":45,"column":190}},"10":{"start":{"line":46,"column":6},"end":{"line":46,"column":41}},"11":{"start":{"line":47,"column":6},"end":{"line":47,"column":58}},"12":{"start":{"line":48,"column":6},"end":{"line":48,"column":40}},"13":{"start":{"line":49,"column":6},"end":{"line":49,"column":50}},"14":{"start":{"line":52,"column":6},"end":{"line":52,"column":75}},"15":{"start":{"line":53,"column":6},"end":{"line":53,"column":50}},"16":{"start":{"line":55,"column":4},"end":{"line":55,"column":57}},"17":{"start":{"line":56,"column":4},"end":{"line":56,"column":15}},"18":{"start":{"line":69,"column":4},"end":{"line":69,"column":95}},"19":{"start":{"line":71,"column":4},"end":{"line":71,"column":104}},"20":{"start":{"line":72,"column":4},"end":{"line":72,"column":75}},"21":{"start":{"line":73,"column":4},"end":{"line":73,"column":109}},"22":{"start":{"line":74,"column":4},"end":{"line":74,"column":46}},"23":{"start":{"line":77,"column":4},"end":{"line":77,"column":15}},"24":{"start":{"line":90,"column":4},"end":{"line":90,"column":109}},"25":{"start":{"line":91,"column":4},"end":{"line":91,"column":96}},"26":{"start":{"line":92,"column":4},"end":{"line":92,"column":98}},"27":{"start":{"line":93,"column":4},"end":{"line":93,"column":66}},"28":{"start":{"line":94,"column":4},"end":{"line":94,"column":50}},"29":{"start":{"line":95,"column":4},"end":{"line":95,"column":54}},"30":{"start":{"line":98,"column":4},"end":{"line":98,"column":52}},"31":{"start":{"line":99,"column":4},"end":{"line":99,"column":15}},"32":{"start":{"line":106,"column":4},"end":{"line":106,"column":39}},"33":{"start":{"line":107,"column":4},"end":{"line":107,"column":60}},"34":{"start":{"line":115,"column":4},"end":{"line":115,"column":58}},"35":{"start":{"line":116,"column":4},"end":{"line":116,"column":27}},"36":{"start":{"line":133,"column":6},"end":{"line":133,"column":17}},"37":{"start":{"line":142,"column":4},"end":{"line":142,"column":82}},"38":{"start":{"line":148,"column":4},"end":{"line":148,"column":87}},"39":{"start":{"line":154,"column":4},"end":{"line":154,"column":110}},"40":{"start":{"line":160,"column":4},"end":{"line":160,"column":104}},"41":{"start":{"line":166,"column":4},"end":{"line":166,"column":97}},"42":{"start":{"line":172,"column":4},"end":{"line":172,"column":96}},"43":{"start":{"line":178,"column":4},"end":{"line":178,"column":96}}},"branchMap":{"1":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":43,"column":4}},{"start":{"line":43,"column":4},"end":{"line":43,"column":4}}]},"2":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":6}},{"start":{"line":44,"column":6},"end":{"line":44,"column":6}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":45,"column":6}},{"start":{"line":45,"column":6},"end":{"line":45,"column":6}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":6}},{"start":{"line":46,"column":6},"end":{"line":46,"column":6}}]},"5":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":6}},{"start":{"line":47,"column":6},"end":{"line":47,"column":6}}]},"6":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":48,"column":6}},{"start":{"line":48,"column":6},"end":{"line":48,"column":6}}]},"7":{"line":49,"type":"if","locations":[{"start":{"line":49,"column":6},"end":{"line":49,"column":6}},{"start":{"line":49,"column":6},"end":{"line":49,"column":6}}]},"8":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":6},"end":{"line":52,"column":6}},{"start":{"line":52,"column":6},"end":{"line":52,"column":6}}]},"9":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":6},"end":{"line":53,"column":6}},{"start":{"line":53,"column":6},"end":{"line":53,"column":6}}]},"10":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":4},"end":{"line":69,"column":4}},{"start":{"line":69,"column":4},"end":{"line":69,"column":4}}]},"11":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":4},"end":{"line":93,"column":4}},{"start":{"line":93,"column":4},"end":{"line":93,"column":4}}]},"12":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":4},"end":{"line":142,"column":4}},{"start":{"line":142,"column":4},"end":{"line":142,"column":4}}]},"13":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":4},"end":{"line":148,"column":4}},{"start":{"line":148,"column":4},"end":{"line":148,"column":4}}]},"14":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":4},"end":{"line":154,"column":4}},{"start":{"line":154,"column":4},"end":{"line":154,"column":4}}]},"15":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":4},"end":{"line":160,"column":4}},{"start":{"line":160,"column":4},"end":{"line":160,"column":4}}]},"16":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":4},"end":{"line":166,"column":4}},{"start":{"line":166,"column":4},"end":{"line":166,"column":4}}]},"17":{"line":172,"type":"if","locations":[{"start":{"line":172,"column":4},"end":{"line":172,"column":4}},{"start":{"line":172,"column":4},"end":{"line":172,"column":4}}]},"18":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":4},"end":{"line":178,"column":4}},{"start":{"line":178,"column":4},"end":{"line":178,"column":4}}]}}},"contracts/crowdsale/CrowdsaleETH.sol":{"l":{"23":2,"24":2,"39":5,"40":5,"41":5,"42":5,"44":3,"45":3,"46":3,"47":3,"48":3,"49":3,"52":2,"54":5,"55":5,"68":2,"69":2,"70":2,"71":2,"72":2,"73":2,"74":2,"81":0,"82":0,"83":0,"90":1,"91":1,"98":1,"112":3,"113":3,"114":3,"115":3,"116":3,"117":3,"118":3,"119":3,"120":3,"128":3,"129":3,"130":3,"131":3,"142":8,"143":8,"148":2,"149":1,"154":5,"155":5,"160":3,"161":2,"166":10,"167":10,"172":8,"173":5,"178":2,"179":2,"184":7,"185":7},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleETH.sol","s":{"1":2,"2":2,"3":5,"4":5,"5":5,"6":5,"7":3,"8":3,"9":3,"10":3,"11":3,"12":2,"13":5,"14":5,"15":2,"16":2,"17":2,"18":2,"19":0,"20":0,"21":1,"22":1,"23":1,"24":3,"25":3,"26":3,"27":3,"28":3,"29":3,"30":3,"31":3,"32":8,"33":2,"34":5,"35":3,"36":10,"37":8,"38":2,"39":7},"b":{"1":[3,2],"2":[3,0],"3":[3,0],"4":[3,0],"5":[3,0],"6":[3,0],"7":[2,0],"8":[2,0],"9":[3,0],"10":[8,0],"11":[1,1],"12":[5,0],"13":[2,1],"14":[10,0],"15":[5,3],"16":[2,0],"17":[7,0]},"f":{"1":2,"2":5,"3":2,"4":0,"5":1,"6":1,"7":3,"8":3,"9":8,"10":2,"11":5,"12":3,"13":10,"14":8,"15":2,"16":7},"fnMap":{"1":{"name":null,"line":21,"loc":{"start":{"line":21,"column":4},"end":{"line":22,"column":12}}},"2":{"name":"buyAssetOrderETH","line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":38,"column":20}}},"3":{"name":"refund","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":67,"column":20}}},"4":{"name":"recoverTokens","line":78,"loc":{"start":{"line":78,"column":4},"end":{"line":80,"column":14}}},"5":{"name":"destroy","line":87,"loc":{"start":{"line":87,"column":4},"end":{"line":89,"column":14}}},"6":{"name":null,"line":95,"loc":{"start":{"line":95,"column":4},"end":{"line":97,"column":13}}},"7":{"name":"payoutETH","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":111,"column":20}}},"8":{"name":"finalizeCrowdsale","line":125,"loc":{"start":{"line":125,"column":4},"end":{"line":127,"column":20}}},"9":{"name":"requiresEther","line":141,"loc":{"start":{"line":141,"column":4},"end":{"line":141,"column":26}}},"10":{"name":"onlyOwner","line":147,"loc":{"start":{"line":147,"column":4},"end":{"line":147,"column":20}}},"11":{"name":"burnRequired","line":153,"loc":{"start":{"line":153,"column":4},"end":{"line":153,"column":23}}},"12":{"name":"whenNotPaused","line":159,"loc":{"start":{"line":159,"column":4},"end":{"line":159,"column":24}}},"13":{"name":"validAsset","line":165,"loc":{"start":{"line":165,"column":4},"end":{"line":165,"column":39}}},"14":{"name":"beforeDeadline","line":171,"loc":{"start":{"line":171,"column":4},"end":{"line":171,"column":43}}},"15":{"name":"afterDeadline","line":177,"loc":{"start":{"line":177,"column":4},"end":{"line":177,"column":42}}},"16":{"name":"notFinalized","line":183,"loc":{"start":{"line":183,"column":4},"end":{"line":183,"column":41}}}},"statementMap":{"1":{"start":{"line":23,"column":8},"end":{"line":23,"column":40}},"2":{"start":{"line":24,"column":8},"end":{"line":24,"column":108}},"3":{"start":{"line":39,"column":6},"end":{"line":39,"column":143}},"4":{"start":{"line":40,"column":6},"end":{"line":40,"column":102}},"5":{"start":{"line":41,"column":6},"end":{"line":41,"column":71}},"6":{"start":{"line":42,"column":6},"end":{"line":42,"column":1638}},"7":{"start":{"line":44,"column":8},"end":{"line":44,"column":191}},"8":{"start":{"line":45,"column":8},"end":{"line":45,"column":43}},"9":{"start":{"line":46,"column":8},"end":{"line":46,"column":60}},"10":{"start":{"line":47,"column":8},"end":{"line":47,"column":42}},"11":{"start":{"line":48,"column":8},"end":{"line":48,"column":50}},"12":{"start":{"line":52,"column":8},"end":{"line":52,"column":54}},"13":{"start":{"line":54,"column":6},"end":{"line":54,"column":61}},"14":{"start":{"line":55,"column":6},"end":{"line":55,"column":17}},"15":{"start":{"line":68,"column":6},"end":{"line":68,"column":97}},"16":{"start":{"line":71,"column":6},"end":{"line":71,"column":143}},"17":{"start":{"line":72,"column":6},"end":{"line":72,"column":48}},"18":{"start":{"line":74,"column":6},"end":{"line":74,"column":17}},"19":{"start":{"line":81,"column":6},"end":{"line":81,"column":41}},"20":{"start":{"line":82,"column":6},"end":{"line":82,"column":62}},"21":{"start":{"line":90,"column":6},"end":{"line":90,"column":60}},"22":{"start":{"line":91,"column":6},"end":{"line":91,"column":29}},"23":{"start":{"line":98,"column":6},"end":{"line":98,"column":13}},"24":{"start":{"line":112,"column":6},"end":{"line":112,"column":105}},"25":{"start":{"line":113,"column":6},"end":{"line":113,"column":100}},"26":{"start":{"line":114,"column":6},"end":{"line":114,"column":75}},"27":{"start":{"line":115,"column":6},"end":{"line":115,"column":52}},"28":{"start":{"line":116,"column":6},"end":{"line":116,"column":56}},"29":{"start":{"line":119,"column":6},"end":{"line":119,"column":61}},"30":{"start":{"line":120,"column":6},"end":{"line":120,"column":17}},"31":{"start":{"line":131,"column":8},"end":{"line":131,"column":19}},"32":{"start":{"line":142,"column":6},"end":{"line":142,"column":27}},"33":{"start":{"line":148,"column":6},"end":{"line":148,"column":84}},"34":{"start":{"line":154,"column":6},"end":{"line":154,"column":112}},"35":{"start":{"line":160,"column":6},"end":{"line":160,"column":89}},"36":{"start":{"line":166,"column":6},"end":{"line":166,"column":106}},"37":{"start":{"line":172,"column":6},"end":{"line":172,"column":99}},"38":{"start":{"line":178,"column":6},"end":{"line":178,"column":98}},"39":{"start":{"line":184,"column":6},"end":{"line":184,"column":98}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":6},"end":{"line":42,"column":6}},{"start":{"line":42,"column":6},"end":{"line":42,"column":6}}]},"2":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":8},"end":{"line":44,"column":8}},{"start":{"line":44,"column":8},"end":{"line":44,"column":8}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":8},"end":{"line":45,"column":8}},{"start":{"line":45,"column":8},"end":{"line":45,"column":8}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":8},"end":{"line":46,"column":8}},{"start":{"line":46,"column":8},"end":{"line":46,"column":8}}]},"5":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":8},"end":{"line":47,"column":8}},{"start":{"line":47,"column":8},"end":{"line":47,"column":8}}]},"6":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":8},"end":{"line":48,"column":8}},{"start":{"line":48,"column":8},"end":{"line":48,"column":8}}]},"7":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]},"8":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":6},"end":{"line":68,"column":6}},{"start":{"line":68,"column":6},"end":{"line":68,"column":6}}]},"9":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":6},"end":{"line":114,"column":6}},{"start":{"line":114,"column":6},"end":{"line":114,"column":6}}]},"10":{"line":142,"type":"if","locations":[{"start":{"line":142,"column":6},"end":{"line":142,"column":6}},{"start":{"line":142,"column":6},"end":{"line":142,"column":6}}]},"11":{"line":148,"type":"if","locations":[{"start":{"line":148,"column":6},"end":{"line":148,"column":6}},{"start":{"line":148,"column":6},"end":{"line":148,"column":6}}]},"12":{"line":154,"type":"if","locations":[{"start":{"line":154,"column":6},"end":{"line":154,"column":6}},{"start":{"line":154,"column":6},"end":{"line":154,"column":6}}]},"13":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":6},"end":{"line":160,"column":6}},{"start":{"line":160,"column":6},"end":{"line":160,"column":6}}]},"14":{"line":166,"type":"if","locations":[{"start":{"line":166,"column":6},"end":{"line":166,"column":6}},{"start":{"line":166,"column":6},"end":{"line":166,"column":6}}]},"15":{"line":172,"type":"if","locations":[{"start":{"line":172,"column":6},"end":{"line":172,"column":6}},{"start":{"line":172,"column":6},"end":{"line":172,"column":6}}]},"16":{"line":178,"type":"if","locations":[{"start":{"line":178,"column":6},"end":{"line":178,"column":6}},{"start":{"line":178,"column":6},"end":{"line":178,"column":6}}]},"17":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":6},"end":{"line":184,"column":6}},{"start":{"line":184,"column":6},"end":{"line":184,"column":6}}]}}},"contracts/crowdsale/CrowdsaleGeneratorERC20.sol":{"l":{"23":2,"24":2,"38":6,"39":5,"40":5,"41":5,"42":4,"43":4,"44":3,"45":3,"46":3,"47":3,"48":3,"49":3,"50":3,"51":3,"52":3,"53":3,"54":3,"65":6,"66":6},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleGeneratorERC20.sol","s":{"1":2,"2":2,"3":6,"4":5,"5":5,"6":5,"7":4,"8":4,"9":3,"10":3,"11":3,"12":6},"b":{"1":[5,1],"2":[5,0],"3":[5,0],"4":[4,1],"5":[3,1],"6":[6,0]},"f":{"1":2,"2":6,"3":6},"fnMap":{"1":{"name":null,"line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":22,"column":9}}},"2":{"name":"createAssetOrderERC20","line":35,"loc":{"start":{"line":35,"column":2},"end":{"line":37,"column":16}}},"3":{"name":"burnRequired","line":63,"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":23}}}},"statementMap":{"1":{"start":{"line":23,"column":6},"end":{"line":23,"column":38}},"2":{"start":{"line":24,"column":6},"end":{"line":24,"column":106}},"3":{"start":{"line":38,"column":4},"end":{"line":38,"column":30}},"4":{"start":{"line":39,"column":4},"end":{"line":39,"column":35}},"5":{"start":{"line":40,"column":4},"end":{"line":40,"column":105}},"6":{"start":{"line":41,"column":4},"end":{"line":41,"column":103}},"7":{"start":{"line":42,"column":4},"end":{"line":42,"column":100}},"8":{"start":{"line":43,"column":4},"end":{"line":43,"column":94}},"9":{"start":{"line":44,"column":4},"end":{"line":44,"column":167}},"10":{"start":{"line":46,"column":4},"end":{"line":46,"column":150}},"11":{"start":{"line":54,"column":4},"end":{"line":54,"column":77}},"12":{"start":{"line":65,"column":4},"end":{"line":65,"column":110}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]},"2":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":4}},{"start":{"line":39,"column":4},"end":{"line":39,"column":4}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"4":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"5":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":43,"column":4}},{"start":{"line":43,"column":4},"end":{"line":43,"column":4}}]},"6":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":65,"column":4}},{"start":{"line":65,"column":4},"end":{"line":65,"column":4}}]}}},"contracts/crowdsale/CrowdsaleGeneratorETH.sol":{"l":{"23":2,"24":2,"38":9,"39":8,"40":7,"41":7,"42":6,"43":6,"44":5,"45":5,"46":5,"47":5,"48":5,"49":5,"50":5,"51":5,"52":5,"53":5,"54":5,"65":9,"66":9},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleGeneratorETH.sol","s":{"1":2,"2":2,"3":9,"4":8,"5":7,"6":7,"7":6,"8":6,"9":5,"10":5,"11":5,"12":5,"13":9},"b":{"1":[8,1],"2":[7,1],"3":[7,0],"4":[6,1],"5":[5,1],"6":[9,0]},"f":{"1":2,"2":9,"3":9},"fnMap":{"1":{"name":null,"line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":22,"column":9}}},"2":{"name":"createAssetOrderETH","line":34,"loc":{"start":{"line":34,"column":2},"end":{"line":37,"column":18}}},"3":{"name":"burnRequired","line":63,"loc":{"start":{"line":63,"column":2},"end":{"line":63,"column":23}}}},"statementMap":{"1":{"start":{"line":23,"column":6},"end":{"line":23,"column":38}},"2":{"start":{"line":24,"column":6},"end":{"line":24,"column":106}},"3":{"start":{"line":38,"column":4},"end":{"line":38,"column":30}},"4":{"start":{"line":39,"column":4},"end":{"line":39,"column":35}},"5":{"start":{"line":40,"column":4},"end":{"line":40,"column":90}},"6":{"start":{"line":41,"column":4},"end":{"line":41,"column":103}},"7":{"start":{"line":42,"column":4},"end":{"line":42,"column":100}},"8":{"start":{"line":43,"column":4},"end":{"line":43,"column":94}},"9":{"start":{"line":44,"column":4},"end":{"line":44,"column":145}},"10":{"start":{"line":46,"column":4},"end":{"line":46,"column":150}},"11":{"start":{"line":53,"column":4},"end":{"line":53,"column":86}},"12":{"start":{"line":54,"column":4},"end":{"line":54,"column":15}},"13":{"start":{"line":65,"column":4},"end":{"line":65,"column":110}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]},"2":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":4}},{"start":{"line":39,"column":4},"end":{"line":39,"column":4}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"4":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"5":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":43,"column":4}},{"start":{"line":43,"column":4},"end":{"line":43,"column":4}}]},"6":{"line":65,"type":"if","locations":[{"start":{"line":65,"column":4},"end":{"line":65,"column":4}},{"start":{"line":65,"column":4},"end":{"line":65,"column":4}}]}}},"contracts/database/API.sol":{"l":{"33":6,"47":1,"48":1,"49":1,"50":1,"57":0,"64":1,"71":1,"72":1,"79":3,"86":1,"93":3,"100":0,"107":0,"118":0,"119":0,"126":0,"127":0,"134":2,"135":2,"142":0,"143":0,"160":1,"161":1,"168":0,"169":0,"176":0,"177":0,"184":4,"185":4,"197":0,"198":0,"205":0,"206":0,"213":2,"214":2,"221":1,"228":1,"229":1,"230":1,"237":1,"238":1,"245":0,"246":0,"253":0,"254":0,"261":0,"262":0,"269":0,"270":0,"281":0,"282":0,"294":0,"295":0,"302":0,"303":0,"310":0,"311":0,"318":0,"319":0,"326":0,"327":0,"334":0,"335":0,"342":0,"343":0,"354":0,"355":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/database/API.sol","s":{"1":6,"2":1,"3":1,"4":1,"5":1,"6":0,"7":1,"8":1,"9":1,"10":3,"11":1,"12":3,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":2,"20":2,"21":0,"22":0,"23":1,"24":1,"25":0,"26":0,"27":0,"28":0,"29":4,"30":4,"31":0,"32":0,"33":0,"34":0,"35":2,"36":2,"37":1,"38":1,"39":1,"40":1,"41":1,"42":1,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0},"b":{},"f":{"1":6,"2":1,"3":0,"4":1,"5":1,"6":3,"7":1,"8":3,"9":0,"10":0,"11":0,"12":0,"13":2,"14":0,"15":1,"16":0,"17":0,"18":4,"19":0,"20":0,"21":2,"22":1,"23":1,"24":1,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0},"fnMap":{"1":{"name":null,"line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":32,"column":10}}},"2":{"name":"getNumTokensAvailable","line":43,"loc":{"start":{"line":43,"column":2},"end":{"line":46,"column":18}}},"3":{"name":"getInvestorVotes","line":53,"loc":{"start":{"line":53,"column":2},"end":{"line":56,"column":18}}},"4":{"name":"getTotalVotes","line":60,"loc":{"start":{"line":60,"column":2},"end":{"line":63,"column":18}}},"5":{"name":"getCurrentConsensus","line":67,"loc":{"start":{"line":67,"column":2},"end":{"line":70,"column":18}}},"6":{"name":"getAssetManagerParameterHash","line":75,"loc":{"start":{"line":75,"column":2},"end":{"line":78,"column":20}}},"7":{"name":"getExecutionID","line":82,"loc":{"start":{"line":82,"column":2},"end":{"line":85,"column":21}}},"8":{"name":"getMethodID","line":89,"loc":{"start":{"line":89,"column":2},"end":{"line":92,"column":20}}},"9":{"name":"getAssetID","line":96,"loc":{"start":{"line":96,"column":2},"end":{"line":99,"column":20}}},"10":{"name":"getOrderID","line":103,"loc":{"start":{"line":103,"column":2},"end":{"line":106,"column":20}}},"11":{"name":"generateAssetID","line":114,"loc":{"start":{"line":114,"column":2},"end":{"line":117,"column":20}}},"12":{"name":"getAssetID","line":122,"loc":{"start":{"line":122,"column":2},"end":{"line":125,"column":20}}},"13":{"name":"getAssetAddress","line":130,"loc":{"start":{"line":130,"column":2},"end":{"line":133,"column":20}}},"14":{"name":"getAssetFundingToken","line":138,"loc":{"start":{"line":138,"column":2},"end":{"line":141,"column":20}}},"15":{"name":"getAssetROI","line":156,"loc":{"start":{"line":156,"column":2},"end":{"line":159,"column":18}}},"16":{"name":"getAssetFundingGoal","line":164,"loc":{"start":{"line":164,"column":2},"end":{"line":167,"column":17}}},"17":{"name":"getAssetFundingDeadline","line":172,"loc":{"start":{"line":172,"column":2},"end":{"line":175,"column":17}}},"18":{"name":"crowdsaleFinalized","line":180,"loc":{"start":{"line":180,"column":2},"end":{"line":183,"column":17}}},"19":{"name":"getAssetManager","line":193,"loc":{"start":{"line":193,"column":2},"end":{"line":196,"column":20}}},"20":{"name":"getAssetManagerFee","line":201,"loc":{"start":{"line":201,"column":2},"end":{"line":204,"column":17}}},"21":{"name":"getAssetManagerEscrowID","line":209,"loc":{"start":{"line":209,"column":2},"end":{"line":212,"column":20}}},"22":{"name":"getAssetManagerEscrow","line":217,"loc":{"start":{"line":217,"column":2},"end":{"line":220,"column":18}}},"23":{"name":"getAssetManagerEscrowRemaining","line":224,"loc":{"start":{"line":224,"column":2},"end":{"line":227,"column":17}}},"24":{"name":"getAssetManagerEscrowRedeemed","line":233,"loc":{"start":{"line":233,"column":2},"end":{"line":236,"column":17}}},"25":{"name":"getAssetOperator","line":241,"loc":{"start":{"line":241,"column":2},"end":{"line":244,"column":20}}},"26":{"name":"generateOperatorID","line":249,"loc":{"start":{"line":249,"column":2},"end":{"line":252,"column":20}}},"27":{"name":"getOperatorID","line":257,"loc":{"start":{"line":257,"column":2},"end":{"line":260,"column":20}}},"28":{"name":"getOperatorAddress","line":265,"loc":{"start":{"line":265,"column":2},"end":{"line":268,"column":20}}},"29":{"name":"generateOrderID","line":277,"loc":{"start":{"line":277,"column":2},"end":{"line":280,"column":20}}},"30":{"name":"getPlatformToken","line":290,"loc":{"start":{"line":290,"column":2},"end":{"line":293,"column":20}}},"31":{"name":"getPlatformWallet","line":298,"loc":{"start":{"line":298,"column":2},"end":{"line":301,"column":20}}},"32":{"name":"getContractAddress","line":306,"loc":{"start":{"line":306,"column":2},"end":{"line":309,"column":20}}},"33":{"name":"getCurrentState","line":314,"loc":{"start":{"line":314,"column":2},"end":{"line":317,"column":20}}},"34":{"name":"getUserPermission","line":322,"loc":{"start":{"line":322,"column":2},"end":{"line":325,"column":17}}},"35":{"name":"getFunctionCost","line":330,"loc":{"start":{"line":330,"column":2},"end":{"line":333,"column":17}}},"36":{"name":"contractPaused","line":338,"loc":{"start":{"line":338,"column":2},"end":{"line":341,"column":17}}},"37":{"name":"contractOwner","line":350,"loc":{"start":{"line":350,"column":2},"end":{"line":353,"column":17}}}},"statementMap":{"1":{"start":{"line":33,"column":4},"end":{"line":33,"column":31}},"2":{"start":{"line":47,"column":4},"end":{"line":47,"column":109}},"3":{"start":{"line":48,"column":4},"end":{"line":48,"column":102}},"4":{"start":{"line":49,"column":4},"end":{"line":49,"column":60}},"5":{"start":{"line":50,"column":4},"end":{"line":50,"column":36}},"6":{"start":{"line":57,"column":4},"end":{"line":57,"column":102}},"7":{"start":{"line":64,"column":2},"end":{"line":64,"column":85}},"8":{"start":{"line":71,"column":4},"end":{"line":71,"column":48}},"9":{"start":{"line":72,"column":4},"end":{"line":72,"column":68}},"10":{"start":{"line":79,"column":4},"end":{"line":79,"column":100}},"11":{"start":{"line":86,"column":4},"end":{"line":86,"column":95}},"12":{"start":{"line":93,"column":4},"end":{"line":93,"column":63}},"13":{"start":{"line":100,"column":4},"end":{"line":100,"column":87}},"14":{"start":{"line":107,"column":4},"end":{"line":107,"column":87}},"15":{"start":{"line":118,"column":4},"end":{"line":118,"column":97}},"16":{"start":{"line":119,"column":4},"end":{"line":119,"column":18}},"17":{"start":{"line":126,"column":4},"end":{"line":126,"column":104}},"18":{"start":{"line":127,"column":4},"end":{"line":127,"column":18}},"19":{"start":{"line":134,"column":4},"end":{"line":134,"column":104}},"20":{"start":{"line":135,"column":4},"end":{"line":135,"column":23}},"21":{"start":{"line":142,"column":4},"end":{"line":142,"column":111}},"22":{"start":{"line":143,"column":4},"end":{"line":143,"column":30}},"23":{"start":{"line":160,"column":4},"end":{"line":160,"column":62}},"24":{"start":{"line":161,"column":4},"end":{"line":161,"column":71}},"25":{"start":{"line":168,"column":4},"end":{"line":168,"column":98}},"26":{"start":{"line":169,"column":4},"end":{"line":169,"column":22}},"27":{"start":{"line":176,"column":4},"end":{"line":176,"column":104}},"28":{"start":{"line":177,"column":4},"end":{"line":177,"column":26}},"29":{"start":{"line":184,"column":4},"end":{"line":184,"column":98}},"30":{"start":{"line":185,"column":4},"end":{"line":185,"column":17}},"31":{"start":{"line":197,"column":4},"end":{"line":197,"column":106}},"32":{"start":{"line":198,"column":4},"end":{"line":198,"column":25}},"33":{"start":{"line":205,"column":4},"end":{"line":205,"column":99}},"34":{"start":{"line":206,"column":4},"end":{"line":206,"column":21}},"35":{"start":{"line":213,"column":4},"end":{"line":213,"column":76}},"36":{"start":{"line":214,"column":4},"end":{"line":214,"column":26}},"37":{"start":{"line":221,"column":4},"end":{"line":221,"column":100}},"38":{"start":{"line":228,"column":4},"end":{"line":228,"column":66}},"39":{"start":{"line":229,"column":4},"end":{"line":229,"column":126}},"40":{"start":{"line":230,"column":4},"end":{"line":230,"column":23}},"41":{"start":{"line":237,"column":4},"end":{"line":237,"column":110}},"42":{"start":{"line":238,"column":4},"end":{"line":238,"column":25}},"43":{"start":{"line":245,"column":4},"end":{"line":245,"column":103}},"44":{"start":{"line":246,"column":4},"end":{"line":246,"column":26}},"45":{"start":{"line":253,"column":4},"end":{"line":253,"column":65}},"46":{"start":{"line":254,"column":4},"end":{"line":254,"column":21}},"47":{"start":{"line":261,"column":4},"end":{"line":261,"column":106}},"48":{"start":{"line":262,"column":4},"end":{"line":262,"column":21}},"49":{"start":{"line":269,"column":4},"end":{"line":269,"column":106}},"50":{"start":{"line":270,"column":4},"end":{"line":270,"column":26}},"51":{"start":{"line":281,"column":4},"end":{"line":281,"column":95}},"52":{"start":{"line":282,"column":4},"end":{"line":282,"column":18}},"53":{"start":{"line":294,"column":4},"end":{"line":294,"column":95}},"54":{"start":{"line":295,"column":4},"end":{"line":295,"column":23}},"55":{"start":{"line":302,"column":4},"end":{"line":302,"column":97}},"56":{"start":{"line":303,"column":4},"end":{"line":303,"column":24}},"57":{"start":{"line":310,"column":4},"end":{"line":310,"column":108}},"58":{"start":{"line":311,"column":4},"end":{"line":311,"column":26}},"59":{"start":{"line":318,"column":4},"end":{"line":318,"column":94}},"60":{"start":{"line":319,"column":4},"end":{"line":319,"column":23}},"61":{"start":{"line":326,"column":4},"end":{"line":326,"column":96}},"62":{"start":{"line":327,"column":4},"end":{"line":327,"column":17}},"63":{"start":{"line":334,"column":4},"end":{"line":334,"column":81}},"64":{"start":{"line":335,"column":4},"end":{"line":335,"column":15}},"65":{"start":{"line":342,"column":4},"end":{"line":342,"column":87}},"66":{"start":{"line":343,"column":4},"end":{"line":343,"column":17}},"67":{"start":{"line":354,"column":4},"end":{"line":354,"column":85}},"68":{"start":{"line":355,"column":4},"end":{"line":355,"column":17}}},"branchMap":{}},"contracts/database/ContractManager.sol":{"l":{"15":16,"26":69,"27":68,"28":67,"29":67,"30":67,"31":67,"32":67,"33":67,"44":1,"45":1,"46":1,"47":1,"58":1,"59":1,"60":1,"61":1,"62":1,"63":1,"64":1,"65":1,"66":1,"76":177,"77":177,"78":177,"79":177,"80":177,"90":72,"91":71,"97":0,"98":0,"99":0,"103":4,"104":2,"108":147,"109":145},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/database/ContractManager.sol","s":{"1":16,"2":69,"3":68,"4":67,"5":67,"6":67,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":177,"15":177,"16":177,"17":72,"18":0,"19":4,"20":147},"b":{"1":[68,1],"2":[67,1],"3":[71,1],"4":[0,0],"5":[2,2],"6":[145,2]},"f":{"1":16,"2":69,"3":1,"4":1,"5":177,"6":72,"7":0,"8":4,"9":147},"fnMap":{"1":{"name":null,"line":13,"loc":{"start":{"line":13,"column":2},"end":{"line":14,"column":10}}},"2":{"name":"addContract","line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":25,"column":12}}},"3":{"name":"removeContract","line":39,"loc":{"start":{"line":39,"column":2},"end":{"line":43,"column":12}}},"4":{"name":"updateContract","line":53,"loc":{"start":{"line":53,"column":2},"end":{"line":57,"column":12}}},"5":{"name":"setContractStatePreferences","line":73,"loc":{"start":{"line":73,"column":2},"end":{"line":75,"column":18}}},"6":{"name":"anyOwner","line":89,"loc":{"start":{"line":89,"column":2},"end":{"line":89,"column":19}}},"7":{"name":"isRestricted","line":96,"loc":{"start":{"line":96,"column":2},"end":{"line":96,"column":65}}},"8":{"name":"contractExists","line":102,"loc":{"start":{"line":102,"column":2},"end":{"line":102,"column":44}}},"9":{"name":"isTrue","line":107,"loc":{"start":{"line":107,"column":2},"end":{"line":107,"column":36}}}},"statementMap":{"1":{"start":{"line":15,"column":4},"end":{"line":15,"column":36}},"2":{"start":{"line":26,"column":4},"end":{"line":26,"column":92}},"3":{"start":{"line":27,"column":4},"end":{"line":27,"column":97}},"4":{"start":{"line":30,"column":4},"end":{"line":30,"column":94}},"5":{"start":{"line":31,"column":4},"end":{"line":31,"column":81}},"6":{"start":{"line":33,"column":4},"end":{"line":33,"column":64}},"7":{"start":{"line":44,"column":4},"end":{"line":44,"column":101}},"8":{"start":{"line":47,"column":4},"end":{"line":47,"column":66}},"9":{"start":{"line":58,"column":4},"end":{"line":58,"column":95}},"10":{"start":{"line":62,"column":4},"end":{"line":62,"column":94}},"11":{"start":{"line":63,"column":4},"end":{"line":63,"column":84}},"12":{"start":{"line":65,"column":4},"end":{"line":65,"column":60}},"13":{"start":{"line":66,"column":4},"end":{"line":66,"column":73}},"14":{"start":{"line":76,"column":4},"end":{"line":76,"column":94}},"15":{"start":{"line":79,"column":4},"end":{"line":79,"column":96}},"16":{"start":{"line":80,"column":4},"end":{"line":80,"column":15}},"17":{"start":{"line":90,"column":4},"end":{"line":90,"column":82}},"18":{"start":{"line":97,"column":6},"end":{"line":97,"column":105}},"19":{"start":{"line":103,"column":4},"end":{"line":103,"column":84}},"20":{"start":{"line":108,"column":4},"end":{"line":108,"column":24}}},"branchMap":{"1":{"line":26,"type":"if","locations":[{"start":{"line":26,"column":4},"end":{"line":26,"column":4}},{"start":{"line":26,"column":4},"end":{"line":26,"column":4}}]},"2":{"line":27,"type":"if","locations":[{"start":{"line":27,"column":4},"end":{"line":27,"column":4}},{"start":{"line":27,"column":4},"end":{"line":27,"column":4}}]},"3":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":4},"end":{"line":90,"column":4}},{"start":{"line":90,"column":4},"end":{"line":90,"column":4}}]},"4":{"line":97,"type":"if","locations":[{"start":{"line":97,"column":6},"end":{"line":97,"column":6}},{"start":{"line":97,"column":6},"end":{"line":97,"column":6}}]},"5":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":4},"end":{"line":103,"column":4}},{"start":{"line":103,"column":4},"end":{"line":103,"column":4}}]},"6":{"line":108,"type":"if","locations":[{"start":{"line":108,"column":4},"end":{"line":108,"column":4}},{"start":{"line":108,"column":4},"end":{"line":108,"column":4}}]}}},"contracts/database/Database.sol":{"l":{"24":16,"25":17,"26":17,"28":16,"29":15,"38":19,"39":18,"40":17,"41":16,"42":15,"43":15,"50":142,"56":67,"62":1,"68":1,"74":87,"80":445,"86":1,"94":7,"100":23,"106":1,"112":1,"118":1,"124":7,"130":1,"140":786,"141":785},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/database/Database.sol","s":{"1":16,"2":17,"3":17,"4":16,"5":15,"6":19,"7":18,"8":17,"9":16,"10":15,"11":15,"12":142,"13":67,"14":1,"15":1,"16":87,"17":445,"18":1,"19":786},"b":{"1":[15,1],"2":[18,1],"3":[17,1],"4":[16,1],"5":[15,1],"6":[785,1]},"f":{"1":16,"2":19,"3":142,"4":67,"5":1,"6":1,"7":87,"8":445,"9":1,"10":7,"11":23,"12":1,"13":1,"14":1,"15":7,"16":1,"17":786},"fnMap":{"1":{"name":null,"line":23,"loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":58}}},"2":{"name":"enableContractManagement","line":36,"loc":{"start":{"line":36,"column":4},"end":{"line":37,"column":14}}},"3":{"name":"setAddress","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":49,"column":14}}},"4":{"name":"setUint","line":53,"loc":{"start":{"line":53,"column":4},"end":{"line":55,"column":14}}},"5":{"name":"setString","line":59,"loc":{"start":{"line":59,"column":4},"end":{"line":61,"column":14}}},"6":{"name":"setBytes","line":65,"loc":{"start":{"line":65,"column":4},"end":{"line":67,"column":14}}},"7":{"name":"setBytes32","line":71,"loc":{"start":{"line":71,"column":4},"end":{"line":73,"column":14}}},"8":{"name":"setBool","line":77,"loc":{"start":{"line":77,"column":4},"end":{"line":79,"column":14}}},"9":{"name":"setInt","line":83,"loc":{"start":{"line":83,"column":4},"end":{"line":85,"column":14}}},"10":{"name":"deleteAddress","line":91,"loc":{"start":{"line":91,"column":4},"end":{"line":93,"column":14}}},"11":{"name":"deleteUint","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":99,"column":14}}},"12":{"name":"deleteString","line":103,"loc":{"start":{"line":103,"column":4},"end":{"line":105,"column":14}}},"13":{"name":"deleteBytes","line":109,"loc":{"start":{"line":109,"column":4},"end":{"line":111,"column":14}}},"14":{"name":"deleteBytes32","line":115,"loc":{"start":{"line":115,"column":4},"end":{"line":117,"column":14}}},"15":{"name":"deleteBool","line":121,"loc":{"start":{"line":121,"column":4},"end":{"line":123,"column":14}}},"16":{"name":"deleteInt","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":129,"column":14}}},"17":{"name":"onlyApprovedContract","line":139,"loc":{"start":{"line":139,"column":4},"end":{"line":139,"column":33}}}},"statementMap":{"1":{"start":{"line":24,"column":6},"end":{"line":24,"column":962}},"2":{"start":{"line":25,"column":8},"end":{"line":25,"column":75}},"3":{"start":{"line":26,"column":8},"end":{"line":26,"column":53}},"4":{"start":{"line":28,"column":6},"end":{"line":28,"column":1147}},"5":{"start":{"line":29,"column":8},"end":{"line":29,"column":51}},"6":{"start":{"line":38,"column":8},"end":{"line":38,"column":53}},"7":{"start":{"line":39,"column":8},"end":{"line":39,"column":46}},"8":{"start":{"line":40,"column":8},"end":{"line":40,"column":77}},"9":{"start":{"line":41,"column":8},"end":{"line":41,"column":104}},"10":{"start":{"line":42,"column":8},"end":{"line":42,"column":100}},"11":{"start":{"line":43,"column":8},"end":{"line":43,"column":84}},"12":{"start":{"line":50,"column":8},"end":{"line":50,"column":36}},"13":{"start":{"line":56,"column":8},"end":{"line":56,"column":33}},"14":{"start":{"line":62,"column":8},"end":{"line":62,"column":35}},"15":{"start":{"line":68,"column":8},"end":{"line":68,"column":34}},"16":{"start":{"line":74,"column":8},"end":{"line":74,"column":36}},"17":{"start":{"line":80,"column":8},"end":{"line":80,"column":33}},"18":{"start":{"line":86,"column":8},"end":{"line":86,"column":32}},"19":{"start":{"line":140,"column":8},"end":{"line":140,"column":80}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":6},"end":{"line":28,"column":6}},{"start":{"line":28,"column":6},"end":{"line":28,"column":6}}]},"2":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":8},"end":{"line":38,"column":8}},{"start":{"line":38,"column":8},"end":{"line":38,"column":8}}]},"3":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":8},"end":{"line":39,"column":8}},{"start":{"line":39,"column":8},"end":{"line":39,"column":8}}]},"4":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":8},"end":{"line":40,"column":8}},{"start":{"line":40,"column":8},"end":{"line":40,"column":8}}]},"5":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":8},"end":{"line":41,"column":8}},{"start":{"line":41,"column":8},"end":{"line":41,"column":8}}]},"6":{"line":140,"type":"if","locations":[{"start":{"line":140,"column":8},"end":{"line":140,"column":8}},{"start":{"line":140,"column":8},"end":{"line":140,"column":8}}]}}},"contracts/database/Events.sol":{"l":{"11":0,"21":0,"22":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/database/Events.sol","s":{"1":0,"2":0},"b":{"1":[0,0]},"f":{"1":0,"2":0},"fnMap":{"1":{"name":"numberStored","line":8,"loc":{"start":{"line":8,"column":2},"end":{"line":10,"column":24}}},"2":{"name":"onlyApprovedContract","line":20,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":33}}}},"statementMap":{"1":{"start":{"line":11,"column":6},"end":{"line":11,"column":51}},"2":{"start":{"line":21,"column":6},"end":{"line":21,"column":87}}},"branchMap":{"1":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":6},"end":{"line":21,"column":6}},{"start":{"line":21,"column":6},"end":{"line":21,"column":6}}]}}},"contracts/database/HashEncode.sol":{"l":{"5":0,"8":0,"11":0,"14":0,"17":0,"20":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/database/HashEncode.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"b":{},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0},"fnMap":{"1":{"name":"encode","line":4,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":75}}},"2":{"name":"encode","line":7,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":90}}},"3":{"name":"encode","line":10,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":87}}},"4":{"name":"encode","line":13,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":75}}},"5":{"name":"encode","line":16,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":72}}},"6":{"name":"encode","line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":72}}}},"statementMap":{"1":{"start":{"line":5,"column":4},"end":{"line":5,"column":53}},"2":{"start":{"line":8,"column":4},"end":{"line":8,"column":60}},"3":{"start":{"line":11,"column":4},"end":{"line":11,"column":60}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":53}},"5":{"start":{"line":17,"column":4},"end":{"line":17,"column":53}},"6":{"start":{"line":20,"column":4},"end":{"line":20,"column":53}}},"branchMap":{}},"contracts/ecosystem/AssetExchange.sol":{"l":{"29":2,"30":2,"46":4,"47":4,"48":3,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"67":2,"68":2,"69":1,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"76":1,"91":4,"92":3,"93":3,"94":2,"95":2,"96":2,"97":2,"98":2,"111":3,"112":3,"113":2,"114":2,"115":2,"116":2,"129":3,"130":3,"131":2,"132":1,"133":1,"134":1,"136":2,"137":2,"146":1,"147":1,"148":1,"149":1,"159":3,"160":2,"161":1,"162":1,"175":10,"176":9,"177":8,"184":10,"185":9,"192":11,"193":10,"199":8,"200":8,"207":8,"208":7,"215":7,"216":6,"223":4,"224":3},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/AssetExchange.sol","s":{"1":2,"2":2,"3":4,"4":4,"5":3,"6":1,"7":1,"8":1,"9":1,"10":1,"11":2,"12":2,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":4,"21":3,"22":3,"23":2,"24":2,"25":2,"26":2,"27":2,"28":3,"29":3,"30":2,"31":2,"32":2,"33":2,"34":3,"35":3,"36":2,"37":1,"38":1,"39":1,"40":2,"41":1,"42":1,"43":1,"44":3,"45":2,"46":1,"47":1,"48":10,"49":9,"50":10,"51":11,"52":8,"53":8,"54":7,"55":4},"b":{"1":[3,1],"2":[1,2],"3":[1,0],"4":[1,1],"5":[1,0],"6":[3,1],"7":[2,1],"8":[2,1],"9":[2,1],"10":[1,1],"11":[2,1],"12":[1,1],"13":[9,1],"14":[8,1],"15":[9,1],"16":[10,1],"17":[8,0],"18":[7,1],"19":[6,1],"20":[3,1]},"f":{"1":2,"2":4,"3":2,"4":4,"5":3,"6":3,"7":1,"8":3,"9":10,"10":10,"11":11,"12":8,"13":8,"14":7,"15":4},"fnMap":{"1":{"name":null,"line":27,"loc":{"start":{"line":27,"column":2},"end":{"line":28,"column":10}}},"2":{"name":"buyAsset","line":39,"loc":{"start":{"line":39,"column":2},"end":{"line":45,"column":17}}},"3":{"name":"sellAsset","line":62,"loc":{"start":{"line":62,"column":2},"end":{"line":66,"column":17}}},"4":{"name":"createBuyOrder","line":83,"loc":{"start":{"line":83,"column":2},"end":{"line":90,"column":18}}},"5":{"name":"createSellOrder","line":105,"loc":{"start":{"line":105,"column":2},"end":{"line":110,"column":18}}},"6":{"name":"deleteOrder","line":126,"loc":{"start":{"line":126,"column":2},"end":{"line":128,"column":18}}},"7":{"name":"withdraw","line":142,"loc":{"start":{"line":142,"column":2},"end":{"line":145,"column":17}}},"8":{"name":"destroy","line":156,"loc":{"start":{"line":156,"column":2},"end":{"line":158,"column":10}}},"9":{"name":"validAsset","line":174,"loc":{"start":{"line":174,"column":2},"end":{"line":174,"column":39}}},"10":{"name":"isAllowed","line":183,"loc":{"start":{"line":183,"column":2},"end":{"line":183,"column":69}}},"11":{"name":"aboveZero","line":191,"loc":{"start":{"line":191,"column":2},"end":{"line":191,"column":47}}},"12":{"name":"burnRequired","line":197,"loc":{"start":{"line":197,"column":2},"end":{"line":197,"column":23}}},"13":{"name":"whenNotPaused","line":206,"loc":{"start":{"line":206,"column":2},"end":{"line":206,"column":24}}},"14":{"name":"requiresEther","line":214,"loc":{"start":{"line":214,"column":2},"end":{"line":214,"column":26}}},"15":{"name":"anyOwner","line":222,"loc":{"start":{"line":222,"column":2},"end":{"line":222,"column":19}}}},"statementMap":{"1":{"start":{"line":29,"column":4},"end":{"line":29,"column":33}},"2":{"start":{"line":30,"column":4},"end":{"line":30,"column":104}},"3":{"start":{"line":46,"column":4},"end":{"line":46,"column":93}},"4":{"start":{"line":47,"column":4},"end":{"line":47,"column":38}},"5":{"start":{"line":48,"column":4},"end":{"line":48,"column":58}},"6":{"start":{"line":49,"column":4},"end":{"line":49,"column":113}},"7":{"start":{"line":50,"column":4},"end":{"line":50,"column":65}},"8":{"start":{"line":51,"column":4},"end":{"line":51,"column":53}},"9":{"start":{"line":53,"column":4},"end":{"line":53,"column":63}},"10":{"start":{"line":54,"column":4},"end":{"line":54,"column":15}},"11":{"start":{"line":67,"column":4},"end":{"line":67,"column":91}},"12":{"start":{"line":68,"column":4},"end":{"line":68,"column":37}},"13":{"start":{"line":69,"column":4},"end":{"line":69,"column":49}},"14":{"start":{"line":70,"column":4},"end":{"line":70,"column":113}},"15":{"start":{"line":71,"column":4},"end":{"line":71,"column":64}},"16":{"start":{"line":72,"column":4},"end":{"line":72,"column":57}},"17":{"start":{"line":73,"column":4},"end":{"line":73,"column":55}},"18":{"start":{"line":75,"column":4},"end":{"line":75,"column":62}},"19":{"start":{"line":76,"column":4},"end":{"line":76,"column":15}},"20":{"start":{"line":91,"column":4},"end":{"line":91,"column":58}},"21":{"start":{"line":92,"column":4},"end":{"line":92,"column":93}},"22":{"start":{"line":93,"column":4},"end":{"line":93,"column":40}},"23":{"start":{"line":94,"column":4},"end":{"line":94,"column":37}},"24":{"start":{"line":95,"column":4},"end":{"line":95,"column":69}},"25":{"start":{"line":96,"column":4},"end":{"line":96,"column":58}},"26":{"start":{"line":97,"column":4},"end":{"line":97,"column":53}},"27":{"start":{"line":98,"column":4},"end":{"line":98,"column":15}},"28":{"start":{"line":111,"column":4},"end":{"line":111,"column":94}},"29":{"start":{"line":112,"column":4},"end":{"line":112,"column":40}},"30":{"start":{"line":113,"column":4},"end":{"line":113,"column":37}},"31":{"start":{"line":114,"column":4},"end":{"line":114,"column":59}},"32":{"start":{"line":115,"column":4},"end":{"line":115,"column":54}},"33":{"start":{"line":116,"column":4},"end":{"line":116,"column":15}},"34":{"start":{"line":129,"column":4},"end":{"line":129,"column":98}},"35":{"start":{"line":130,"column":4},"end":{"line":130,"column":39}},"36":{"start":{"line":131,"column":4},"end":{"line":131,"column":5830}},"37":{"start":{"line":132,"column":6},"end":{"line":132,"column":57}},"38":{"start":{"line":133,"column":6},"end":{"line":133,"column":73}},"39":{"start":{"line":134,"column":6},"end":{"line":134,"column":63}},"40":{"start":{"line":137,"column":4},"end":{"line":137,"column":15}},"41":{"start":{"line":146,"column":4},"end":{"line":146,"column":34}},"42":{"start":{"line":147,"column":4},"end":{"line":147,"column":26}},"43":{"start":{"line":149,"column":4},"end":{"line":149,"column":15}},"44":{"start":{"line":159,"column":4},"end":{"line":159,"column":44}},"45":{"start":{"line":160,"column":4},"end":{"line":160,"column":153}},"46":{"start":{"line":161,"column":4},"end":{"line":161,"column":75}},"47":{"start":{"line":162,"column":4},"end":{"line":162,"column":32}},"48":{"start":{"line":175,"column":4},"end":{"line":175,"column":35}},"49":{"start":{"line":176,"column":4},"end":{"line":176,"column":94}},"50":{"start":{"line":184,"column":4},"end":{"line":184,"column":145}},"51":{"start":{"line":192,"column":4},"end":{"line":192,"column":35}},"52":{"start":{"line":199,"column":4},"end":{"line":199,"column":110}},"53":{"start":{"line":207,"column":4},"end":{"line":207,"column":87}},"54":{"start":{"line":215,"column":4},"end":{"line":215,"column":25}},"55":{"start":{"line":223,"column":4},"end":{"line":223,"column":82}}},"branchMap":{"1":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":47,"column":4}},{"start":{"line":47,"column":4},"end":{"line":47,"column":4}}]},"2":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":4},"end":{"line":48,"column":4}},{"start":{"line":48,"column":4},"end":{"line":48,"column":4}}]},"3":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":50,"column":4}},{"start":{"line":50,"column":4},"end":{"line":50,"column":4}}]},"4":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":4},"end":{"line":68,"column":4}},{"start":{"line":68,"column":4},"end":{"line":68,"column":4}}]},"5":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":71,"column":4}},{"start":{"line":71,"column":4},"end":{"line":71,"column":4}}]},"6":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":4},"end":{"line":91,"column":4}},{"start":{"line":91,"column":4},"end":{"line":91,"column":4}}]},"7":{"line":93,"type":"if","locations":[{"start":{"line":93,"column":4},"end":{"line":93,"column":4}},{"start":{"line":93,"column":4},"end":{"line":93,"column":4}}]},"8":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":4},"end":{"line":112,"column":4}},{"start":{"line":112,"column":4},"end":{"line":112,"column":4}}]},"9":{"line":130,"type":"if","locations":[{"start":{"line":130,"column":4},"end":{"line":130,"column":4}},{"start":{"line":130,"column":4},"end":{"line":130,"column":4}}]},"10":{"line":131,"type":"if","locations":[{"start":{"line":131,"column":4},"end":{"line":131,"column":4}},{"start":{"line":131,"column":4},"end":{"line":131,"column":4}}]},"11":{"line":159,"type":"if","locations":[{"start":{"line":159,"column":4},"end":{"line":159,"column":4}},{"start":{"line":159,"column":4},"end":{"line":159,"column":4}}]},"12":{"line":160,"type":"if","locations":[{"start":{"line":160,"column":4},"end":{"line":160,"column":4}},{"start":{"line":160,"column":4},"end":{"line":160,"column":4}}]},"13":{"line":175,"type":"if","locations":[{"start":{"line":175,"column":4},"end":{"line":175,"column":4}},{"start":{"line":175,"column":4},"end":{"line":175,"column":4}}]},"14":{"line":176,"type":"if","locations":[{"start":{"line":176,"column":4},"end":{"line":176,"column":4}},{"start":{"line":176,"column":4},"end":{"line":176,"column":4}}]},"15":{"line":184,"type":"if","locations":[{"start":{"line":184,"column":4},"end":{"line":184,"column":4}},{"start":{"line":184,"column":4},"end":{"line":184,"column":4}}]},"16":{"line":192,"type":"if","locations":[{"start":{"line":192,"column":4},"end":{"line":192,"column":4}},{"start":{"line":192,"column":4},"end":{"line":192,"column":4}}]},"17":{"line":199,"type":"if","locations":[{"start":{"line":199,"column":4},"end":{"line":199,"column":4}},{"start":{"line":199,"column":4},"end":{"line":199,"column":4}}]},"18":{"line":207,"type":"if","locations":[{"start":{"line":207,"column":4},"end":{"line":207,"column":4}},{"start":{"line":207,"column":4},"end":{"line":207,"column":4}}]},"19":{"line":215,"type":"if","locations":[{"start":{"line":215,"column":4},"end":{"line":215,"column":4}},{"start":{"line":215,"column":4},"end":{"line":215,"column":4}}]},"20":{"line":223,"type":"if","locations":[{"start":{"line":223,"column":4},"end":{"line":223,"column":4}},{"start":{"line":223,"column":4},"end":{"line":223,"column":4}}]}}},"contracts/ecosystem/AssetGenerator.sol":{"l":{"21":1,"31":2,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"47":2,"48":1,"49":1,"50":1,"51":1,"52":1,"53":4,"55":1,"56":1,"57":1,"58":1,"59":1,"65":4,"66":4,"67":4},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/AssetGenerator.sol","s":{"1":1,"2":2,"3":1,"4":1,"5":1,"6":1,"7":1,"8":2,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":4,"17":4},"b":{"1":[1,1],"2":[1,0],"3":[1,1],"4":[1,0],"5":[4,0]},"f":{"1":1,"2":2,"3":2,"4":4},"fnMap":{"1":{"name":null,"line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":9}}},"2":{"name":"createAsset","line":27,"loc":{"start":{"line":27,"column":2},"end":{"line":30,"column":18}}},"3":{"name":"createTradeableAsset","line":43,"loc":{"start":{"line":43,"column":2},"end":{"line":46,"column":18}}},"4":{"name":"burnRequired","line":64,"loc":{"start":{"line":64,"column":2},"end":{"line":64,"column":23}}}},"statementMap":{"1":{"start":{"line":21,"column":6},"end":{"line":21,"column":38}},"2":{"start":{"line":31,"column":4},"end":{"line":31,"column":82}},"3":{"start":{"line":32,"column":4},"end":{"line":32,"column":71}},"4":{"start":{"line":33,"column":4},"end":{"line":33,"column":103}},"5":{"start":{"line":34,"column":4},"end":{"line":34,"column":93}},"6":{"start":{"line":37,"column":4},"end":{"line":37,"column":80}},"7":{"start":{"line":38,"column":4},"end":{"line":38,"column":15}},"8":{"start":{"line":47,"column":4},"end":{"line":47,"column":89}},"9":{"start":{"line":48,"column":4},"end":{"line":48,"column":117}},"10":{"start":{"line":49,"column":4},"end":{"line":49,"column":71}},"11":{"start":{"line":50,"column":4},"end":{"line":50,"column":103}},"12":{"start":{"line":51,"column":4},"end":{"line":51,"column":84}},"13":{"start":{"line":52,"column":4},"end":{"line":52,"column":2353}},"14":{"start":{"line":58,"column":4},"end":{"line":58,"column":89}},"15":{"start":{"line":59,"column":4},"end":{"line":59,"column":15}},"16":{"start":{"line":65,"column":4},"end":{"line":65,"column":116}},"17":{"start":{"line":66,"column":4},"end":{"line":66,"column":110}}},"branchMap":{"1":{"line":31,"type":"if","locations":[{"start":{"line":31,"column":4},"end":{"line":31,"column":4}},{"start":{"line":31,"column":4},"end":{"line":31,"column":4}}]},"2":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":4},"end":{"line":33,"column":4}},{"start":{"line":33,"column":4},"end":{"line":33,"column":4}}]},"3":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":4},"end":{"line":47,"column":4}},{"start":{"line":47,"column":4},"end":{"line":47,"column":4}}]},"4":{"line":50,"type":"if","locations":[{"start":{"line":50,"column":4},"end":{"line":50,"column":4}},{"start":{"line":50,"column":4},"end":{"line":50,"column":4}}]},"5":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]}}},"contracts/ecosystem/PlatformFunds.sol":{"l":{"12":9,"20":7,"21":7,"28":9,"29":9,"38":18,"39":16},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/PlatformFunds.sol","s":{"1":9,"2":7,"3":9,"4":18},"b":{"1":[16,2]},"f":{"1":9,"2":7,"3":9,"4":18},"fnMap":{"1":{"name":null,"line":10,"loc":{"start":{"line":10,"column":2},"end":{"line":11,"column":10}}},"2":{"name":"setPlatformWallet","line":17,"loc":{"start":{"line":17,"column":2},"end":{"line":19,"column":13}}},"3":{"name":"setPlatformToken","line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":27,"column":13}}},"4":{"name":"onlyOwner","line":37,"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":20}}}},"statementMap":{"1":{"start":{"line":12,"column":4},"end":{"line":12,"column":33}},"2":{"start":{"line":21,"column":4},"end":{"line":21,"column":42}},"3":{"start":{"line":29,"column":4},"end":{"line":29,"column":40}},"4":{"start":{"line":38,"column":4},"end":{"line":38,"column":82}}},"branchMap":{"1":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]}}},"contracts/ecosystem/Staking.sol":{"l":{"20":0,"27":0,"28":0,"29":0,"30":0,"31":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"59":0,"60":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/Staking.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0},"fnMap":{"1":{"name":null,"line":18,"loc":{"start":{"line":18,"column":4},"end":{"line":19,"column":12}}},"2":{"name":"requestStaking","line":24,"loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":20}}},"3":{"name":"purchaseStake","line":35,"loc":{"start":{"line":35,"column":4},"end":{"line":37,"column":20}}},"4":{"name":"noEmptyBytes","line":58,"loc":{"start":{"line":58,"column":2},"end":{"line":58,"column":38}}}},"statementMap":{"1":{"start":{"line":20,"column":6},"end":{"line":20,"column":35}},"2":{"start":{"line":27,"column":6},"end":{"line":27,"column":105}},"3":{"start":{"line":29,"column":6},"end":{"line":29,"column":99}},"4":{"start":{"line":31,"column":6},"end":{"line":31,"column":17}},"5":{"start":{"line":38,"column":6},"end":{"line":38,"column":105}},"6":{"start":{"line":39,"column":6},"end":{"line":39,"column":65}},"7":{"start":{"line":40,"column":6},"end":{"line":40,"column":102}},"8":{"start":{"line":41,"column":6},"end":{"line":41,"column":145}},"9":{"start":{"line":42,"column":6},"end":{"line":42,"column":84}},"10":{"start":{"line":44,"column":6},"end":{"line":44,"column":56}},"11":{"start":{"line":45,"column":6},"end":{"line":45,"column":57}},"12":{"start":{"line":46,"column":6},"end":{"line":46,"column":47}},"13":{"start":{"line":47,"column":6},"end":{"line":47,"column":17}},"14":{"start":{"line":59,"column":4},"end":{"line":59,"column":31}}},"branchMap":{"1":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":6},"end":{"line":39,"column":6}},{"start":{"line":39,"column":6},"end":{"line":39,"column":6}}]},"2":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":6}},{"start":{"line":44,"column":6},"end":{"line":44,"column":6}}]},"3":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":45,"column":6}},{"start":{"line":45,"column":6},"end":{"line":45,"column":6}}]},"4":{"line":46,"type":"if","locations":[{"start":{"line":46,"column":6},"end":{"line":46,"column":6}},{"start":{"line":46,"column":6},"end":{"line":46,"column":6}}]},"5":{"line":59,"type":"if","locations":[{"start":{"line":59,"column":4},"end":{"line":59,"column":4}},{"start":{"line":59,"column":4},"end":{"line":59,"column":4}}]}}},"contracts/interfaces/ApproveAndCallFallback.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ApproveAndCallFallback.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/BurnableERC20.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/BurnableERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/BurnERC20.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/BurnERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/DBInterface.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/DBInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/DivToken.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/DivToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/ERC20.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ERC20.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/ERC20DividendInterface.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ERC20DividendInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/EtherDividendInterface.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/EtherDividendInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/GovToken.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/GovToken.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/PullPayment.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/PullPayment.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/interfaces/TokenFactoryInterface.sol":{"l":{},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/TokenFactoryInterface.sol","s":{},"b":{},"f":{},"fnMap":{},"statementMap":{},"branchMap":{}},"contracts/math/SafeMath.sol":{"l":{"11":149,"12":27,"14":122,"15":122,"16":121,"24":109,"29":497,"30":493,"35":474,"36":474,"37":473,"45":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/math/SafeMath.sol","s":{"1":149,"2":27,"3":122,"4":122,"5":121,"6":109,"7":497,"8":493,"9":474,"10":474,"11":473,"12":1},"b":{"1":[27,122],"2":[121,1],"3":[493,4],"4":[473,1]},"f":{"1":149,"2":109,"3":497,"4":474,"5":1},"fnMap":{"1":{"name":"mul","line":10,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":68}}},"2":{"name":"div","line":20,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":68}}},"3":{"name":"sub","line":28,"loc":{"start":{"line":28,"column":2},"end":{"line":28,"column":68}}},"4":{"name":"add","line":34,"loc":{"start":{"line":34,"column":2},"end":{"line":34,"column":68}}},"5":{"name":"getFractionalAmount","line":41,"loc":{"start":{"line":41,"column":2},"end":{"line":44,"column":21}}}},"statementMap":{"1":{"start":{"line":11,"column":4},"end":{"line":11,"column":388}},"2":{"start":{"line":12,"column":6},"end":{"line":12,"column":14}},"3":{"start":{"line":14,"column":4},"end":{"line":14,"column":20}},"4":{"start":{"line":15,"column":4},"end":{"line":15,"column":21}},"5":{"start":{"line":16,"column":4},"end":{"line":16,"column":12}},"6":{"start":{"line":24,"column":4},"end":{"line":24,"column":16}},"7":{"start":{"line":29,"column":4},"end":{"line":29,"column":17}},"8":{"start":{"line":30,"column":4},"end":{"line":30,"column":16}},"9":{"start":{"line":35,"column":4},"end":{"line":35,"column":20}},"10":{"start":{"line":36,"column":4},"end":{"line":36,"column":17}},"11":{"start":{"line":37,"column":4},"end":{"line":37,"column":12}},"12":{"start":{"line":45,"column":4},"end":{"line":45,"column":46}}},"branchMap":{"1":{"line":11,"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":11,"column":4}},{"start":{"line":11,"column":4},"end":{"line":11,"column":4}}]},"2":{"line":15,"type":"if","locations":[{"start":{"line":15,"column":4},"end":{"line":15,"column":4}},{"start":{"line":15,"column":4},"end":{"line":15,"column":4}}]},"3":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":4},"end":{"line":29,"column":4}},{"start":{"line":29,"column":4},"end":{"line":29,"column":4}}]},"4":{"line":36,"type":"if","locations":[{"start":{"line":36,"column":4},"end":{"line":36,"column":4}},{"start":{"line":36,"column":4},"end":{"line":36,"column":4}}]}}},"contracts/ownership/AssetGovernance.sol":{"l":{"27":1,"37":4,"38":4,"39":4,"40":4,"41":4,"42":4,"43":3,"44":3,"45":3,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"75":1,"76":1,"77":1,"78":1,"79":1,"92":4,"93":4,"94":4,"95":3,"96":3,"115":4,"116":4},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ownership/AssetGovernance.sol","s":{"1":1,"2":4,"3":4,"4":4,"5":4,"6":4,"7":4,"8":3,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":1,"17":1,"18":1,"19":1,"20":1,"21":4,"22":4,"23":4,"24":3,"25":4},"b":{"1":[3,1],"2":[0,0],"3":[3,1],"4":[4,0]},"f":{"1":1,"2":4,"3":0,"4":1,"5":4,"6":4},"fnMap":{"1":{"name":null,"line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":26,"column":10}}},"2":{"name":"voteForExecution","line":33,"loc":{"start":{"line":33,"column":2},"end":{"line":36,"column":18}}},"3":{"name":"unlockToken","line":51,"loc":{"start":{"line":51,"column":2},"end":{"line":54,"column":18}}},"4":{"name":"isConsensusReached","line":71,"loc":{"start":{"line":71,"column":2},"end":{"line":74,"column":18}}},"5":{"name":"lockTokens","line":89,"loc":{"start":{"line":89,"column":2},"end":{"line":91,"column":18}}},"6":{"name":"validAsset","line":114,"loc":{"start":{"line":114,"column":2},"end":{"line":114,"column":39}}}},"statementMap":{"1":{"start":{"line":27,"column":4},"end":{"line":27,"column":27}},"2":{"start":{"line":37,"column":4},"end":{"line":37,"column":109}},"3":{"start":{"line":38,"column":4},"end":{"line":38,"column":77}},"4":{"start":{"line":39,"column":4},"end":{"line":39,"column":98}},"5":{"start":{"line":40,"column":4},"end":{"line":40,"column":54}},"6":{"start":{"line":41,"column":4},"end":{"line":41,"column":64}},"7":{"start":{"line":42,"column":4},"end":{"line":42,"column":59}},"8":{"start":{"line":45,"column":4},"end":{"line":45,"column":15}},"9":{"start":{"line":55,"column":4},"end":{"line":55,"column":109}},"10":{"start":{"line":56,"column":4},"end":{"line":56,"column":78}},"11":{"start":{"line":57,"column":4},"end":{"line":57,"column":86}},"12":{"start":{"line":58,"column":4},"end":{"line":58,"column":61}},"13":{"start":{"line":59,"column":4},"end":{"line":59,"column":54}},"14":{"start":{"line":60,"column":4},"end":{"line":60,"column":44}},"15":{"start":{"line":63,"column":4},"end":{"line":63,"column":15}},"16":{"start":{"line":75,"column":4},"end":{"line":75,"column":115}},"17":{"start":{"line":76,"column":4},"end":{"line":76,"column":109}},"18":{"start":{"line":77,"column":4},"end":{"line":77,"column":77}},"19":{"start":{"line":78,"column":4},"end":{"line":78,"column":47}},"20":{"start":{"line":79,"column":4},"end":{"line":79,"column":73}},"21":{"start":{"line":92,"column":4},"end":{"line":92,"column":115}},"22":{"start":{"line":93,"column":4},"end":{"line":93,"column":112}},"23":{"start":{"line":94,"column":4},"end":{"line":94,"column":75}},"24":{"start":{"line":96,"column":4},"end":{"line":96,"column":15}},"25":{"start":{"line":115,"column":4},"end":{"line":115,"column":104}}},"branchMap":{"1":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"2":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":60,"column":4}},{"start":{"line":60,"column":4},"end":{"line":60,"column":4}}]},"3":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"4":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":4},"end":{"line":115,"column":4}},{"start":{"line":115,"column":4},"end":{"line":115,"column":4}}]}}},"contracts/ownership/CollectiveOwned.sol":{"l":{"21":0,"22":0,"23":0,"24":0,"34":0,"35":0,"36":0,"45":0,"53":0,"54":0,"55":0,"62":0,"63":0,"64":0,"65":0,"66":0,"78":0,"79":0,"80":0,"81":0,"83":0,"94":0,"95":0,"101":0,"102":0,"103":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ownership/CollectiveOwned.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":null,"line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":10}}},"2":{"name":"addOwner","line":30,"loc":{"start":{"line":30,"column":2},"end":{"line":33,"column":13}}},"3":{"name":"removeOwner","line":41,"loc":{"start":{"line":41,"column":2},"end":{"line":44,"column":13}}},"4":{"name":"setQuorumLevel","line":49,"loc":{"start":{"line":49,"column":2},"end":{"line":52,"column":18}}},"5":{"name":"voteForExecution","line":59,"loc":{"start":{"line":59,"column":2},"end":{"line":61,"column":18}}},"6":{"name":"isQuorumReached","line":74,"loc":{"start":{"line":74,"column":2},"end":{"line":77,"column":18}}},"7":{"name":"onlyOwner","line":93,"loc":{"start":{"line":93,"column":2},"end":{"line":93,"column":20}}},"8":{"name":"isRestricted","line":100,"loc":{"start":{"line":100,"column":2},"end":{"line":100,"column":65}}}},"statementMap":{"1":{"start":{"line":21,"column":4},"end":{"line":21,"column":33}},"2":{"start":{"line":22,"column":4},"end":{"line":22,"column":100}},"3":{"start":{"line":23,"column":4},"end":{"line":23,"column":76}},"4":{"start":{"line":34,"column":4},"end":{"line":34,"column":87}},"5":{"start":{"line":53,"column":4},"end":{"line":53,"column":80}},"6":{"start":{"line":55,"column":4},"end":{"line":55,"column":15}},"7":{"start":{"line":62,"column":4},"end":{"line":62,"column":97}},"8":{"start":{"line":63,"column":4},"end":{"line":63,"column":86}},"9":{"start":{"line":64,"column":4},"end":{"line":64,"column":59}},"10":{"start":{"line":66,"column":4},"end":{"line":66,"column":15}},"11":{"start":{"line":78,"column":4},"end":{"line":78,"column":103}},"12":{"start":{"line":79,"column":4},"end":{"line":79,"column":97}},"13":{"start":{"line":80,"column":4},"end":{"line":80,"column":81}},"14":{"start":{"line":81,"column":4},"end":{"line":81,"column":90}},"15":{"start":{"line":83,"column":4},"end":{"line":83,"column":82}},"16":{"start":{"line":94,"column":4},"end":{"line":94,"column":90}},"17":{"start":{"line":101,"column":4},"end":{"line":101,"column":69}}},"branchMap":{"1":{"line":94,"type":"if","locations":[{"start":{"line":94,"column":4},"end":{"line":94,"column":4}},{"start":{"line":94,"column":4},"end":{"line":94,"column":4}}]},"2":{"line":101,"type":"if","locations":[{"start":{"line":101,"column":4},"end":{"line":101,"column":4}},{"start":{"line":101,"column":4},"end":{"line":101,"column":4}}]}}},"contracts/ownership/Pausible.sol":{"l":{"16":4,"24":3,"25":3,"33":3,"34":3,"39":7,"40":6},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ownership/Pausible.sol","s":{"1":4,"2":3,"3":3,"4":7},"b":{"1":[6,1]},"f":{"1":4,"2":3,"3":3,"4":7},"fnMap":{"1":{"name":null,"line":14,"loc":{"start":{"line":14,"column":2},"end":{"line":15,"column":10}}},"2":{"name":"pause","line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":23,"column":10}}},"3":{"name":"unpause","line":30,"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":10}}},"4":{"name":"onlyOwner","line":38,"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":22}}}},"statementMap":{"1":{"start":{"line":16,"column":4},"end":{"line":16,"column":33}},"2":{"start":{"line":25,"column":4},"end":{"line":25,"column":41}},"3":{"start":{"line":34,"column":4},"end":{"line":34,"column":43}},"4":{"start":{"line":39,"column":4},"end":{"line":39,"column":82}}},"branchMap":{"1":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":4}},{"start":{"line":39,"column":4},"end":{"line":39,"column":4}}]}}},"contracts/ownership/SingleOwned.sol":{"l":{"14":2,"21":1,"22":1,"23":1,"28":2,"29":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ownership/SingleOwned.sol","s":{"1":2,"2":1,"3":2},"b":{"1":[1,1]},"f":{"1":2,"2":1,"3":2},"fnMap":{"1":{"name":null,"line":13,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":39}}},"2":{"name":"changeOwner","line":18,"loc":{"start":{"line":18,"column":2},"end":{"line":20,"column":13}}},"3":{"name":"onlyOwner","line":27,"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":22}}}},"statementMap":{"1":{"start":{"line":14,"column":4},"end":{"line":14,"column":33}},"2":{"start":{"line":23,"column":4},"end":{"line":23,"column":52}},"3":{"start":{"line":28,"column":4},"end":{"line":28,"column":90}}},"branchMap":{"1":{"line":28,"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":28,"column":4}},{"start":{"line":28,"column":4},"end":{"line":28,"column":4}}]}}},"contracts/ownership/TokenGovernance.sol":{"l":{"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"45":0,"46":0,"47":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"83":0,"84":0,"85":0,"86":0,"87":0,"99":0,"100":0,"101":0,"102":0,"104":0,"115":0,"116":0,"118":0,"123":0,"124":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/ownership/TokenGovernance.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0},"fnMap":{"1":{"name":null,"line":30,"loc":{"start":{"line":30,"column":2},"end":{"line":31,"column":11}}},"2":{"name":"setQuorumLevel","line":41,"loc":{"start":{"line":41,"column":2},"end":{"line":44,"column":18}}},"3":{"name":"voteForExecution","line":51,"loc":{"start":{"line":51,"column":2},"end":{"line":53,"column":18}}},"4":{"name":"unlockTokens","line":63,"loc":{"start":{"line":63,"column":2},"end":{"line":65,"column":18}}},"5":{"name":"lockTokens","line":80,"loc":{"start":{"line":80,"column":2},"end":{"line":82,"column":18}}},"6":{"name":"isQuorumReached","line":95,"loc":{"start":{"line":95,"column":2},"end":{"line":98,"column":18}}},"7":{"name":"isRestricted","line":114,"loc":{"start":{"line":114,"column":2},"end":{"line":114,"column":65}}},"8":{"name":"onlyOwner","line":122,"loc":{"start":{"line":122,"column":2},"end":{"line":122,"column":20}}}},"statementMap":{"1":{"start":{"line":32,"column":4},"end":{"line":32,"column":97}},"2":{"start":{"line":33,"column":4},"end":{"line":33,"column":33}},"3":{"start":{"line":34,"column":4},"end":{"line":34,"column":43}},"4":{"start":{"line":35,"column":4},"end":{"line":35,"column":100}},"5":{"start":{"line":36,"column":4},"end":{"line":36,"column":76}},"6":{"start":{"line":45,"column":4},"end":{"line":45,"column":80}},"7":{"start":{"line":47,"column":4},"end":{"line":47,"column":15}},"8":{"start":{"line":54,"column":4},"end":{"line":54,"column":97}},"9":{"start":{"line":55,"column":4},"end":{"line":55,"column":81}},"10":{"start":{"line":56,"column":4},"end":{"line":56,"column":48}},"11":{"start":{"line":57,"column":4},"end":{"line":57,"column":54}},"12":{"start":{"line":59,"column":4},"end":{"line":59,"column":15}},"13":{"start":{"line":66,"column":4},"end":{"line":66,"column":93}},"14":{"start":{"line":67,"column":4},"end":{"line":67,"column":82}},"15":{"start":{"line":68,"column":4},"end":{"line":68,"column":54}},"16":{"start":{"line":69,"column":4},"end":{"line":69,"column":54}},"17":{"start":{"line":72,"column":4},"end":{"line":72,"column":15}},"18":{"start":{"line":83,"column":4},"end":{"line":83,"column":93}},"19":{"start":{"line":84,"column":4},"end":{"line":84,"column":82}},"20":{"start":{"line":85,"column":4},"end":{"line":85,"column":54}},"21":{"start":{"line":87,"column":4},"end":{"line":87,"column":15}},"22":{"start":{"line":99,"column":4},"end":{"line":99,"column":103}},"23":{"start":{"line":100,"column":4},"end":{"line":100,"column":97}},"24":{"start":{"line":101,"column":4},"end":{"line":101,"column":81}},"25":{"start":{"line":102,"column":4},"end":{"line":102,"column":52}},"26":{"start":{"line":104,"column":4},"end":{"line":104,"column":82}},"27":{"start":{"line":115,"column":4},"end":{"line":115,"column":69}},"28":{"start":{"line":123,"column":4},"end":{"line":123,"column":90}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]},"2":{"line":84,"type":"if","locations":[{"start":{"line":84,"column":4},"end":{"line":84,"column":4}},{"start":{"line":84,"column":4},"end":{"line":84,"column":4}}]},"3":{"line":115,"type":"if","locations":[{"start":{"line":115,"column":4},"end":{"line":115,"column":4}},{"start":{"line":115,"column":4},"end":{"line":115,"column":4}}]},"4":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":4},"end":{"line":123,"column":4}},{"start":{"line":123,"column":4},"end":{"line":123,"column":4}}]}}},"contracts/roles/AssetManagerEscrow.sol":{"l":{"22":3,"30":4,"31":3,"32":3,"33":3,"34":3,"35":3,"36":3,"37":3,"47":10,"48":9,"49":8,"50":8,"51":8,"52":8,"53":8,"55":1,"59":7,"60":7,"61":7,"62":7,"63":7,"65":5,"66":5,"67":2,"69":3,"70":3,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"88":0,"89":0,"100":1,"101":1,"102":1,"103":1,"114":2,"115":2,"116":2,"117":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/roles/AssetManagerEscrow.sol","s":{"1":3,"2":4,"3":3,"4":3,"5":3,"6":3,"7":3,"8":10,"9":9,"10":8,"11":8,"12":8,"13":8,"14":8,"15":1,"16":7,"17":7,"18":7,"19":7,"20":7,"21":5,"22":5,"23":3,"24":3,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":1,"37":2,"38":2,"39":2},"b":{"1":[3,1],"2":[3,0],"3":[9,1],"4":[8,1],"5":[1,7],"6":[1,0],"7":[5,2],"8":[2,3],"9":[3,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,2]},"f":{"1":3,"2":4,"3":10,"4":0,"5":1,"6":2},"fnMap":{"1":{"name":null,"line":20,"loc":{"start":{"line":20,"column":4},"end":{"line":21,"column":12}}},"2":{"name":"lockEscrow","line":27,"loc":{"start":{"line":27,"column":4},"end":{"line":29,"column":20}}},"3":{"name":"unlockEscrow","line":44,"loc":{"start":{"line":44,"column":4},"end":{"line":46,"column":20}}},"4":{"name":"becomeAssetManager","line":76,"loc":{"start":{"line":76,"column":4},"end":{"line":79,"column":20}}},"5":{"name":"removeAssetManager","line":97,"loc":{"start":{"line":97,"column":4},"end":{"line":99,"column":20}}},"6":{"name":"hasConsensus","line":113,"loc":{"start":{"line":113,"column":4},"end":{"line":113,"column":83}}}},"statementMap":{"1":{"start":{"line":22,"column":6},"end":{"line":22,"column":38}},"2":{"start":{"line":30,"column":6},"end":{"line":30,"column":106}},"3":{"start":{"line":31,"column":6},"end":{"line":31,"column":85}},"4":{"start":{"line":32,"column":6},"end":{"line":32,"column":97}},"5":{"start":{"line":33,"column":6},"end":{"line":33,"column":90}},"6":{"start":{"line":36,"column":6},"end":{"line":36,"column":79}},"7":{"start":{"line":37,"column":6},"end":{"line":37,"column":17}},"8":{"start":{"line":47,"column":6},"end":{"line":47,"column":106}},"9":{"start":{"line":48,"column":6},"end":{"line":48,"column":98}},"10":{"start":{"line":49,"column":6},"end":{"line":49,"column":115}},"11":{"start":{"line":50,"column":6},"end":{"line":50,"column":85}},"12":{"start":{"line":51,"column":6},"end":{"line":51,"column":116}},"13":{"start":{"line":52,"column":6},"end":{"line":52,"column":138}},"14":{"start":{"line":53,"column":6},"end":{"line":53,"column":2950}},"15":{"start":{"line":55,"column":8},"end":{"line":55,"column":66}},"16":{"start":{"line":59,"column":8},"end":{"line":59,"column":117}},"17":{"start":{"line":60,"column":8},"end":{"line":60,"column":81}},"18":{"start":{"line":61,"column":8},"end":{"line":61,"column":40}},"19":{"start":{"line":62,"column":8},"end":{"line":62,"column":128}},"20":{"start":{"line":63,"column":8},"end":{"line":63,"column":57}},"21":{"start":{"line":65,"column":8},"end":{"line":65,"column":75}},"22":{"start":{"line":66,"column":8},"end":{"line":66,"column":32}},"23":{"start":{"line":69,"column":6},"end":{"line":69,"column":58}},"24":{"start":{"line":70,"column":6},"end":{"line":70,"column":17}},"25":{"start":{"line":80,"column":6},"end":{"line":80,"column":113}},"26":{"start":{"line":81,"column":6},"end":{"line":81,"column":90}},"27":{"start":{"line":82,"column":6},"end":{"line":82,"column":91}},"28":{"start":{"line":83,"column":6},"end":{"line":83,"column":219}},"29":{"start":{"line":84,"column":6},"end":{"line":84,"column":111}},"30":{"start":{"line":85,"column":6},"end":{"line":85,"column":64}},"31":{"start":{"line":86,"column":6},"end":{"line":86,"column":5605}},"32":{"start":{"line":86,"column":19},"end":{"line":86,"column":57}},"33":{"start":{"line":87,"column":13},"end":{"line":87,"column":73}},"34":{"start":{"line":88,"column":6},"end":{"line":88,"column":43}},"35":{"start":{"line":89,"column":6},"end":{"line":89,"column":17}},"36":{"start":{"line":103,"column":8},"end":{"line":103,"column":19}},"37":{"start":{"line":114,"column":6},"end":{"line":114,"column":147}},"38":{"start":{"line":115,"column":6},"end":{"line":115,"column":127}},"39":{"start":{"line":116,"column":6},"end":{"line":116,"column":101}}},"branchMap":{"1":{"line":30,"type":"if","locations":[{"start":{"line":30,"column":6},"end":{"line":30,"column":6}},{"start":{"line":30,"column":6},"end":{"line":30,"column":6}}]},"2":{"line":33,"type":"if","locations":[{"start":{"line":33,"column":6},"end":{"line":33,"column":6}},{"start":{"line":33,"column":6},"end":{"line":33,"column":6}}]},"3":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":6}},{"start":{"line":47,"column":6},"end":{"line":47,"column":6}}]},"4":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":48,"column":6}},{"start":{"line":48,"column":6},"end":{"line":48,"column":6}}]},"5":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":6},"end":{"line":53,"column":6}},{"start":{"line":53,"column":6},"end":{"line":53,"column":6}}]},"6":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":8},"end":{"line":55,"column":8}},{"start":{"line":55,"column":8},"end":{"line":55,"column":8}}]},"7":{"line":63,"type":"if","locations":[{"start":{"line":63,"column":8},"end":{"line":63,"column":8}},{"start":{"line":63,"column":8},"end":{"line":63,"column":8}}]},"8":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":8},"end":{"line":66,"column":8}},{"start":{"line":66,"column":8},"end":{"line":66,"column":8}}]},"9":{"line":69,"type":"if","locations":[{"start":{"line":69,"column":6},"end":{"line":69,"column":6}},{"start":{"line":69,"column":6},"end":{"line":69,"column":6}}]},"10":{"line":81,"type":"if","locations":[{"start":{"line":81,"column":6},"end":{"line":81,"column":6}},{"start":{"line":81,"column":6},"end":{"line":81,"column":6}}]},"11":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":6},"end":{"line":85,"column":6}},{"start":{"line":85,"column":6},"end":{"line":85,"column":6}}]},"12":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":6},"end":{"line":86,"column":6}},{"start":{"line":86,"column":6},"end":{"line":86,"column":6}}]},"13":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":19},"end":{"line":86,"column":19}},{"start":{"line":86,"column":19},"end":{"line":86,"column":19}}]},"14":{"line":87,"type":"if","locations":[{"start":{"line":87,"column":13},"end":{"line":87,"column":13}},{"start":{"line":87,"column":13},"end":{"line":87,"column":13}}]},"15":{"line":88,"type":"if","locations":[{"start":{"line":88,"column":6},"end":{"line":88,"column":6}},{"start":{"line":88,"column":6},"end":{"line":88,"column":6}}]},"16":{"line":116,"type":"if","locations":[{"start":{"line":116,"column":6},"end":{"line":116,"column":6}},{"start":{"line":116,"column":6},"end":{"line":116,"column":6}}]}}},"contracts/roles/AssetManagerFunds.sol":{"l":{"28":3,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"59":0,"66":1,"67":1,"68":1,"69":1,"70":1,"71":1,"72":1,"73":1,"74":1,"75":1,"76":1,"77":1,"78":1,"79":1,"81":1,"82":1,"83":1,"85":1,"86":1,"89":1,"90":1,"92":1,"100":1,"101":1,"102":1,"103":1,"104":1,"105":1,"106":1,"107":1,"108":1,"109":1,"110":1,"111":1,"113":1,"114":1,"122":1,"123":1,"125":1,"131":2,"132":2,"133":2,"134":2},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/roles/AssetManagerFunds.sol","s":{"1":3,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":0,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":0,"54":1,"55":2,"56":2,"57":2},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[1,0],"11":[1,0],"12":[1,0],"13":[1,0],"14":[0,1],"15":[1,0],"16":[1,0],"17":[1,0],"18":[1,0],"19":[1,0],"20":[1,0],"21":[1,0],"22":[1,0],"23":[0,1],"24":[2,0]},"f":{"1":3,"2":0,"3":1,"4":1,"5":1,"6":2,"7":1},"fnMap":{"1":{"name":null,"line":26,"loc":{"start":{"line":26,"column":2},"end":{"line":27,"column":10}}},"2":{"name":"withdraw","line":33,"loc":{"start":{"line":33,"column":2},"end":{"line":36,"column":18}}},"3":{"name":"retrieveAssetManagerTokens","line":62,"loc":{"start":{"line":62,"column":2},"end":{"line":65,"column":18}}},"4":{"name":"retrieveAssetManagerETH","line":96,"loc":{"start":{"line":96,"column":2},"end":{"line":99,"column":18}}},"5":{"name":"containsAddress","line":118,"loc":{"start":{"line":118,"column":2},"end":{"line":121,"column":19}}},"6":{"name":"nonReentrant","line":130,"loc":{"start":{"line":130,"column":2},"end":{"line":130,"column":25}}},"7":{"name":null,"line":137,"loc":{"start":{"line":137,"column":2},"end":{"line":139,"column":10}}}},"statementMap":{"1":{"start":{"line":28,"column":4},"end":{"line":28,"column":36}},"2":{"start":{"line":37,"column":4},"end":{"line":37,"column":104}},"3":{"start":{"line":38,"column":4},"end":{"line":38,"column":104}},"4":{"start":{"line":39,"column":4},"end":{"line":39,"column":40}},"5":{"start":{"line":42,"column":4},"end":{"line":42,"column":1561}},"6":{"start":{"line":43,"column":6},"end":{"line":43,"column":42}},"7":{"start":{"line":44,"column":6},"end":{"line":44,"column":52}},"8":{"start":{"line":45,"column":6},"end":{"line":45,"column":28}},"9":{"start":{"line":46,"column":6},"end":{"line":46,"column":54}},"10":{"start":{"line":47,"column":6},"end":{"line":47,"column":30}},"11":{"start":{"line":48,"column":6},"end":{"line":48,"column":51}},"12":{"start":{"line":52,"column":6},"end":{"line":52,"column":52}},"13":{"start":{"line":53,"column":6},"end":{"line":53,"column":28}},"14":{"start":{"line":54,"column":6},"end":{"line":54,"column":51}},"15":{"start":{"line":55,"column":6},"end":{"line":55,"column":30}},"16":{"start":{"line":56,"column":6},"end":{"line":56,"column":77}},"17":{"start":{"line":59,"column":4},"end":{"line":59,"column":15}},"18":{"start":{"line":66,"column":4},"end":{"line":66,"column":33}},"19":{"start":{"line":67,"column":4},"end":{"line":67,"column":60}},"20":{"start":{"line":68,"column":4},"end":{"line":68,"column":67}},"21":{"start":{"line":70,"column":4},"end":{"line":70,"column":2554}},"22":{"start":{"line":71,"column":6},"end":{"line":71,"column":110}},"23":{"start":{"line":72,"column":6},"end":{"line":72,"column":109}},"24":{"start":{"line":73,"column":6},"end":{"line":73,"column":42}},"25":{"start":{"line":74,"column":6},"end":{"line":74,"column":57}},"26":{"start":{"line":75,"column":6},"end":{"line":75,"column":28}},"27":{"start":{"line":76,"column":6},"end":{"line":76,"column":51}},"28":{"start":{"line":77,"column":6},"end":{"line":77,"column":63}},"29":{"start":{"line":78,"column":6},"end":{"line":78,"column":71}},"30":{"start":{"line":79,"column":6},"end":{"line":79,"column":3161}},"31":{"start":{"line":79,"column":43},"end":{"line":79,"column":111}},"32":{"start":{"line":81,"column":8},"end":{"line":81,"column":57}},"33":{"start":{"line":82,"column":8},"end":{"line":82,"column":45}},"34":{"start":{"line":85,"column":6},"end":{"line":85,"column":30}},"35":{"start":{"line":86,"column":6},"end":{"line":86,"column":84}},"36":{"start":{"line":89,"column":4},"end":{"line":89,"column":3551}},"37":{"start":{"line":90,"column":6},"end":{"line":90,"column":77}},"38":{"start":{"line":92,"column":4},"end":{"line":92,"column":15}},"39":{"start":{"line":100,"column":4},"end":{"line":100,"column":33}},"40":{"start":{"line":102,"column":4},"end":{"line":102,"column":3851}},"41":{"start":{"line":103,"column":6},"end":{"line":103,"column":109}},"42":{"start":{"line":104,"column":6},"end":{"line":104,"column":109}},"43":{"start":{"line":105,"column":6},"end":{"line":105,"column":47}},"44":{"start":{"line":106,"column":6},"end":{"line":106,"column":57}},"45":{"start":{"line":107,"column":6},"end":{"line":107,"column":28}},"46":{"start":{"line":108,"column":6},"end":{"line":108,"column":54}},"47":{"start":{"line":109,"column":6},"end":{"line":109,"column":30}},"48":{"start":{"line":110,"column":6},"end":{"line":110,"column":51}},"49":{"start":{"line":111,"column":6},"end":{"line":111,"column":38}},"50":{"start":{"line":114,"column":4},"end":{"line":114,"column":15}},"51":{"start":{"line":122,"column":4},"end":{"line":122,"column":4711}},"52":{"start":{"line":123,"column":6},"end":{"line":123,"column":44}},"53":{"start":{"line":123,"column":36},"end":{"line":123,"column":44}},"54":{"start":{"line":125,"column":4},"end":{"line":125,"column":41}},"55":{"start":{"line":131,"column":4},"end":{"line":131,"column":25}},"56":{"start":{"line":132,"column":4},"end":{"line":132,"column":43}},"57":{"start":{"line":134,"column":4},"end":{"line":134,"column":45}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":4},"end":{"line":37,"column":4}},{"start":{"line":37,"column":4},"end":{"line":37,"column":4}}]},"2":{"line":39,"type":"if","locations":[{"start":{"line":39,"column":4},"end":{"line":39,"column":4}},{"start":{"line":39,"column":4},"end":{"line":39,"column":4}}]},"3":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"4":{"line":45,"type":"if","locations":[{"start":{"line":45,"column":6},"end":{"line":45,"column":6}},{"start":{"line":45,"column":6},"end":{"line":45,"column":6}}]},"5":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":6},"end":{"line":47,"column":6}},{"start":{"line":47,"column":6},"end":{"line":47,"column":6}}]},"6":{"line":48,"type":"if","locations":[{"start":{"line":48,"column":6},"end":{"line":48,"column":6}},{"start":{"line":48,"column":6},"end":{"line":48,"column":6}}]},"7":{"line":53,"type":"if","locations":[{"start":{"line":53,"column":6},"end":{"line":53,"column":6}},{"start":{"line":53,"column":6},"end":{"line":53,"column":6}}]},"8":{"line":55,"type":"if","locations":[{"start":{"line":55,"column":6},"end":{"line":55,"column":6}},{"start":{"line":55,"column":6},"end":{"line":55,"column":6}}]},"9":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":6},"end":{"line":56,"column":6}},{"start":{"line":56,"column":6},"end":{"line":56,"column":6}}]},"10":{"line":66,"type":"if","locations":[{"start":{"line":66,"column":4},"end":{"line":66,"column":4}},{"start":{"line":66,"column":4},"end":{"line":66,"column":4}}]},"11":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":6},"end":{"line":71,"column":6}},{"start":{"line":71,"column":6},"end":{"line":71,"column":6}}]},"12":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":6},"end":{"line":73,"column":6}},{"start":{"line":73,"column":6},"end":{"line":73,"column":6}}]},"13":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":6},"end":{"line":75,"column":6}},{"start":{"line":75,"column":6},"end":{"line":75,"column":6}}]},"14":{"line":79,"type":"if","locations":[{"start":{"line":79,"column":6},"end":{"line":79,"column":6}},{"start":{"line":79,"column":6},"end":{"line":79,"column":6}}]},"15":{"line":85,"type":"if","locations":[{"start":{"line":85,"column":6},"end":{"line":85,"column":6}},{"start":{"line":85,"column":6},"end":{"line":85,"column":6}}]},"16":{"line":86,"type":"if","locations":[{"start":{"line":86,"column":6},"end":{"line":86,"column":6}},{"start":{"line":86,"column":6},"end":{"line":86,"column":6}}]},"17":{"line":90,"type":"if","locations":[{"start":{"line":90,"column":6},"end":{"line":90,"column":6}},{"start":{"line":90,"column":6},"end":{"line":90,"column":6}}]},"18":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":4},"end":{"line":100,"column":4}},{"start":{"line":100,"column":4},"end":{"line":100,"column":4}}]},"19":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":6},"end":{"line":103,"column":6}},{"start":{"line":103,"column":6},"end":{"line":103,"column":6}}]},"20":{"line":107,"type":"if","locations":[{"start":{"line":107,"column":6},"end":{"line":107,"column":6}},{"start":{"line":107,"column":6},"end":{"line":107,"column":6}}]},"21":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":6},"end":{"line":109,"column":6}},{"start":{"line":109,"column":6},"end":{"line":109,"column":6}}]},"22":{"line":110,"type":"if","locations":[{"start":{"line":110,"column":6},"end":{"line":110,"column":6}},{"start":{"line":110,"column":6},"end":{"line":110,"column":6}}]},"23":{"line":123,"type":"if","locations":[{"start":{"line":123,"column":6},"end":{"line":123,"column":6}},{"start":{"line":123,"column":6},"end":{"line":123,"column":6}}]},"24":{"line":134,"type":"if","locations":[{"start":{"line":134,"column":4},"end":{"line":134,"column":4}},{"start":{"line":134,"column":4},"end":{"line":134,"column":4}}]}}},"contracts/roles/Operators.sol":{"l":{"11":8,"19":10,"20":10,"21":10,"22":9,"23":9,"24":9,"31":3,"32":3,"39":3,"40":3,"41":2,"42":1,"43":1,"44":1,"52":2,"53":2,"61":3,"62":3,"71":14,"72":13,"77":5,"78":5},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/roles/Operators.sol","s":{"1":8,"2":10,"3":10,"4":10,"5":9,"6":3,"7":3,"8":3,"9":2,"10":1,"11":2,"12":3,"13":14,"14":5},"b":{"1":[10,0],"2":[9,1],"3":[2,1],"4":[1,1],"5":[13,1],"6":[5,0]},"f":{"1":8,"2":10,"3":3,"4":3,"5":2,"6":3,"7":14,"8":5},"fnMap":{"1":{"name":null,"line":10,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":39}}},"2":{"name":"registerOperator","line":16,"loc":{"start":{"line":16,"column":2},"end":{"line":18,"column":13}}},"3":{"name":"removeOperator","line":28,"loc":{"start":{"line":28,"column":2},"end":{"line":30,"column":13}}},"4":{"name":"changeOperatorAddress","line":37,"loc":{"start":{"line":37,"column":2},"end":{"line":38,"column":12}}},"5":{"name":"acceptERC20Token","line":48,"loc":{"start":{"line":48,"column":2},"end":{"line":51,"column":18}}},"6":{"name":"acceptEther","line":57,"loc":{"start":{"line":57,"column":2},"end":{"line":60,"column":18}}},"7":{"name":"onlyOwner","line":70,"loc":{"start":{"line":70,"column":2},"end":{"line":70,"column":20}}},"8":{"name":"onlyOperator","line":76,"loc":{"start":{"line":76,"column":2},"end":{"line":76,"column":44}}}},"statementMap":{"1":{"start":{"line":11,"column":4},"end":{"line":11,"column":33}},"2":{"start":{"line":19,"column":4},"end":{"line":19,"column":42}},"3":{"start":{"line":20,"column":4},"end":{"line":20,"column":65}},"4":{"start":{"line":21,"column":4},"end":{"line":21,"column":102}},"5":{"start":{"line":24,"column":4},"end":{"line":24,"column":56}},"6":{"start":{"line":32,"column":4},"end":{"line":32,"column":52}},"7":{"start":{"line":39,"column":4},"end":{"line":39,"column":101}},"8":{"start":{"line":40,"column":4},"end":{"line":40,"column":36}},"9":{"start":{"line":41,"column":4},"end":{"line":41,"column":110}},"10":{"start":{"line":44,"column":4},"end":{"line":44,"column":72}},"11":{"start":{"line":53,"column":4},"end":{"line":53,"column":15}},"12":{"start":{"line":62,"column":4},"end":{"line":62,"column":15}},"13":{"start":{"line":71,"column":4},"end":{"line":71,"column":82}},"14":{"start":{"line":77,"column":4},"end":{"line":77,"column":103}}},"branchMap":{"1":{"line":19,"type":"if","locations":[{"start":{"line":19,"column":4},"end":{"line":19,"column":4}},{"start":{"line":19,"column":4},"end":{"line":19,"column":4}}]},"2":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":4},"end":{"line":21,"column":4}},{"start":{"line":21,"column":4},"end":{"line":21,"column":4}}]},"3":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":4}},{"start":{"line":40,"column":4},"end":{"line":40,"column":4}}]},"4":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"5":{"line":71,"type":"if","locations":[{"start":{"line":71,"column":4},"end":{"line":71,"column":4}},{"start":{"line":71,"column":4},"end":{"line":71,"column":4}}]},"6":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":4},"end":{"line":77,"column":4}},{"start":{"line":77,"column":4},"end":{"line":77,"column":4}}]}}},"contracts/test/ApproveAndCallTest.sol":{"l":{"6":2},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/test/ApproveAndCallTest.sol","s":{"1":2},"b":{},"f":{"1":2},"fnMap":{"1":{"name":"receiveApproval","line":4,"loc":{"start":{"line":4,"column":2},"end":{"line":5,"column":10}}}},"statementMap":{"1":{"start":{"line":6,"column":4},"end":{"line":6,"column":47}}},"branchMap":{}},"contracts/test/HashFunctions.sol":{"l":{"9":0,"10":0,"19":0,"26":8,"33":0,"40":1,"47":0,"54":0,"61":0,"68":1,"76":0,"83":8,"90":0,"97":21,"104":0,"111":0,"118":0,"126":0,"133":0,"141":0,"148":0,"155":0,"162":0,"167":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/test/HashFunctions.sol","s":{"1":0,"2":0,"3":8,"4":0,"5":1,"6":0,"7":0,"8":0,"9":1,"10":0,"11":8,"12":0,"13":21,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0},"b":{},"f":{"1":0,"2":0,"3":8,"4":0,"5":1,"6":0,"7":0,"8":0,"9":1,"10":0,"11":8,"12":0,"13":21,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0},"fnMap":{"1":{"name":"toBytes","line":5,"loc":{"start":{"line":5,"column":2},"end":{"line":8,"column":21}}},"2":{"name":"getMethodID","line":15,"loc":{"start":{"line":15,"column":2},"end":{"line":18,"column":20}}},"3":{"name":"getAssetID","line":22,"loc":{"start":{"line":22,"column":2},"end":{"line":25,"column":20}}},"4":{"name":"getOrderID","line":29,"loc":{"start":{"line":29,"column":2},"end":{"line":32,"column":20}}},"5":{"name":"getFunctionInitiatorHash","line":36,"loc":{"start":{"line":36,"column":2},"end":{"line":39,"column":20}}},"6":{"name":"uintHash","line":43,"loc":{"start":{"line":43,"column":2},"end":{"line":46,"column":21}}},"7":{"name":"getStakingID","line":50,"loc":{"start":{"line":50,"column":2},"end":{"line":53,"column":21}}},"8":{"name":"stringHash","line":57,"loc":{"start":{"line":57,"column":2},"end":{"line":60,"column":20}}},"9":{"name":"addressHash","line":64,"loc":{"start":{"line":64,"column":2},"end":{"line":67,"column":21}}},"10":{"name":"contractHash","line":72,"loc":{"start":{"line":72,"column":2},"end":{"line":75,"column":21}}},"11":{"name":"stringAddress","line":79,"loc":{"start":{"line":79,"column":2},"end":{"line":82,"column":21}}},"12":{"name":"stringString","line":86,"loc":{"start":{"line":86,"column":2},"end":{"line":89,"column":21}}},"13":{"name":"stringBytes","line":93,"loc":{"start":{"line":93,"column":2},"end":{"line":96,"column":21}}},"14":{"name":"stringUint","line":100,"loc":{"start":{"line":100,"column":2},"end":{"line":103,"column":21}}},"15":{"name":"stringBytesAddress","line":107,"loc":{"start":{"line":107,"column":2},"end":{"line":110,"column":21}}},"16":{"name":"addressUintUint","line":114,"loc":{"start":{"line":114,"column":2},"end":{"line":117,"column":21}}},"17":{"name":"getAuthorizeHash","line":122,"loc":{"start":{"line":122,"column":2},"end":{"line":125,"column":21}}},"18":{"name":"uintUint","line":129,"loc":{"start":{"line":129,"column":2},"end":{"line":132,"column":21}}},"19":{"name":"uintUintUint","line":137,"loc":{"start":{"line":137,"column":2},"end":{"line":140,"column":21}}},"20":{"name":"currentTime","line":144,"loc":{"start":{"line":144,"column":2},"end":{"line":147,"column":18}}},"21":{"name":"nullBytes","line":151,"loc":{"start":{"line":151,"column":2},"end":{"line":154,"column":21}}},"22":{"name":"nullAddress","line":158,"loc":{"start":{"line":158,"column":2},"end":{"line":161,"column":21}}},"23":{"name":null,"line":165,"loc":{"start":{"line":165,"column":0},"end":{"line":166,"column":8}}}},"statementMap":{"1":{"start":{"line":9,"column":4},"end":{"line":9,"column":20}},"2":{"start":{"line":19,"column":4},"end":{"line":19,"column":63}},"3":{"start":{"line":26,"column":4},"end":{"line":26,"column":90}},"4":{"start":{"line":33,"column":4},"end":{"line":33,"column":83}},"5":{"start":{"line":40,"column":4},"end":{"line":40,"column":76}},"6":{"start":{"line":47,"column":4},"end":{"line":47,"column":46}},"7":{"start":{"line":54,"column":4},"end":{"line":54,"column":70}},"8":{"start":{"line":61,"column":4},"end":{"line":61,"column":45}},"9":{"start":{"line":68,"column":4},"end":{"line":68,"column":46}},"10":{"start":{"line":76,"column":4},"end":{"line":76,"column":57}},"11":{"start":{"line":83,"column":4},"end":{"line":83,"column":57}},"12":{"start":{"line":90,"column":4},"end":{"line":90,"column":59}},"13":{"start":{"line":97,"column":4},"end":{"line":97,"column":57}},"14":{"start":{"line":104,"column":4},"end":{"line":104,"column":57}},"15":{"start":{"line":111,"column":4},"end":{"line":111,"column":70}},"16":{"start":{"line":118,"column":4},"end":{"line":118,"column":70}},"17":{"start":{"line":126,"column":4},"end":{"line":126,"column":85}},"18":{"start":{"line":133,"column":4},"end":{"line":133,"column":60}},"19":{"start":{"line":141,"column":4},"end":{"line":141,"column":73}},"20":{"start":{"line":148,"column":4},"end":{"line":148,"column":14}},"21":{"start":{"line":155,"column":4},"end":{"line":155,"column":21}},"22":{"start":{"line":162,"column":4},"end":{"line":162,"column":21}},"23":{"start":{"line":167,"column":2},"end":{"line":167,"column":9}}},"branchMap":{}},"contracts/test/SafeMathWrapper.sol":{"l":{"10":3,"14":1,"18":2,"22":2,"26":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/test/SafeMathWrapper.sol","s":{"1":3,"2":1,"3":2,"4":2,"5":1},"b":{},"f":{"1":3,"2":1,"3":2,"4":2,"5":1},"fnMap":{"1":{"name":"multiply","line":9,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":73}}},"2":{"name":"divide","line":13,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":71}}},"3":{"name":"subtract","line":17,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":73}}},"4":{"name":"addto","line":21,"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":70}}},"5":{"name":"fraction","line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":73}}}},"statementMap":{"1":{"start":{"line":10,"column":4},"end":{"line":10,"column":19}},"2":{"start":{"line":14,"column":4},"end":{"line":14,"column":19}},"3":{"start":{"line":18,"column":4},"end":{"line":18,"column":19}},"4":{"start":{"line":22,"column":4},"end":{"line":22,"column":19}},"5":{"start":{"line":26,"column":4},"end":{"line":26,"column":35}}},"branchMap":{}},"contracts/test/TestBurner.sol":{"l":{"15":1,"16":1,"21":4,"27":2,"28":2,"29":2,"30":1,"37":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/test/TestBurner.sol","s":{"1":1,"2":1,"3":4,"4":2,"5":2,"6":2,"7":1,"8":1},"b":{"1":[1,3],"2":[1,1]},"f":{"1":1,"2":4,"3":2,"4":1},"fnMap":{"1":{"name":null,"line":13,"loc":{"start":{"line":13,"column":2},"end":{"line":14,"column":10}}},"2":{"name":"burnTokensManualFee","line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":12}}},"3":{"name":"burnTokens","line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":26,"column":12}}},"4":{"name":"getMethodID","line":33,"loc":{"start":{"line":33,"column":2},"end":{"line":36,"column":20}}}},"statementMap":{"1":{"start":{"line":15,"column":4},"end":{"line":15,"column":32}},"2":{"start":{"line":16,"column":4},"end":{"line":16,"column":33}},"3":{"start":{"line":21,"column":4},"end":{"line":21,"column":44}},"4":{"start":{"line":27,"column":4},"end":{"line":27,"column":72}},"5":{"start":{"line":28,"column":4},"end":{"line":28,"column":97}},"6":{"start":{"line":29,"column":4},"end":{"line":29,"column":49}},"7":{"start":{"line":30,"column":4},"end":{"line":30,"column":30}},"8":{"start":{"line":37,"column":4},"end":{"line":37,"column":62}}},"branchMap":{"1":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":4},"end":{"line":21,"column":4}},{"start":{"line":21,"column":4},"end":{"line":21,"column":4}}]},"2":{"line":29,"type":"if","locations":[{"start":{"line":29,"column":4},"end":{"line":29,"column":4}},{"start":{"line":29,"column":4},"end":{"line":29,"column":4}}]}}},"contracts/test/WithdrawTest.sol":{"l":{"10":0,"11":0,"12":0,"13":0,"14":0,"20":1,"21":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/test/WithdrawTest.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":1,"6":1},"b":{},"f":{"1":0,"2":1},"fnMap":{"1":{"name":"withdraw","line":7,"loc":{"start":{"line":7,"column":2},"end":{"line":9,"column":17}}},"2":{"name":"deposit","line":17,"loc":{"start":{"line":17,"column":2},"end":{"line":19,"column":11}}}},"statementMap":{"1":{"start":{"line":10,"column":4},"end":{"line":10,"column":54}},"2":{"start":{"line":11,"column":4},"end":{"line":11,"column":37}},"3":{"start":{"line":12,"column":4},"end":{"line":12,"column":27}},"4":{"start":{"line":14,"column":4},"end":{"line":14,"column":15}},"5":{"start":{"line":20,"column":4},"end":{"line":20,"column":41}},"6":{"start":{"line":21,"column":4},"end":{"line":21,"column":35}}},"branchMap":{}},"contracts/tokens/distribution/EqualDistribution.sol":{"l":{"24":1,"25":1,"34":0,"35":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"54":0,"67":2,"68":5,"70":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/EqualDistribution.sol","s":{"1":1,"2":1,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":2,"12":5,"13":1,"14":1},"b":{"1":[1,0],"2":[1,4]},"f":{"1":1,"2":0,"3":0,"4":0,"5":2},"fnMap":{"1":{"name":null,"line":22,"loc":{"start":{"line":22,"column":2},"end":{"line":23,"column":9}}},"2":{"name":"getFunds","line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":33,"column":18}}},"3":{"name":"withdraw","line":39,"loc":{"start":{"line":39,"column":2},"end":{"line":41,"column":18}}},"4":{"name":null,"line":51,"loc":{"start":{"line":51,"column":2},"end":{"line":53,"column":11}}},"5":{"name":"isBeneficiary","line":63,"loc":{"start":{"line":63,"column":2},"end":{"line":66,"column":18}}}},"statementMap":{"1":{"start":{"line":24,"column":4},"end":{"line":24,"column":39}},"2":{"start":{"line":25,"column":4},"end":{"line":25,"column":33}},"3":{"start":{"line":34,"column":4},"end":{"line":34,"column":32}},"4":{"start":{"line":35,"column":4},"end":{"line":35,"column":15}},"5":{"start":{"line":42,"column":4},"end":{"line":42,"column":119}},"6":{"start":{"line":43,"column":4},"end":{"line":43,"column":70}},"7":{"start":{"line":44,"column":4},"end":{"line":44,"column":44}},"8":{"start":{"line":46,"column":4},"end":{"line":46,"column":40}},"9":{"start":{"line":47,"column":4},"end":{"line":47,"column":15}},"10":{"start":{"line":54,"column":4},"end":{"line":54,"column":42}},"11":{"start":{"line":67,"column":4},"end":{"line":67,"column":2604}},"12":{"start":{"line":68,"column":6},"end":{"line":68,"column":59}},"13":{"start":{"line":68,"column":46},"end":{"line":68,"column":57}},"14":{"start":{"line":70,"column":4},"end":{"line":70,"column":16}}},"branchMap":{"1":{"line":24,"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":24,"column":4}},{"start":{"line":24,"column":4},"end":{"line":24,"column":4}}]},"2":{"line":68,"type":"if","locations":[{"start":{"line":68,"column":6},"end":{"line":68,"column":6}},{"start":{"line":68,"column":6},"end":{"line":68,"column":6}}]}}},"contracts/tokens/distribution/FixedDistribution.sol":{"l":{"17":2,"18":2,"19":2,"20":2,"21":6,"22":6,"24":2},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/FixedDistribution.sol","s":{"1":2,"2":2,"3":2,"4":6,"5":6,"6":2},"b":{"1":[2,0]},"f":{"1":2},"fnMap":{"1":{"name":null,"line":15,"loc":{"start":{"line":15,"column":2},"end":{"line":16,"column":10}}}},"statementMap":{"1":{"start":{"line":17,"column":4},"end":{"line":17,"column":80}},"2":{"start":{"line":19,"column":4},"end":{"line":19,"column":23}},"3":{"start":{"line":20,"column":4},"end":{"line":20,"column":828}},"4":{"start":{"line":21,"column":6},"end":{"line":21,"column":48}},"5":{"start":{"line":22,"column":6},"end":{"line":22,"column":76}},"6":{"start":{"line":24,"column":4},"end":{"line":24,"column":24}}},"branchMap":{"1":{"line":17,"type":"if","locations":[{"start":{"line":17,"column":4},"end":{"line":17,"column":4}},{"start":{"line":17,"column":4},"end":{"line":17,"column":4}}]}}},"contracts/tokens/distribution/MintableDistribution.sol":{"l":{"21":1,"22":1,"32":2,"33":2,"34":2,"35":2,"44":1,"45":1,"46":1,"56":4,"57":3},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/MintableDistribution.sol","s":{"1":1,"2":1,"3":2,"4":2,"5":2,"6":2,"7":1,"8":1,"9":1,"10":4},"b":{"1":[3,1]},"f":{"1":1,"2":2,"3":1,"4":4},"fnMap":{"1":{"name":null,"line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":10}}},"2":{"name":"mint","line":28,"loc":{"start":{"line":28,"column":2},"end":{"line":31,"column":18}}},"3":{"name":"finishMinting","line":40,"loc":{"start":{"line":40,"column":2},"end":{"line":43,"column":18}}},"4":{"name":"canMint","line":55,"loc":{"start":{"line":55,"column":2},"end":{"line":55,"column":20}}}},"statementMap":{"1":{"start":{"line":21,"column":6},"end":{"line":21,"column":25}},"2":{"start":{"line":22,"column":6},"end":{"line":22,"column":21}},"3":{"start":{"line":32,"column":4},"end":{"line":32,"column":31}},"4":{"start":{"line":33,"column":4},"end":{"line":33,"column":45}},"5":{"start":{"line":34,"column":4},"end":{"line":34,"column":27}},"6":{"start":{"line":35,"column":4},"end":{"line":35,"column":15}},"7":{"start":{"line":44,"column":4},"end":{"line":44,"column":25}},"8":{"start":{"line":45,"column":4},"end":{"line":45,"column":23}},"9":{"start":{"line":46,"column":4},"end":{"line":46,"column":15}},"10":{"start":{"line":56,"column":4},"end":{"line":56,"column":52}}},"branchMap":{"1":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":4},"end":{"line":56,"column":4}},{"start":{"line":56,"column":4},"end":{"line":56,"column":4}}]}}},"contracts/tokens/distribution/StandardDistribution.sol":{"l":{"35":4,"36":4,"37":4,"38":4,"55":1,"56":1,"57":1,"64":2,"65":2,"66":2,"78":5,"79":5,"87":1,"91":1,"95":7,"105":4,"106":4,"107":4},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/StandardDistribution.sol","s":{"1":4,"2":4,"3":1,"4":1,"5":1,"6":2,"7":2,"8":2,"9":5,"10":5,"11":1,"12":1,"13":7,"14":4,"15":4},"b":{},"f":{"1":4,"2":1,"3":2,"4":5,"5":1,"6":1,"7":7,"8":4},"fnMap":{"1":{"name":"withdraw","line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":34,"column":26}}},"2":{"name":"issueDividends","line":52,"loc":{"start":{"line":52,"column":2},"end":{"line":54,"column":10}}},"3":{"name":null,"line":61,"loc":{"start":{"line":61,"column":2},"end":{"line":63,"column":12}}},"4":{"name":"getTokenValue","line":74,"loc":{"start":{"line":74,"column":2},"end":{"line":77,"column":18}}},"5":{"name":"getUnclaimedAmount","line":83,"loc":{"start":{"line":83,"column":2},"end":{"line":86,"column":18}}},"6":{"name":"totalSupply","line":90,"loc":{"start":{"line":90,"column":2},"end":{"line":90,"column":54}}},"7":{"name":"balanceOf","line":94,"loc":{"start":{"line":94,"column":2},"end":{"line":94,"column":66}}},"8":{"name":"updateclaimableIncome","line":104,"loc":{"start":{"line":104,"column":2},"end":{"line":104,"column":47}}}},"statementMap":{"1":{"start":{"line":35,"column":6},"end":{"line":35,"column":61}},"2":{"start":{"line":38,"column":6},"end":{"line":38,"column":55}},"3":{"start":{"line":55,"column":6},"end":{"line":55,"column":80}},"4":{"start":{"line":56,"column":6},"end":{"line":56,"column":45}},"5":{"start":{"line":57,"column":6},"end":{"line":57,"column":51}},"6":{"start":{"line":64,"column":6},"end":{"line":64,"column":80}},"7":{"start":{"line":65,"column":6},"end":{"line":65,"column":45}},"8":{"start":{"line":66,"column":6},"end":{"line":66,"column":51}},"9":{"start":{"line":78,"column":6},"end":{"line":78,"column":83}},"10":{"start":{"line":79,"column":6},"end":{"line":79,"column":57}},"11":{"start":{"line":87,"column":6},"end":{"line":87,"column":82}},"12":{"start":{"line":91,"column":4},"end":{"line":91,"column":17}},"13":{"start":{"line":95,"column":4},"end":{"line":95,"column":27}},"14":{"start":{"line":105,"column":6},"end":{"line":105,"column":78}},"15":{"start":{"line":106,"column":6},"end":{"line":106,"column":49}}},"branchMap":{}},"contracts/tokens/erc20/BurnableToken.sol":{"l":{"26":12,"27":12,"28":12,"29":12,"41":204,"42":203,"43":201,"44":201,"45":201,"46":201,"61":156,"62":156,"63":156,"75":17,"76":16,"77":15,"78":15,"79":14,"80":14,"95":1,"97":1,"98":1,"113":2,"114":2,"115":1,"118":1,"120":2,"121":2,"133":1,"134":1,"135":1,"136":1,"137":1,"147":40,"148":40,"149":39,"150":39,"151":39,"152":39,"161":2,"170":199,"184":5},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/BurnableToken.sol","s":{"1":12,"2":12,"3":12,"4":12,"5":204,"6":203,"7":201,"8":201,"9":201,"10":201,"11":156,"12":156,"13":156,"14":17,"15":16,"16":15,"17":15,"18":14,"19":14,"20":1,"21":1,"22":1,"23":2,"24":2,"25":1,"26":1,"27":2,"28":2,"29":1,"30":1,"31":1,"32":1,"33":1,"34":40,"35":40,"36":39,"37":39,"38":39,"39":39,"40":2,"41":199,"42":5},"b":{"1":[203,1],"2":[201,2],"3":[16,1],"4":[1,1]},"f":{"1":12,"2":204,"3":156,"4":17,"5":1,"6":2,"7":1,"8":40,"9":2,"10":199,"11":5},"fnMap":{"1":{"name":null,"line":24,"loc":{"start":{"line":24,"column":4},"end":{"line":25,"column":12}}},"2":{"name":"transfer","line":38,"loc":{"start":{"line":38,"column":2},"end":{"line":40,"column":18}}},"3":{"name":"approve","line":58,"loc":{"start":{"line":58,"column":2},"end":{"line":60,"column":18}}},"4":{"name":"transferFrom","line":72,"loc":{"start":{"line":72,"column":2},"end":{"line":74,"column":18}}},"5":{"name":"increaseApproval","line":92,"loc":{"start":{"line":92,"column":2},"end":{"line":94,"column":18}}},"6":{"name":"decreaseApproval","line":110,"loc":{"start":{"line":110,"column":2},"end":{"line":112,"column":18}}},"7":{"name":"burn","line":130,"loc":{"start":{"line":130,"column":2},"end":{"line":132,"column":26}}},"8":{"name":"burnFrom","line":144,"loc":{"start":{"line":144,"column":2},"end":{"line":146,"column":26}}},"9":{"name":"totalSupply","line":160,"loc":{"start":{"line":160,"column":2},"end":{"line":160,"column":54}}},"10":{"name":"balanceOf","line":169,"loc":{"start":{"line":169,"column":2},"end":{"line":169,"column":66}}},"11":{"name":"allowance","line":180,"loc":{"start":{"line":180,"column":2},"end":{"line":183,"column":21}}}},"statementMap":{"1":{"start":{"line":26,"column":8},"end":{"line":26,"column":28}},"2":{"start":{"line":27,"column":8},"end":{"line":27,"column":27}},"3":{"start":{"line":28,"column":8},"end":{"line":28,"column":42}},"4":{"start":{"line":29,"column":8},"end":{"line":29,"column":59}},"5":{"start":{"line":41,"column":4},"end":{"line":41,"column":42}},"6":{"start":{"line":42,"column":4},"end":{"line":42,"column":29}},"7":{"start":{"line":43,"column":4},"end":{"line":43,"column":58}},"8":{"start":{"line":44,"column":4},"end":{"line":44,"column":44}},"9":{"start":{"line":45,"column":4},"end":{"line":45,"column":42}},"10":{"start":{"line":46,"column":4},"end":{"line":46,"column":15}},"11":{"start":{"line":61,"column":4},"end":{"line":61,"column":41}},"12":{"start":{"line":62,"column":4},"end":{"line":62,"column":47}},"13":{"start":{"line":63,"column":4},"end":{"line":63,"column":15}},"14":{"start":{"line":75,"column":4},"end":{"line":75,"column":29}},"15":{"start":{"line":76,"column":4},"end":{"line":76,"column":48}},"16":{"start":{"line":77,"column":4},"end":{"line":77,"column":44}},"17":{"start":{"line":78,"column":4},"end":{"line":78,"column":70}},"18":{"start":{"line":79,"column":4},"end":{"line":79,"column":37}},"19":{"start":{"line":80,"column":4},"end":{"line":80,"column":15}},"20":{"start":{"line":95,"column":4},"end":{"line":95,"column":3610}},"21":{"start":{"line":97,"column":4},"end":{"line":97,"column":70}},"22":{"start":{"line":98,"column":4},"end":{"line":98,"column":15}},"23":{"start":{"line":113,"column":4},"end":{"line":113,"column":51}},"24":{"start":{"line":114,"column":4},"end":{"line":114,"column":4348}},"25":{"start":{"line":115,"column":6},"end":{"line":115,"column":38}},"26":{"start":{"line":118,"column":6},"end":{"line":118,"column":67}},"27":{"start":{"line":120,"column":4},"end":{"line":120,"column":70}},"28":{"start":{"line":121,"column":4},"end":{"line":121,"column":15}},"29":{"start":{"line":133,"column":4},"end":{"line":133,"column":59}},"30":{"start":{"line":134,"column":4},"end":{"line":134,"column":31}},"31":{"start":{"line":135,"column":4},"end":{"line":135,"column":37}},"32":{"start":{"line":136,"column":4},"end":{"line":136,"column":50}},"33":{"start":{"line":137,"column":4},"end":{"line":137,"column":15}},"34":{"start":{"line":147,"column":4},"end":{"line":147,"column":49}},"35":{"start":{"line":148,"column":4},"end":{"line":148,"column":71}},"36":{"start":{"line":149,"column":4},"end":{"line":149,"column":31}},"37":{"start":{"line":150,"column":4},"end":{"line":150,"column":32}},"38":{"start":{"line":151,"column":4},"end":{"line":151,"column":45}},"39":{"start":{"line":152,"column":4},"end":{"line":152,"column":15}},"40":{"start":{"line":161,"column":4},"end":{"line":161,"column":17}},"41":{"start":{"line":170,"column":4},"end":{"line":170,"column":27}},"42":{"start":{"line":184,"column":4},"end":{"line":184,"column":36}}},"branchMap":{"1":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":4},"end":{"line":41,"column":4}},{"start":{"line":41,"column":4},"end":{"line":41,"column":4}}]},"2":{"line":42,"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":4}},{"start":{"line":42,"column":4},"end":{"line":42,"column":4}}]},"3":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":75,"column":4}},{"start":{"line":75,"column":4},"end":{"line":75,"column":4}}]},"4":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":4},"end":{"line":114,"column":4}},{"start":{"line":114,"column":4},"end":{"line":114,"column":4}}]}}},"contracts/tokens/erc20/DividendToken.sol":{"l":{"37":4,"38":3,"39":1,"52":6,"53":5,"54":3,"66":1,"67":1,"68":1,"69":1,"77":10,"78":10,"79":10,"80":10,"81":10,"89":7,"90":7,"91":7,"92":7,"100":0,"107":4,"108":4,"109":4,"122":36,"123":36,"131":4,"141":32,"142":32,"143":32},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/DividendToken.sol","s":{"1":4,"2":1,"3":6,"4":3,"5":1,"6":1,"7":1,"8":1,"9":10,"10":10,"11":10,"12":7,"13":7,"14":7,"15":7,"16":0,"17":4,"18":4,"19":4,"20":36,"21":36,"22":4,"23":32,"24":32},"b":{"1":[3,1],"2":[5,1]},"f":{"1":12,"2":4,"3":6,"4":1,"5":10,"6":7,"7":0,"8":4,"9":36,"10":4,"11":32},"fnMap":{"1":{"name":null,"line":24,"loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":37}}},"2":{"name":"transfer","line":32,"loc":{"start":{"line":32,"column":4},"end":{"line":36,"column":28}}},"3":{"name":"transferFrom","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":28}}},"4":{"name":"approveAndCall","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":28}}},"5":{"name":"withdraw","line":73,"loc":{"start":{"line":73,"column":4},"end":{"line":76,"column":20}}},"6":{"name":"issueDividends","line":85,"loc":{"start":{"line":85,"column":4},"end":{"line":88,"column":20}}},"7":{"name":"getERC20","line":96,"loc":{"start":{"line":96,"column":4},"end":{"line":99,"column":21}}},"8":{"name":null,"line":104,"loc":{"start":{"line":104,"column":4},"end":{"line":106,"column":12}}},"9":{"name":"collectLatestPayments","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":121,"column":20}}},"10":{"name":"getAmountOwed","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":130,"column":20}}},"11":{"name":"updateIncomeClaimed","line":140,"loc":{"start":{"line":140,"column":4},"end":{"line":140,"column":49}}}},"statementMap":{"1":{"start":{"line":37,"column":8},"end":{"line":37,"column":36}},"2":{"start":{"line":39,"column":8},"end":{"line":39,"column":19}},"3":{"start":{"line":52,"column":8},"end":{"line":52,"column":36}},"4":{"start":{"line":54,"column":8},"end":{"line":54,"column":19}},"5":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"6":{"start":{"line":67,"column":8},"end":{"line":67,"column":52}},"7":{"start":{"line":68,"column":8},"end":{"line":68,"column":39}},"8":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"9":{"start":{"line":77,"column":8},"end":{"line":77,"column":62}},"10":{"start":{"line":79,"column":8},"end":{"line":79,"column":51}},"11":{"start":{"line":81,"column":8},"end":{"line":81,"column":19}},"12":{"start":{"line":89,"column":8},"end":{"line":89,"column":47}},"13":{"start":{"line":90,"column":8},"end":{"line":90,"column":82}},"14":{"start":{"line":91,"column":8},"end":{"line":91,"column":53}},"15":{"start":{"line":92,"column":8},"end":{"line":92,"column":19}},"16":{"start":{"line":100,"column":6},"end":{"line":100,"column":23}},"17":{"start":{"line":107,"column":8},"end":{"line":107,"column":47}},"18":{"start":{"line":108,"column":8},"end":{"line":108,"column":82}},"19":{"start":{"line":109,"column":8},"end":{"line":109,"column":53}},"20":{"start":{"line":122,"column":8},"end":{"line":122,"column":89}},"21":{"start":{"line":123,"column":8},"end":{"line":123,"column":63}},"22":{"start":{"line":131,"column":8},"end":{"line":131,"column":95}},"23":{"start":{"line":141,"column":8},"end":{"line":141,"column":90}},"24":{"start":{"line":142,"column":8},"end":{"line":142,"column":55}}},"branchMap":{"1":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":8},"end":{"line":37,"column":8}},{"start":{"line":37,"column":8},"end":{"line":37,"column":8}}]},"2":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]}}},"contracts/tokens/erc20/DividendTokenERC20.sol":{"l":{"32":5,"41":3,"42":2,"43":1,"52":3,"53":2,"54":1,"66":1,"67":1,"68":1,"69":1,"75":6,"76":5,"77":5,"78":5,"79":5,"80":5,"88":10,"89":10,"90":10,"91":10,"92":10,"93":10,"101":2,"102":2,"103":2,"104":2,"106":1,"107":1,"109":2,"122":28,"123":28,"131":4,"138":2,"148":24,"149":24,"150":24},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/DividendTokenERC20.sol","s":{"1":5,"2":3,"3":1,"4":3,"5":1,"6":1,"7":1,"8":1,"9":1,"10":6,"11":5,"12":5,"13":5,"14":5,"15":5,"16":10,"17":10,"18":10,"19":10,"20":10,"21":2,"22":2,"23":2,"24":2,"25":1,"26":1,"27":2,"28":28,"29":28,"30":4,"31":2,"32":24,"33":24},"b":{"1":[2,1],"2":[2,1],"3":[5,1],"4":[5,0],"5":[10,0],"6":[1,1]},"f":{"1":5,"2":3,"3":3,"4":1,"5":6,"6":10,"7":2,"8":28,"9":4,"10":2,"11":24},"fnMap":{"1":{"name":null,"line":30,"loc":{"start":{"line":30,"column":4},"end":{"line":31,"column":45}}},"2":{"name":"transfer","line":36,"loc":{"start":{"line":36,"column":4},"end":{"line":40,"column":28}}},"3":{"name":"transferFrom","line":47,"loc":{"start":{"line":47,"column":4},"end":{"line":51,"column":28}}},"4":{"name":"approveAndCall","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":65,"column":28}}},"5":{"name":"issueDividends","line":72,"loc":{"start":{"line":72,"column":4},"end":{"line":74,"column":19}}},"6":{"name":"withdraw","line":84,"loc":{"start":{"line":84,"column":4},"end":{"line":87,"column":20}}},"7":{"name":"checkForTransfers","line":99,"loc":{"start":{"line":99,"column":4},"end":{"line":100,"column":14}}},"8":{"name":"collectLatestPayments","line":118,"loc":{"start":{"line":118,"column":4},"end":{"line":121,"column":20}}},"9":{"name":"getAmountOwed","line":127,"loc":{"start":{"line":127,"column":4},"end":{"line":130,"column":20}}},"10":{"name":"getERC20","line":134,"loc":{"start":{"line":134,"column":4},"end":{"line":137,"column":21}}},"11":{"name":"updateIncomeClaimed","line":147,"loc":{"start":{"line":147,"column":4},"end":{"line":147,"column":49}}}},"statementMap":{"1":{"start":{"line":32,"column":8},"end":{"line":32,"column":35}},"2":{"start":{"line":41,"column":8},"end":{"line":41,"column":36}},"3":{"start":{"line":43,"column":8},"end":{"line":43,"column":19}},"4":{"start":{"line":52,"column":8},"end":{"line":52,"column":36}},"5":{"start":{"line":54,"column":8},"end":{"line":54,"column":19}},"6":{"start":{"line":66,"column":8},"end":{"line":66,"column":46}},"7":{"start":{"line":67,"column":8},"end":{"line":67,"column":52}},"8":{"start":{"line":68,"column":8},"end":{"line":68,"column":39}},"9":{"start":{"line":69,"column":8},"end":{"line":69,"column":19}},"10":{"start":{"line":75,"column":8},"end":{"line":75,"column":27}},"11":{"start":{"line":76,"column":8},"end":{"line":76,"column":70}},"12":{"start":{"line":77,"column":8},"end":{"line":77,"column":80}},"13":{"start":{"line":78,"column":8},"end":{"line":78,"column":45}},"14":{"start":{"line":79,"column":8},"end":{"line":79,"column":51}},"15":{"start":{"line":80,"column":8},"end":{"line":80,"column":19}},"16":{"start":{"line":88,"column":8},"end":{"line":88,"column":65}},"17":{"start":{"line":90,"column":8},"end":{"line":90,"column":56}},"18":{"start":{"line":91,"column":8},"end":{"line":91,"column":50}},"19":{"start":{"line":92,"column":8},"end":{"line":92,"column":51}},"20":{"start":{"line":93,"column":8},"end":{"line":93,"column":19}},"21":{"start":{"line":101,"column":6},"end":{"line":101,"column":58}},"22":{"start":{"line":102,"column":6},"end":{"line":102,"column":56}},"23":{"start":{"line":103,"column":6},"end":{"line":103,"column":54}},"24":{"start":{"line":104,"column":6},"end":{"line":104,"column":3801}},"25":{"start":{"line":106,"column":8},"end":{"line":106,"column":84}},"26":{"start":{"line":107,"column":8},"end":{"line":107,"column":49}},"27":{"start":{"line":109,"column":6},"end":{"line":109,"column":39}},"28":{"start":{"line":122,"column":8},"end":{"line":122,"column":89}},"29":{"start":{"line":123,"column":8},"end":{"line":123,"column":63}},"30":{"start":{"line":131,"column":8},"end":{"line":131,"column":98}},"31":{"start":{"line":138,"column":6},"end":{"line":138,"column":27}},"32":{"start":{"line":148,"column":8},"end":{"line":148,"column":96}},"33":{"start":{"line":149,"column":8},"end":{"line":149,"column":55}}},"branchMap":{"1":{"line":41,"type":"if","locations":[{"start":{"line":41,"column":8},"end":{"line":41,"column":8}},{"start":{"line":41,"column":8},"end":{"line":41,"column":8}}]},"2":{"line":52,"type":"if","locations":[{"start":{"line":52,"column":8},"end":{"line":52,"column":8}},{"start":{"line":52,"column":8},"end":{"line":52,"column":8}}]},"3":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":8},"end":{"line":75,"column":8}},{"start":{"line":75,"column":8},"end":{"line":75,"column":8}}]},"4":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":8},"end":{"line":76,"column":8}},{"start":{"line":76,"column":8},"end":{"line":76,"column":8}}]},"5":{"line":91,"type":"if","locations":[{"start":{"line":91,"column":8},"end":{"line":91,"column":8}},{"start":{"line":91,"column":8},"end":{"line":91,"column":8}}]},"6":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":6},"end":{"line":104,"column":6}},{"start":{"line":104,"column":6},"end":{"line":104,"column":6}}]}}},"contracts/tokens/erc20/GovernedToken.sol":{"l":{"27":1,"34":1,"35":0,"36":0,"43":0,"44":0,"45":0,"53":1,"54":1,"55":1,"56":1,"57":1},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/GovernedToken.sol","s":{"1":1,"2":1,"3":0,"4":0,"5":0,"6":1,"7":1,"8":1,"9":1,"10":1},"b":{"1":[0,1],"2":[0,0]},"f":{"1":1,"2":1,"3":0,"4":1},"fnMap":{"1":{"name":null,"line":24,"loc":{"start":{"line":24,"column":2},"end":{"line":26,"column":35}}},"2":{"name":"transfer","line":31,"loc":{"start":{"line":31,"column":2},"end":{"line":33,"column":26}}},"3":{"name":"transferFrom","line":40,"loc":{"start":{"line":40,"column":2},"end":{"line":42,"column":26}}},"4":{"name":"getAmountAvailable","line":49,"loc":{"start":{"line":49,"column":2},"end":{"line":52,"column":18}}}},"statementMap":{"1":{"start":{"line":27,"column":4},"end":{"line":27,"column":33}},"2":{"start":{"line":34,"column":6},"end":{"line":34,"column":55}},"3":{"start":{"line":36,"column":6},"end":{"line":36,"column":17}},"4":{"start":{"line":43,"column":6},"end":{"line":43,"column":50}},"5":{"start":{"line":45,"column":6},"end":{"line":45,"column":17}},"6":{"start":{"line":53,"column":4},"end":{"line":53,"column":104}},"7":{"start":{"line":54,"column":4},"end":{"line":54,"column":108}},"8":{"start":{"line":55,"column":4},"end":{"line":55,"column":37}},"9":{"start":{"line":56,"column":4},"end":{"line":56,"column":45}},"10":{"start":{"line":57,"column":4},"end":{"line":57,"column":20}}},"branchMap":{"1":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":6},"end":{"line":34,"column":6}},{"start":{"line":34,"column":6},"end":{"line":34,"column":6}}]},"2":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":6},"end":{"line":43,"column":6}},{"start":{"line":43,"column":6},"end":{"line":43,"column":6}}]}}},"contracts/tokens/erc20/GovernedTokenERC20.sol":{"l":{"28":0,"35":0,"36":0,"37":0,"44":0,"45":0,"46":0,"54":0,"55":0,"56":0,"57":0,"58":0},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/GovernedTokenERC20.sol","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"b":{"1":[0,0],"2":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0},"fnMap":{"1":{"name":null,"line":25,"loc":{"start":{"line":25,"column":2},"end":{"line":27,"column":55}}},"2":{"name":"transfer","line":32,"loc":{"start":{"line":32,"column":2},"end":{"line":34,"column":26}}},"3":{"name":"transferFrom","line":41,"loc":{"start":{"line":41,"column":2},"end":{"line":43,"column":26}}},"4":{"name":"getAmountAvailable","line":50,"loc":{"start":{"line":50,"column":2},"end":{"line":53,"column":18}}}},"statementMap":{"1":{"start":{"line":28,"column":4},"end":{"line":28,"column":33}},"2":{"start":{"line":35,"column":6},"end":{"line":35,"column":55}},"3":{"start":{"line":37,"column":6},"end":{"line":37,"column":17}},"4":{"start":{"line":44,"column":6},"end":{"line":44,"column":50}},"5":{"start":{"line":46,"column":6},"end":{"line":46,"column":17}},"6":{"start":{"line":54,"column":4},"end":{"line":54,"column":104}},"7":{"start":{"line":55,"column":4},"end":{"line":55,"column":108}},"8":{"start":{"line":56,"column":4},"end":{"line":56,"column":37}},"9":{"start":{"line":57,"column":4},"end":{"line":57,"column":45}},"10":{"start":{"line":58,"column":4},"end":{"line":58,"column":20}}},"branchMap":{"1":{"line":35,"type":"if","locations":[{"start":{"line":35,"column":6},"end":{"line":35,"column":6}},{"start":{"line":35,"column":6},"end":{"line":35,"column":6}}]},"2":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":6},"end":{"line":44,"column":6}},{"start":{"line":44,"column":6},"end":{"line":44,"column":6}}]}}},"contracts/tokens/erc20/MintableToken.sol":{"l":{"21":17,"22":17,"23":17,"34":43,"35":43,"36":43,"37":43,"38":43,"46":7,"47":7,"48":7,"55":2,"60":51,"61":50},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/MintableToken.sol","s":{"1":17,"2":17,"3":17,"4":43,"5":43,"6":43,"7":43,"8":43,"9":7,"10":7,"11":7,"12":2,"13":51},"b":{"1":[50,1]},"f":{"1":17,"2":43,"3":7,"4":2,"5":51},"fnMap":{"1":{"name":null,"line":19,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":10}}},"2":{"name":"mint","line":30,"loc":{"start":{"line":30,"column":2},"end":{"line":33,"column":18}}},"3":{"name":"finishMinting","line":42,"loc":{"start":{"line":42,"column":2},"end":{"line":45,"column":18}}},"4":{"name":"getTokenURI","line":51,"loc":{"start":{"line":51,"column":2},"end":{"line":54,"column":20}}},"5":{"name":"canMint","line":59,"loc":{"start":{"line":59,"column":2},"end":{"line":59,"column":20}}}},"statementMap":{"1":{"start":{"line":21,"column":6},"end":{"line":21,"column":25}},"2":{"start":{"line":22,"column":6},"end":{"line":22,"column":21}},"3":{"start":{"line":23,"column":6},"end":{"line":23,"column":15}},"4":{"start":{"line":34,"column":4},"end":{"line":34,"column":31}},"5":{"start":{"line":35,"column":4},"end":{"line":35,"column":45}},"6":{"start":{"line":36,"column":4},"end":{"line":36,"column":27}},"7":{"start":{"line":37,"column":4},"end":{"line":37,"column":43}},"8":{"start":{"line":38,"column":4},"end":{"line":38,"column":15}},"9":{"start":{"line":46,"column":4},"end":{"line":46,"column":25}},"10":{"start":{"line":47,"column":4},"end":{"line":47,"column":23}},"11":{"start":{"line":48,"column":4},"end":{"line":48,"column":15}},"12":{"start":{"line":55,"column":6},"end":{"line":55,"column":21}},"13":{"start":{"line":60,"column":4},"end":{"line":60,"column":52}}},"branchMap":{"1":{"line":60,"type":"if","locations":[{"start":{"line":60,"column":4},"end":{"line":60,"column":4}},{"start":{"line":60,"column":4},"end":{"line":60,"column":4}}]}}},"contracts/tokens/erc20/StandardToken.sol":{"l":{"34":17,"43":5,"44":3,"45":2,"46":2,"47":2,"48":2,"61":11,"62":11,"63":11,"75":7,"76":6,"77":5,"78":4,"79":4,"80":4,"81":4,"82":4,"101":1,"103":1,"104":1,"119":2,"120":2,"121":1,"124":1,"126":2,"127":2,"135":36,"144":55},"path":"/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/StandardToken.sol","s":{"1":17,"2":5,"3":3,"4":2,"5":2,"6":2,"7":2,"8":11,"9":11,"10":11,"11":7,"12":6,"13":5,"14":4,"15":4,"16":4,"17":4,"18":4,"19":1,"20":1,"21":1,"22":2,"23":2,"24":1,"25":1,"26":2,"27":2,"28":36,"29":55},"b":{"1":[3,2],"2":[2,1],"3":[6,1],"4":[5,1],"5":[4,1],"6":[1,1]},"f":{"1":17,"2":5,"3":11,"4":7,"5":1,"6":2,"7":36,"8":55},"fnMap":{"1":{"name":"allowance","line":30,"loc":{"start":{"line":30,"column":2},"end":{"line":33,"column":21}}},"2":{"name":"transfer","line":42,"loc":{"start":{"line":42,"column":2},"end":{"line":42,"column":70}}},"3":{"name":"approve","line":60,"loc":{"start":{"line":60,"column":2},"end":{"line":60,"column":74}}},"4":{"name":"transferFrom","line":72,"loc":{"start":{"line":72,"column":2},"end":{"line":74,"column":18}}},"5":{"name":"increaseApproval","line":94,"loc":{"start":{"line":94,"column":2},"end":{"line":100,"column":3}}},"6":{"name":"decreaseApproval","line":116,"loc":{"start":{"line":116,"column":2},"end":{"line":118,"column":18}}},"7":{"name":"totalSupply","line":134,"loc":{"start":{"line":134,"column":2},"end":{"line":134,"column":54}}},"8":{"name":"balanceOf","line":143,"loc":{"start":{"line":143,"column":2},"end":{"line":143,"column":66}}}},"statementMap":{"1":{"start":{"line":34,"column":4},"end":{"line":34,"column":36}},"2":{"start":{"line":43,"column":4},"end":{"line":43,"column":42}},"3":{"start":{"line":44,"column":4},"end":{"line":44,"column":29}},"4":{"start":{"line":45,"column":4},"end":{"line":45,"column":58}},"5":{"start":{"line":46,"column":4},"end":{"line":46,"column":44}},"6":{"start":{"line":47,"column":4},"end":{"line":47,"column":42}},"7":{"start":{"line":48,"column":4},"end":{"line":48,"column":15}},"8":{"start":{"line":61,"column":4},"end":{"line":61,"column":41}},"9":{"start":{"line":62,"column":4},"end":{"line":62,"column":47}},"10":{"start":{"line":63,"column":4},"end":{"line":63,"column":15}},"11":{"start":{"line":75,"column":4},"end":{"line":75,"column":37}},"12":{"start":{"line":76,"column":4},"end":{"line":76,"column":48}},"13":{"start":{"line":77,"column":4},"end":{"line":77,"column":29}},"14":{"start":{"line":78,"column":4},"end":{"line":78,"column":48}},"15":{"start":{"line":79,"column":4},"end":{"line":79,"column":44}},"16":{"start":{"line":80,"column":4},"end":{"line":80,"column":70}},"17":{"start":{"line":81,"column":4},"end":{"line":81,"column":37}},"18":{"start":{"line":82,"column":4},"end":{"line":82,"column":15}},"19":{"start":{"line":101,"column":4},"end":{"line":101,"column":3641}},"20":{"start":{"line":103,"column":4},"end":{"line":103,"column":70}},"21":{"start":{"line":104,"column":4},"end":{"line":104,"column":15}},"22":{"start":{"line":119,"column":4},"end":{"line":119,"column":51}},"23":{"start":{"line":120,"column":4},"end":{"line":120,"column":4387}},"24":{"start":{"line":121,"column":6},"end":{"line":121,"column":38}},"25":{"start":{"line":124,"column":6},"end":{"line":124,"column":67}},"26":{"start":{"line":126,"column":4},"end":{"line":126,"column":70}},"27":{"start":{"line":127,"column":4},"end":{"line":127,"column":15}},"28":{"start":{"line":135,"column":4},"end":{"line":135,"column":17}},"29":{"start":{"line":144,"column":4},"end":{"line":144,"column":27}}},"branchMap":{"1":{"line":43,"type":"if","locations":[{"start":{"line":43,"column":4},"end":{"line":43,"column":4}},{"start":{"line":43,"column":4},"end":{"line":43,"column":4}}]},"2":{"line":44,"type":"if","locations":[{"start":{"line":44,"column":4},"end":{"line":44,"column":4}},{"start":{"line":44,"column":4},"end":{"line":44,"column":4}}]},"3":{"line":75,"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":75,"column":4}},{"start":{"line":75,"column":4},"end":{"line":75,"column":4}}]},"4":{"line":76,"type":"if","locations":[{"start":{"line":76,"column":4},"end":{"line":76,"column":4}},{"start":{"line":76,"column":4},"end":{"line":76,"column":4}}]},"5":{"line":77,"type":"if","locations":[{"start":{"line":77,"column":4},"end":{"line":77,"column":4}},{"start":{"line":77,"column":4},"end":{"line":77,"column":4}}]},"6":{"line":120,"type":"if","locations":[{"start":{"line":120,"column":4},"end":{"line":120,"column":4}},{"start":{"line":120,"column":4},"end":{"line":120,"column":4}}]}}}} \ No newline at end of file diff --git a/coverage/access/AccessHierarchy.sol.html b/coverage/access/AccessHierarchy.sol.html new file mode 100644 index 00000000..68503504 --- /dev/null +++ b/coverage/access/AccessHierarchy.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for access/AccessHierarchy.sol + + + + + + + +
+
+

+ all files / access/ AccessHierarchy.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 10/10 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +  +  +  +3× +2× +2× +2× +  +  +  +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  +3× +2× +  +  +  +  +5× +4× +  +  +  +  +13× +10× +  +  +  +  +5× +4× +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+// @title A contract for granting and revoking access levels to different users
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice Made for platforms that require hierarchical access restrictions
+contract AccessHierarchy {
+ 
+  Database public database;
+  uint8 public upperAccessLevel;
+ 
+  // @notice Constructor: Inititalize Database
+  constructor(address _database)
+  public  {
+    database = Database(_database);
+  }
+ 
+  // @notice Owner can manually grant access to a user here. WIll be used for KYC approval
+  // @param Address of new user.
+  // @param The level of access granted by owner/burningcontract
+  function approveUser(address _newUser, uint _accessLevel)
+  onlyPlatform
+  noEmptyAddress(_newUser)
+  public
+  returns (bool) {
+    require(_accessLevel < upperAccessLevel && _accessLevel != uint8(0));
+    database.setUint(keccak256(abi.encodePacked("userAccess", _newUser)), _accessLevel);
+    emit LogUserApproved(_newUser, _accessLevel);
+    return true;
+  }
+ 
+  // @notice Owner can remove access for users
+  // @param User to be removed
+  function removeUser(address _user)
+  onlyOwner
+  public
+  returns (bool) {
+    uint accessLevel = database.uintStorage(keccak256(abi.encodePacked("userAccess", _user)));
+    database.deleteUint(keccak256(abi.encodePacked("userAccess", _user)));
+    emit LogUserRemoved(_user, accessLevel);
+    return true;
+  }
+ 
+  // @notice Owner can set the upper bound on access levels
+  // @param (uint8) _newUpperLimit = The highest access level on the platform
+  function setUpperAccessLevel(uint8 _newUpperLimit)
+  public
+  onlyOwner {
+    require(_newUpperLimit > uint8(0));
+    upperAccessLevel = _newUpperLimit;
+  }
+ 
+  // @notice Deny empty address parameters
+  modifier noEmptyAddress(address _param) {
+    require(_param != address(0));
+    _;
+  }
+ 
+  // @notice Deny all callers except owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice only contracts on the platform can call.
+  modifier onlyPlatform {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", msg.sender))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                        Events
+  //------------------------------------------------------------------------------------------------------------------
+  event LogUserApproved(address _user, uint _approvalLevel);
+  event LogUserRemoved(address indexed _user, uint indexed _accessLevel);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/access/ERC20Burner.sol.html b/coverage/access/ERC20Burner.sol.html new file mode 100644 index 00000000..849e6763 --- /dev/null +++ b/coverage/access/ERC20Burner.sol.html @@ -0,0 +1,335 @@ + + + + Code coverage report for access/ERC20Burner.sol + + + + + + + +
+
+

+ all files / access/ ERC20Burner.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 80% + Branches + 8/10 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +6× +6× +  +  +  +  +  +  +  +  +  +  +40× +39× +39× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +45× +43× +  +  +  +  +43× +43× +40× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../interfaces/BurnableERC20.sol';
+import "../interfaces/DBInterface.sol";
+ 
+/// @title A contract for burning ERC20 tokens as usage fee for dapps
+/// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+/// @notice Allows Dapps to call this contract to burn ERC20 tokens as a usage fee
+/// @dev This contract does not accept tokens. It only burns tokens from investors wallets to run platform functionality
+contract ERC20Burner {
+ 
+  BurnableERC20 public token;  // The instance of the ERC20 burner contract
+  DBInterface public database;   // The datbase instance
+ 
+ 
+  // @notice constructor: initializes database and the MYB token
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+    token = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+    Erequire(address(token) != address(0));
+  }
+ 
+  // @notice authorized contracts can burn mybit tokens here if the investor has approved this contract to do so
+  // @param (address) _tokenHolder = the address of the mybit token holder who wishes to burn _amount of tokens
+  // @param (uint) _amount = the amount of tokens to be burnt (must include decimal places)
+  function burn(address _tokenHolder, uint _amount)
+  external
+  onlyPlatformContracts(msg.sender)
+  acceptedState(_tokenHolder)
+  returns (bool) {
+    require(token.burnFrom(_tokenHolder, _amount));
+    emit LogMYBBurned(_tokenHolder, msg.sender, _amount);
+    return true;
+  }
+ 
+  // @notice owners can set the cost of functionality on the platform here.
+  // @dev _amount will be how many platformTokens are burned to call the method at _contractAddress
+  // @param (bytes4) _methodID: the methodID of the function which is to require a burning fee
+  // @param (address) _contractAddress: the address of the contract where this method is contained
+  function setFee(bytes4 _methodID, address _contractAddress, uint _amount)
+  external
+  onlyOwner
+  returns (bool) {
+    //Sets the price to burn per function in MyB.
+    database.setUint(keccak256(abi.encodePacked(_methodID, _contractAddress)), _amount);
+    emit LogFeeAdded(_contractAddress, _methodID, _amount);
+    return true;
+  }
+ 
+ 
+  // @notice fallback function. Rejects all ether
+  function ()
+  external
+  payable {
+    revert();
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice reverts if msg.sender isn't the owner
+  modifier onlyOwner {
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice reverts if address isn't authorized to burn MYB
+  modifier onlyPlatformContracts(address _burner) {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", _burner))));
+    _;
+  }
+ 
+  // @notice reverts if investor hasn't accepted current contract state or if he doesn't ignore state changes entirely
+  modifier acceptedState(address _investor) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    require(database.boolStorage(keccak256(abi.encodePacked(currentState, _investor))) || database.boolStorage(keccak256(abi.encodePacked("ignoreStateChanges", _investor))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogMYBBurned(address _tokenHolder, address _burningContract, uint _amount);
+  event LogFeeAdded(address indexed _contractAddress, bytes4 _methodID, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/access/Expirable.sol.html b/coverage/access/Expirable.sol.html new file mode 100644 index 00000000..011d72e6 --- /dev/null +++ b/coverage/access/Expirable.sol.html @@ -0,0 +1,239 @@ + + + + Code coverage report for access/Expirable.sol + + + + + + + +
+
+

+ all files / access/ Expirable.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 50% + Branches + 2/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+import '../math/SafeMath.sol';
+import './AccessHierarchy.sol';
+ 
+// @title A contract extension that gives an expiration date to user access
+// @author Kyle Dewhurst, MyBit Foundation
+contract Expirable is AccessHierarchy {
+  using SafeMath for uint;
+ 
+  uint public expirationLength = uint256(31557600);    // 365 days
+ 
+  constructor(address _database) public AccessHierarchy(_database){}
+    
+  //------------------------------------------------------------------------------------------------------------------
+  // @notice Owner can manually grant access to a user here. WIll be used for KYC approval
+  // @param Address of new user.
+  // @param The level of access granted by owner/burningcontract
+  // TODO: does the modifier in AccessHierarchy throw?
+  //------------------------------------------------------------------------------------------------------------------
+  function approveTemporaryUser(address _newUser, uint _accessLevel)
+  onlyOwner
+  noEmptyAddress(_newUser)
+  public
+  returns (bool) {
+    Erequire(approveUser(_newUser, _accessLevel));
+    uint expiry = now.add(expiry);
+    database.setUint(keccak256(abi.encodePacked("userAccessExpiration", _newUser)), expiry);
+    return true;
+  }
+ 
+ 
+  // @notice Owner can remove access for users
+  // @param User to be removed
+  function removeTemporaryUser(address _user)
+  onlyOwner
+  public
+  returns (bool) {
+    Erequire(removeUser(_user));
+    database.deleteUint(keccak256(abi.encodePacked("userAccessExpiration", _user)));
+    return true;
+  }
+ 
+ 
+  // @notice Owner can change the length of expiration here
+  // @param (uint) _newExpirationLength = The number of seconds until the access expires
+  function changeExpirationLength(uint _newExpirationLength)
+  external
+  onlyOwner {
+    uint oldExpiration = expirationLength;
+    expirationLength = _newExpirationLength;
+    emit LogExpirationLengthChanged(oldExpiration, expirationLength);
+  }
+ 
+  event LogExpirationLengthChanged(uint _oldExpirationLength, uint _newExpirationLength);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/access/KYC.sol.html b/coverage/access/KYC.sol.html new file mode 100644 index 00000000..0c0f4f0f --- /dev/null +++ b/coverage/access/KYC.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for access/KYC.sol + + + + + + + +
+
+

+ all files / access/ KYC.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +1× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './AccessHierarchy.sol';
+ 
+// @title A contract that manages KYC approval
+// @notice KYC can be granted or revoked here
+// @author Kyle Dewhurst, MyBit Foundation
+ 
+contract KYC is AccessHierarchy {
+ 
+  constructor(address _database) public AccessHierarchy(_database){}
+ 
+  // @notice Owner can approve KYC for user
+  function approveKYC(address _user)
+  onlyOwner
+  external {
+    database.setBool(keccak256(abi.encodePacked("kycApproved", _user)), true);
+    emit LogKYCApproved(msg.sender, _user);
+  }
+ 
+  // @notice Owner can approve KYC for user
+  function revokeKYC(address _user)
+  onlyOwner
+  external  {
+    database.deleteBool(keccak256(abi.encodePacked("kycApproved", _user)));
+  }
+ 
+ 
+  event LogKYCApproved(address _owner, address _user);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/access/index.html b/coverage/access/index.html new file mode 100644 index 00000000..4f4a7532 --- /dev/null +++ b/coverage/access/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for access/ + + + + + + + +
+
+

+ all files access/ +

+
+
+ 100% + Statements + 34/34 +
+
+ 83.33% + Branches + 20/24 +
+
+ 100% + Functions + 21/21 +
+
+ 100% + Lines + 47/47 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AccessHierarchy.sol
100%12/12100%10/10100%7/7100%17/17
ERC20Burner.sol
100%13/1380%8/10100%7/7100%17/17
Expirable.sol
100%8/850%2/4100%4/4100%10/10
KYC.sol
100%1/1100%0/0100%3/3100%3/3
+
+
+ + + + + + + diff --git a/coverage/base.css b/coverage/base.css new file mode 100644 index 00000000..29737bcb --- /dev/null +++ b/coverage/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/crowdsale/CrowdsaleERC20.sol.html b/coverage/crowdsale/CrowdsaleERC20.sol.html new file mode 100644 index 00000000..9308bff2 --- /dev/null +++ b/coverage/crowdsale/CrowdsaleERC20.sol.html @@ -0,0 +1,635 @@ + + + + Code coverage report for crowdsale/CrowdsaleERC20.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleERC20.sol +

+
+
+ 88.37% + Statements + 38/43 +
+
+ 66.67% + Branches + 24/36 +
+
+ 78.57% + Functions + 11/14 +
+
+ 88.14% + Lines + 52/59 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +5× +5× +5× +5× +3× +3× +3× +3× +3× +3× +  +  +2× +2× +  +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +2× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +9× +8× +  +  +  +  +5× +5× +  +  +  +  +9× +9× +  +  +  +  +7× +6× +  +  +  +  +2× +1× +  +  +  +  +7× +6× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../interfaces/ERC20DividendInterface.sol";
+import "../access/ERC20Burner.sol";
+ 
+// @title An asset crowdsale contract which accepts funding from ERC20 tokens.
+// @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice creates a dividend token to represent the newly created asset.
+contract CrowdsaleERC20{
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+  ERC20Burner public burner;
+ 
+  // @notice Constructor: initializes database instance
+  // @param: The address for the platform database
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+ 
+  // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens.
+  // @dev investor must approve this contract to transfer tokens
+  // @param (bytes32) _assetID = The ID of the asset tokens, investor wishes to purchase
+  // @param (uint) _amount = The amount to spend purchasing this asset
+  function buyAssetOrderERC20(bytes32 _assetID, uint _amount)
+  external
+  validAsset(_assetID)
+  beforeDeadline(_assetID)
+  notFinalized(_assetID)
+  burnRequired
+  returns (bool) {
+    ERC20DividendInterface assetToken = ERC20DividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    uint amountToRaise = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+    uint tokensRemaining = amountToRaise.sub(assetToken.totalSupply());
+    if (_amount >= tokensRemaining) {
+      Erequire(fundingToken.transferFrom(msg.sender, address(this), tokensRemaining));    // transfer investors tokens into contract
+      Erequire(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID))) ));
+      Erequire(finalizeCrowdsale(_assetID));
+      Erequire(assetToken.mint(msg.sender, tokensRemaining));   // Send remaining asset tokens to investor
+      Erequire(assetToken.finishMinting());
+      require(payoutERC20(_assetID, amountToRaise));          // 1 token = 1 wei
+    }
+    else {
+      Erequire(fundingToken.transferFrom(msg.sender, address(this), _amount));
+      Erequire(assetToken.mint(msg.sender, _amount));
+    }
+    emit LogAssetPurchased(_assetID, msg.sender, _amount); //Should amount listed be how much they spent or how much they received?
+    return true;
+  }
+ 
+ 
+  // @notice Contributors can retrieve their funds here if crowdsale has paased deadline
+  // @param (bytes32) _assetID =  The ID of the asset which didn't reach it's crowdfunding goals
+  function refund(bytes32 _assetID)
+  external
+  whenNotPaused
+  validAsset(_assetID)
+  afterDeadline(_assetID)
+  notFinalized(_assetID)
+  returns (bool) {
+    Erequire(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) != 0);
+    database.deleteUint(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+    address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    ERC20DividendInterface assetToken = ERC20DividendInterface(tokenAddress);
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    uint refundValue = assetToken.totalSupply(); //token=wei
+    fundingToken.approve(tokenAddress, refundValue);
+    assetToken.issueDividends(refundValue);
+    return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Internal Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw
+  // @dev The contract manager needs to know  the address PlatformDistribution contract
+  function payoutERC20(bytes32 _assetID, uint _amount)
+  private
+  whenNotPaused
+  returns (bool) {
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    address operator = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+    address platformWallet = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+    require(operator != address(0) && platformWallet != address(0));
+    uint operatorPortion = _amount.mul(99).div(100);
+    uint platformPortion = _amount.sub(operatorPortion);
+    fundingToken.transfer(platformWallet, platformPortion);
+    fundingToken.transfer(operator, operatorPortion);
+    emit LogAssetPayout(_assetID, operator, _amount);
+    return true;
+  }
+ 
+  // @notice platform owners can recover tokens here
+  function recoverTokens(address _erc20Token)
+  onlyOwner
+  external {
+    ERC20 thisToken = ERC20(_erc20Token);
+    uint contractBalance = thisToken.balanceOf(address(this));
+    thisToken.transfer(msg.sender, contractBalance);
+  }
+ 
+  // @notice platform owners can destroy contract here
+  function destroy()
+  onlyOwner
+  external {
+    emit LogDestruction(address(this).balance, msg.sender);
+    selfdestruct(msg.sender);
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Internal functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice internal function for freeing up storage after crowdsale finishes
+  // @param the ID of this asset.
+  function finalizeCrowdsale(bytes32 _assetID)
+  internal
+  whenNotPaused
+  returns (bool) {
+      database.setBool(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)), true);
+      database.deleteUint(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+      database.deleteUint(keccak256(abi.encodePacked("assetManagerFee", _assetID)));
+      return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice function won't run if owners have paused this contract
+  modifier whenNotPaused {
+    require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+    _;
+  }
+ 
+  // @notice reverts if investor hasn't approved burner to burn platform token
+  modifier burnRequired {
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+      // @notice reverts if the asset does not have a token address set in the database
+  modifier validAsset(bytes32 _assetID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+    _;
+  }
+ 
+  // @notice reverts if the funding deadline has already past
+  modifier beforeDeadline(bytes32 _assetID) {
+    require(now <= database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+    _;
+  }
+ 
+  // @notice reverts if the funding deadline has already past
+  modifier afterDeadline(bytes32 _assetID) {
+    require(now > database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+    _;
+  }
+ 
+  // @notice returns true if crowdsale is not finshed
+  modifier notFinalized(bytes32 _assetID) {
+    require( !database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))) );
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  event LogAssetPurchased(bytes32 indexed _assetID, address indexed _sender, uint _amount);
+  event LogAssetPayout(bytes32 indexed _assetID, address indexed _operator, uint _amount);
+  event LogDestruction(uint _amountSent, address indexed _caller);
+  event LogAssetInfo(uint _investorAmount, uint _tokensRemaining);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/crowdsale/CrowdsaleETH.sol.html b/coverage/crowdsale/CrowdsaleETH.sol.html new file mode 100644 index 00000000..e4193301 --- /dev/null +++ b/coverage/crowdsale/CrowdsaleETH.sol.html @@ -0,0 +1,653 @@ + + + + Code coverage report for crowdsale/CrowdsaleETH.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleETH.sol +

+
+
+ 94.87% + Statements + 37/39 +
+
+ 61.76% + Branches + 21/34 +
+
+ 93.75% + Functions + 15/16 +
+
+ 94.74% + Lines + 54/57 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +5× +5× +5× +  +3× +3× +3× +3× +3× +3× +  +  +2× +  +5× +5× +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +8× +8× +  +  +  +  +2× +1× +  +  +  +  +5× +5× +  +  +  +  +3× +2× +  +  +  +  +10× +10× +  +  +  +  +8× +5× +  +  +  +  +2× +2× +  +  +  +  +7× +7× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../interfaces/EtherDividendInterface.sol";
+import "../access/ERC20Burner.sol";
+ 
+// @title An asset crowdsale contract, which accepts Ether for funding.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @notice Starts a new crowdsale and returns asset dividend tokens for Wei received.
+// @dev The AssetManager
+contract CrowdsaleETH {
+    using SafeMath for uint256;
+ 
+    DBInterface public database;
+    ERC20Burner public burner;
+ 
+    // @notice Constructor: Initiates the database
+    // @param: The address for the database contract
+    constructor(address _database)
+    public {
+        database = DBInterface(_database);
+        burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+    }
+ 
+ 
+    // @notice Investors can send Ether here to fund asset, receiving an equivalent number of asset-tokens.
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    function buyAssetOrderETH(bytes32 _assetID)
+    external
+    payable
+    requiresEther
+    validAsset(_assetID)
+    beforeDeadline(_assetID)
+    notFinalized(_assetID)
+    burnRequired
+    returns (bool) {
+      EtherDividendInterface assetToken = EtherDividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+      uint amountToRaise = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+      uint tokensRemaining = amountToRaise.sub(assetToken.totalSupply());
+      if (msg.value >= tokensRemaining) {
+        // Give assetManager his portion of tokens
+        Erequire(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID)))));
+        Erequire(finalizeCrowdsale(_assetID));    // delete unnecessary variables
+        Erequire(assetToken.mint(msg.sender, tokensRemaining));   // Send remaining asset tokens
+        Erequire(assetToken.finishMinting());
+        Erequire(payoutETH(_assetID, amountToRaise));          // 1 token = 1 wei
+        msg.sender.transfer(msg.value.sub(tokensRemaining));     // Return leftover WEI after cost of tokens calculated and subtracted from msg.value
+      }
+      else {
+        Erequire(assetToken.mint(msg.sender, msg.value));
+      }
+      emit LogAssetPurchased(_assetID, msg.sender, msg.value);
+      return true;
+    }
+ 
+ 
+    // @notice Contributors can retrieve their funds here if crowdsale has paased deadline and not reached its goal
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    function refund(bytes32 _assetID)
+    external
+    whenNotPaused
+    validAsset(_assetID)
+    afterDeadline(_assetID)
+    notFinalized(_assetID)
+    returns (bool) {
+      Erequire(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) != 0);
+      database.deleteUint(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+      database.deleteUint(keccak256(abi.encodePacked("investorSupply", _assetID)));
+      EtherDividendInterface assetToken = EtherDividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+      uint refundValue = assetToken.totalSupply(); //token=wei
+      assetToken.issueDividends.value(refundValue)();
+      return true;
+    }
+ 
+    // @notice platform owners can recover tokens here
+    function recoverTokens(address _erc20Token)
+    onlyOwner
+    external {
+      ERC20 thisToken = ERC20(_erc20Token);
+      uint contractBalance = thisToken.balanceOf(address(this));
+      thisToken.transfer(msg.sender, contractBalance);
+    }
+ 
+    // @notice platform owners can destroy contract here
+    function destroy()
+    onlyOwner
+    external {
+      emit LogDestruction(address(this).balance, msg.sender);
+      selfdestruct(msg.sender);
+    }
+ 
+    // @notice fallback function: reject ether
+    function ()
+    public
+    payable {
+      revert();
+    }
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Internal Functions
+    //------------------------------------------------------------------------------------------------------------------
+ 
+    // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator & assetManager can withdraw
+    // @dev The contract manager needs to know  the address PlatformDistribution contract
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    // @param (uint) _amount = The amount of WEI to be sent to the platform + the operator
+    function payoutETH(bytes32 _assetID, uint _amount)
+    internal
+    returns (bool) {
+      address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+      address platformWallet = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+      Erequire(operatorAddress != address(0) && platformWallet != address(0));
+      uint operatorPortion = _amount.mul(99).div(100);
+      uint platformPortion = _amount.sub(operatorPortion);
+      platformWallet.transfer(platformPortion);
+      operatorAddress.transfer(operatorPortion);
+      emit LogAssetPayout(_assetID, operatorAddress, _amount);
+      return true;
+    }
+ 
+    // @notice internal function for freeing up storage after crowdsale finishes
+    // @param the ID of this asset.
+    function finalizeCrowdsale(bytes32 _assetID)
+    internal
+    returns (bool) {
+        database.setBool(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)), true);
+        database.deleteUint(keccak256(abi.encodePacked("amountToRaise", _assetID)));     // This is now represented as totalSupply in the asset-token
+        database.deleteUint(keccak256(abi.encodePacked("assetManagerFee", _assetID)));   // This is now represented as tokens in AssetManagerFunds.sol
+        return true;
+    }
+ 
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Modifiers
+    //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+    // @notice Requires that Ether is sent with the transaction
+    modifier requiresEther() {
+      Erequire(msg.value > 0);
+      _;
+    }
+ 
+    // @notice Sender must be a registered owner
+    modifier onlyOwner {
+      require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+      _;
+    }
+ 
+    // @notice reverts if investor hasn't approved burner to burn platform token
+    modifier burnRequired {
+      Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+      _;
+    }
+ 
+    // @notice function won't run if owners have paused this contract
+    modifier whenNotPaused {
+      require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+      _;
+    }
+ 
+    // @notice reverts if the asset does not have a token address set in the database
+    modifier validAsset(bytes32 _assetID) {
+      Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+      _;
+    }
+ 
+    // @notice reverts if the funding deadline has already past
+    modifier beforeDeadline(bytes32 _assetID) {
+      require(now <= database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+      _;
+    }
+ 
+    // @notice reverts if the funding deadline has already past
+    modifier afterDeadline(bytes32 _assetID) {
+      Erequire(now > database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+      _;
+    }
+ 
+    // @notice returns true if crowdsale is not finshed
+    modifier notFinalized(bytes32 _assetID) {
+      Erequire( !database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))) );
+      _;
+    }
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Events
+    //------------------------------------------------------------------------------------------------------------------
+ 
+    event LogAssetPurchased(bytes32 indexed _assetID, address indexed _sender, uint _amount);
+    event LogRefund(bytes32 indexed _assetID, address indexed _funder, uint _amount);
+    event LogAssetPayout(bytes32 indexed _assetID, address indexed _distributionContract, uint _amount);
+    event LogDestruction(uint _amountSent, address indexed _caller);
+  }
+ 
+
+
+ + + + + + + diff --git a/coverage/crowdsale/CrowdsaleGeneratorERC20.sol.html b/coverage/crowdsale/CrowdsaleGeneratorERC20.sol.html new file mode 100644 index 00000000..94516fc6 --- /dev/null +++ b/coverage/crowdsale/CrowdsaleGeneratorERC20.sol.html @@ -0,0 +1,290 @@ + + + + Code coverage report for crowdsale/CrowdsaleGeneratorERC20.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleGeneratorERC20.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 75% + Branches + 9/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +5× +5× +5× +4× +4× +3× +3× +3× +3× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +6× +6× +  +  +  +  +  +  +  +  +  + 
 pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendTokenERC20.sol";
+ 
+// @title A crowdsale generator contract
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here
+contract CrowdsaleGeneratorERC20 {
+  using SafeMath for uint256;
+ 
+  DBInterface private database;
+  ERC20Burner private burner;
+ 
+  uint constant scalingFactor = 1e32;
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // @notice AssetManagers can initiate a crowdfund for a new asset here
+  // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding
+  // @param (string) _assetURI = The location where information about the asset can be found
+  // @param (bytes32) _operatorID = The ID of the operator who is to create and install this asset
+  // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails
+  // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success
+  // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success
+  // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment)
+  function createAssetOrderERC20(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, address _fundingToken)
+  external
+  burnRequired {
+    require(_amountToRaise > 0);
+    Erequire(_assetManagerPerc < 100);
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("acceptsToken", _operatorID, _fundingToken))));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) != address(0));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+    require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", assetID))) == 0);
+    address assetAddress = address(new DividendTokenERC20(_assetURI, database.addressStorage(keccak256(abi.encodePacked("contract", "CrowdsaleERC20"))), _fundingToken));
+    database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), now.add(_fundingLength));
+    uint assetManagerFee = _amountToRaise.mul(uint(100).mul(scalingFactor).div(uint(100).sub(_assetManagerPerc)).sub(scalingFactor)).div(scalingFactor);
+    database.setUint(keccak256(abi.encodePacked("amountToRaise", assetID)), _amountToRaise);
+    database.setUint(keccak256(abi.encodePacked("assetManagerFee", assetID)), assetManagerFee);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), assetAddress);
+    database.setBytes32(keccak256(abi.encodePacked("assetTokenID", assetAddress)), assetID);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("operator", assetID)), database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))));
+    database.setAddress(keccak256(abi.encodePacked("fundingToken", assetID)), _fundingToken);
+    emit LogAssetFundingStarted(assetID, msg.sender, _assetURI, assetAddress);
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice reverts if AssetManager hasn't approved burner to burn platform token
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogAssetFundingStarted(bytes32 indexed _assetID, address indexed _assetManager, string _assetURI, address indexed _tokenAddress);
+  event LogSig(bytes4 _sig);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/crowdsale/CrowdsaleGeneratorETH.sol.html b/coverage/crowdsale/CrowdsaleGeneratorETH.sol.html new file mode 100644 index 00000000..597e46c8 --- /dev/null +++ b/coverage/crowdsale/CrowdsaleGeneratorETH.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for crowdsale/CrowdsaleGeneratorETH.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleGeneratorETH.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +9× +8× +7× +7× +6× +6× +5× +5× +5× +5× +5× +5× +5× +5× +5× +5× +5× +  +  +  +  +  +  +  +  +  +  +9× +9× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendToken.sol";
+ 
+// @title A crowdsale generator contract
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice AssetManagers can initiate a crowdsale that accepts Ether as payment here
+contract CrowdsaleGeneratorETH {
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+  ERC20Burner public burner;
+ 
+  uint constant scalingFactor = 1e32;   // Used to avoid rounding errors
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // @notice AssetManagers can initiate a crowdfund for a new asset here
+  // @dev the crowdsaleETH contract is granted rights to mint asset-tokens as it receives funding
+  // @param (string) _assetURI = The location where information about the asset can be found
+  // @param (bytes32) _operatorID = The ID of the operator who is to create and install this asset
+  // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails
+  // @param (uint) _amountToRaise = The amount of WEI required to raise for the crowdsale to be a success
+  // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success
+  function createAssetOrderETH(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc)
+  external
+  burnRequired
+  returns (bool) {
+    require(_amountToRaise > 0);
+    require(_assetManagerPerc < 100);
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("acceptsEther", _operatorID))));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) != address(0));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+    require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", assetID))) == 0);
+    address assetAddress = address(new DividendToken(_assetURI, database.addressStorage(keccak256(abi.encodePacked("contract", "CrowdsaleETH")))));   // Gives this contract all new asset tokens
+    database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), now.add(_fundingLength));
+    uint assetManagerFee = _amountToRaise.mul(uint(100).mul(scalingFactor).div(uint(100).sub(_assetManagerPerc)).sub(scalingFactor)).div(scalingFactor);
+    database.setUint(keccak256(abi.encodePacked("assetManagerFee", assetID)), assetManagerFee);
+    database.setUint(keccak256(abi.encodePacked("amountToRaise", assetID)), _amountToRaise);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), assetAddress);
+    database.setBytes32(keccak256(abi.encodePacked("assetTokenID", assetAddress)), assetID);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("operator", assetID)), database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))));
+    emit LogAssetFundingStarted(assetID, msg.sender, _assetURI, address(assetAddress));
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  // @notice reverts if asset manager is unable to burn pp
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogAssetFundingStarted(bytes32 indexed _assetID, address indexed _assetManager, string _assetURI, address indexed _tokenAddress);
+  event LogSig(bytes4 _sig);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/crowdsale/index.html b/coverage/crowdsale/index.html new file mode 100644 index 00000000..fd159306 --- /dev/null +++ b/coverage/crowdsale/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for crowdsale/ + + + + + + + +
+
+

+ all files crowdsale/ +

+
+
+ 93.46% + Statements + 100/107 +
+
+ 68.09% + Branches + 64/94 +
+
+ 88.89% + Functions + 32/36 +
+
+ 93.67% + Lines + 148/158 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
CrowdsaleERC20.sol
88.37%38/4366.67%24/3678.57%11/1488.14%52/59
CrowdsaleETH.sol
94.87%37/3961.76%21/3493.75%15/1694.74%54/57
CrowdsaleGeneratorERC20.sol
100%12/1275%9/12100%3/3100%21/21
CrowdsaleGeneratorETH.sol
100%13/1383.33%10/12100%3/3100%21/21
+
+
+ + + + + + + diff --git a/coverage/database/API.sol.html b/coverage/database/API.sol.html new file mode 100644 index 00000000..62fb1a53 --- /dev/null +++ b/coverage/database/API.sol.html @@ -0,0 +1,1139 @@ + + + + Code coverage report for database/API.sol + + + + + + + +
+
+

+ all files / database/ API.sol +

+
+
+ 36.76% + Statements + 25/68 +
+
+ 100% + Branches + 0/0 +
+
+ 37.84% + Functions + 14/37 +
+
+ 36.76% + Lines + 25/68 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +3× +  +  +  +  +  +  +1× +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+import "../math/SafeMath.sol";
+ 
+interface TokenView {
+  function totalSupply() external view returns (uint);
+  function balanceOf(address _investor) external view returns (uint);
+  function valuePerToken() external view returns (uint);
+  function scalingFactor() external view returns (uint);
+  function assetIncome() external view returns (uint);
+}
+ 
+interface DBView {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function stringStorage(bytes32 _key) external  view returns (string);
+  function addressStorage(bytes32 _key) external  view returns (address);
+  function bytesStorage(bytes32 _key) external view returns (bytes);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+  function boolStorage(bytes32 _key) external view returns (bool);
+  function intStorage(bytes32 _key) external view returns (bool);
+}
+ 
+// @title A contract that gets variables from the _database
+// @notice The API contract can only view the database. It has no write privileges
+contract API {
+  using SafeMath for uint256;
+ 
+  DBView private database;
+ 
+  constructor(address _database)
+  public {
+    database = DBView(_database);
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Governance + Function ID's
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  // @notice returns the amount of tokens unlocked and free to spend for _ser
+  function getNumTokensAvailable(bytes32 _assetID, address _investor)
+  public
+  view
+  returns (uint) {
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)));
+    address assetToken = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    uint balance = TokenView(assetToken).balanceOf(_investor);
+    return balance.sub(amountLocked);
+  }
+ 
+  function getInvestorVotes(bytes32 _executionID, address _investor)
+  public
+  view
+  returns (uint) {
+    return database.uintStorage(keccak256(abi.encodePacked("investorVotes", _executionID, _investor)));
+  }
+ 
+  function getTotalVotes(bytes32 _executionID)
+  public
+  view
+  returns (uint) {
+  return database.uintStorage(keccak256(abi.encodePacked("voteTotal", _executionID)));
+  }
+ 
+  function getCurrentConsensus(bytes32 _executionID, address _assetToken)
+  public
+  view
+  returns (uint) {
+    uint totalVotes = getTotalVotes(_executionID);
+    return (totalVotes * 100) / TokenView(_assetToken).totalSupply();
+  }
+ 
+  function getAssetManagerParameterHash(bytes32 _assetID, address _oldAssetManager, address _newAssetManager, uint _amount, bool _burn)
+  public
+  pure
+  returns (bytes32){
+    return keccak256(abi.encodePacked(_assetID, _oldAssetManager, _newAssetManager, _amount, _burn));
+  }
+ 
+  function getExecutionID(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+  }
+ 
+  function getMethodID(string _functionString)
+  public
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked(_functionString)));
+  }
+ 
+  function getAssetID(address _broker, string _assetURI, uint _amountToRaise, bytes32 _operatorID)
+  public
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_broker, _amountToRaise, _operatorID, _assetURI));
+  }
+ 
+  function getOrderID(bytes _assetID, address _investor, uint _amount, uint _price, bool _buyOrder)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_assetID, _investor, _amount, _price, _buyOrder));
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Crowdsale and Assets
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  function generateAssetID(address _broker, uint _amountToRaise, bytes32 _operatorID, string _assetURI)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 assetID = keccak256(abi.encodePacked(_broker, _amountToRaise, _operatorID, _assetURI));
+    return assetID;
+  }
+ 
+  function getAssetID(address _tokenAddress)
+  public
+  view
+  returns(bytes32) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", _tokenAddress)));
+    return assetID;
+  }
+ 
+  function getAssetAddress(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address assetAddress = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    return assetAddress;
+  }
+ 
+  function getAssetFundingToken(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address fundingTokenAddress = database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID)));
+    return fundingTokenAddress;
+  }
+ 
+  // IF we decide not to store assetIncome
+  // function getAssetIncome(bytes32 _assetID)
+  // public
+  // view
+  // returns (uint) {
+  //   TokenView asset = TokenView(getAssetAddress(_assetID));
+  //   uint valuePerToken =  asset.valuePerToken();
+  //   return (valuePerToken * (asset.totalSupply())) / asset.scalingFactor();
+  // }
+ 
+  function getAssetROI(bytes32 _assetID)
+  public
+  view
+  returns (uint) {
+    TokenView assetToken = TokenView(getAssetAddress(_assetID));
+    return (assetToken.assetIncome() * 100) /  assetToken.totalSupply();
+  }
+ 
+  function getAssetFundingGoal(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint fundingGoal = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+    return fundingGoal;
+  }
+ 
+  function getAssetFundingDeadline(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint fundingDeadline = database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+    return fundingDeadline;
+  }
+ 
+  function crowdsaleFinalized(bytes32 _assetID)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)));
+    return status;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Asset Manager and Operator
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function getAssetManager(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address managerAddress = database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID)));
+    return managerAddress;
+  }
+ 
+  function getAssetManagerFee(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint managerFee = database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID)));
+    return managerFee;
+  }
+ 
+  function getAssetManagerEscrowID(bytes32 _assetID, address _manager)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 managerEscrowID = keccak256(abi.encodePacked(_assetID, _manager));
+    return managerEscrowID;
+  }
+ 
+  function getAssetManagerEscrow(bytes32 _managerEscrowID)
+  public
+  view
+  returns (uint) {
+    return database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", _managerEscrowID)));
+  }
+ 
+  function getAssetManagerEscrowRemaining(bytes32 _managerEscrowID)
+  public
+  view
+  returns(uint) {
+    uint redeemed = getAssetManagerEscrowRedeemed(_managerEscrowID);
+    uint brokerEscrow = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", _managerEscrowID))).sub(redeemed);
+    return brokerEscrow;
+  }
+ 
+  function getAssetManagerEscrowRedeemed(bytes32 _managerEscrowID)
+  public
+  view
+  returns(uint) {
+    uint escrowRedeemed = database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", _managerEscrowID)));
+    return escrowRedeemed;
+  }
+ 
+  function getAssetOperator(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+    return operatorAddress;
+  }
+ 
+  function generateOperatorID(string _operatorURI)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 operatorID = keccak256(abi.encodePacked(_operatorURI));
+    return operatorID;
+  }
+ 
+  function getOperatorID(address _operatorAddress)
+  public
+  view
+  returns(bytes32) {
+    bytes32 operatorID = database.bytes32Storage(keccak256(abi.encodePacked("operator", _operatorAddress)));
+    return operatorID;
+  }
+ 
+  function getOperatorAddress(bytes32 _operatorID)
+  public
+  view
+  returns(address) {
+    address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID)));
+    return operatorAddress;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Stakeholders
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function generateOrderID(bytes32 _assetID, address _sender, uint _amount, uint _price, bool _buyOrder)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, _sender, _amount, _price, _buyOrder));
+    return orderID;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Platform and Contract State
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//Platform functions
+  function getPlatformToken()
+  public
+  view
+  returns(address) {
+    address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken")));
+    return tokenAddress;
+  }
+ 
+  function getPlatformWallet()
+  public
+  view
+  returns(address) {
+    address walletAddress = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+    return walletAddress;
+  }
+ 
+  function getContractAddress(string _contractName)
+  public
+  view
+  returns(address) {
+    address contractAddress = database.addressStorage(keccak256(abi.encodePacked("contract", _contractName)));
+    return contractAddress;
+  }
+ 
+  function getCurrentState()
+  public
+  view
+  returns(bytes32) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    return currentState;
+  }
+ 
+  function getUserPermission(address _investor)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked(getCurrentState(), _investor)));
+    return status;
+  }
+ 
+  function getFunctionCost(bytes4 _sig, address _contract)
+  public
+  view
+  returns(uint) {
+    uint cost = database.uintStorage(keccak256(abi.encodePacked(_sig, _contract)));
+    return cost;
+  }
+ 
+  function contractPaused(address _contract)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("paused", _contract)));
+    return status;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Ownership
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function contractOwner(address _account)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("owner", _account)));
+    return status;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/database/ContractManager.sol.html b/coverage/database/ContractManager.sol.html new file mode 100644 index 00000000..9e05f163 --- /dev/null +++ b/coverage/database/ContractManager.sol.html @@ -0,0 +1,431 @@ + + + + Code coverage report for database/ContractManager.sol + + + + + + + +
+
+

+ all files / database/ ContractManager.sol +

+
+
+ 95% + Statements + 19/20 +
+
+ 83.33% + Branches + 10/12 +
+
+ 88.89% + Functions + 8/9 +
+
+ 91.67% + Lines + 33/36 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +69× +68× +67× +67× +67× +67× +67× +67× +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +177× +177× +177× +177× +177× +  +  +  +  +  +  +  +  +  +72× +71× +  +  +  +  +  +  +  +  +  +  +  +4× +2× +  +  +  +147× +145× +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../interfaces/DBInterface.sol";
+ 
+// @title A contract manager that determines which contracts have write access to platform database
+// @notice This contract determines which contracts are allowed to make changes to the database contract.
+// @author Kyle Dewhurst, MyBit Foundation
+contract ContractManager{
+  DBInterface public database;
+ 
+  // @notice constructor: initializes database
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+  }
+ 
+  // @notice This function adds new contracts to the platform. Giving them write access to Database.sol
+  // @Param: The name of the contract
+  // @Param: The address of the new contract
+  function addContract(string _name, address _contractAddress)
+  external
+  isTrue(_contractAddress != address(0))
+  isTrue(bytes(_name).length != uint(0))
+  anyOwner {
+    require(!database.boolStorage(keccak256(abi.encodePacked("contract", _contractAddress))));
+    require(database.addressStorage(keccak256(abi.encodePacked("contract", _name))) == address(0));
+    database.setAddress(keccak256(abi.encodePacked("contract", _name)), _contractAddress);
+    database.setBool(keccak256(abi.encodePacked("contract", _contractAddress)), true);
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));      //Update currentState
+    bytes32 newState = keccak256(abi.encodePacked(currentState, _contractAddress));
+    database.setBytes32(keccak256(abi.encodePacked("currentState")), newState);
+    emit LogContractAdded(_contractAddress, _name, block.number);
+  }
+ 
+  // @notice Owner can remove an existing contract on the platform.
+  // @Param: The name of the contract
+  // @Param: The owner who authorized this function to be called
+  function removeContract(string _name)
+  external
+  isTrue(bytes(_name).length != uint(0))
+  contractExists(database.addressStorage(keccak256(abi.encodePacked("contract", _name))))
+  anyOwner {
+    address contractToDelete = database.addressStorage(keccak256(abi.encodePacked("contract", _name)));
+    database.deleteBool(keccak256(abi.encodePacked("contract", contractToDelete)));
+    database.deleteAddress(keccak256(abi.encodePacked("contract", _name)));
+    emit LogContractRemoved(contractToDelete, _name, block.number);
+  }
+ 
+  // @notice Owner can update an existing contract on the platform, giving it write access to Database
+  // @Param: The name of the contract (First Letter Capitalized)
+  // @Param: The address of the new contract
+  function updateContract(string _name, address _newContractAddress)
+  external
+  isTrue(_newContractAddress != 0)
+  contractExists(database.addressStorage(keccak256(abi.encodePacked("contract", _name))))
+  anyOwner {
+    address oldAddress = database.addressStorage(keccak256(abi.encodePacked("contract", _name)));
+    database.setAddress(keccak256(abi.encodePacked("contract", _name)), _newContractAddress);
+    database.setBool(keccak256(abi.encodePacked("contract", _newContractAddress)), true);
+    database.deleteBool(keccak256(abi.encodePacked("contract", oldAddress)));
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));      //Update currentState
+    bytes32 newState = keccak256(abi.encodePacked(currentState, _newContractAddress));
+    database.setBytes32(keccak256(abi.encodePacked("currentState")), newState);
+    emit LogContractUpdated(oldAddress, _name, block.number);
+    emit LogNewContractLocation(_newContractAddress, _name, block.number);
+  }
+ 
+  // @notice user can decide to accept or deny the current and future state of the platform contracts
+  // @notice if user accepts future upgrades they will automatically be able to interact with upgraded contracts
+  // @param (bool) _acceptCurrentState: does the user agree to use the current contracts in the platform
+  // @param (bool) _ignoreStateChanges: does the user agree to use the platform despite contract changes
+  function setContractStatePreferences(bool _acceptCurrentState, bool _ignoreStateChanges)
+  external
+  returns (bool) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    database.setBool(keccak256(abi.encodePacked(currentState, msg.sender)), _acceptCurrentState);
+    database.setBool(keccak256(abi.encodePacked("ignoreStateChanges", msg.sender)), _ignoreStateChanges);
+    emit LogContractStatePreferenceChanged(msg.sender, _acceptCurrentState, _ignoreStateChanges);
+    return true;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+  // @notice Verify that sender is an owner
+  modifier anyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+      require(database.boolStorage(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash))));  // owners must have agreed on function + parameters
+    _;
+      database.deleteBool(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+  modifier contractExists(address _contract) {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", _contract))));
+    _;
+  }
+ 
+  modifier isTrue(bool _conditional) {
+    require(_conditional);
+    _;
+  }
+ 
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                    Events
+  // ------------------------------------------------------------------------------------------------
+  event LogContractAdded(address _contractAddress, string _name, uint _blockNumber);
+  event LogContractRemoved(address contractToDelete, string _name, uint _blockNumber);
+  event LogContractUpdated(address oldAddress, string _name, uint _blockNumber);
+  event LogNewContractLocation(address _contractAddress, string _name, uint _blockNumber);
+  event LogContractStatePreferenceChanged(address indexed _user, bool _currentStateAcceptance, bool _ignoreStateChanges);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/database/Database.sol.html b/coverage/database/Database.sol.html new file mode 100644 index 00000000..32be4532 --- /dev/null +++ b/coverage/database/Database.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for database/Database.sol + + + + + + + +
+
+

+ all files / database/ Database.sol +

+
+
+ 100% + Statements + 19/19 +
+
+ 100% + Branches + 12/12 +
+
+ 100% + Functions + 17/17 +
+
+ 100% + Lines + 27/27 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +17× +17× +  +16× +15× +  +  +  +  +  +  +  +  +19× +18× +17× +16× +15× +15× +  +  +  +  +  +  +142× +  +  +  +  +  +67× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +87× +  +  +  +  +  +445× +  +  +  +  +  +1× +  +  +  +  +  +  +  +7× +  +  +  +  +  +23× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +7× +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +786× +785× +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+// @title A shared storage contract for platform contracts to store and retrieve data
+// @notice This contract holds all long-term data for smart-contract systems
+// @dev The bytes32 hashes are derived from keccak256(variableName, uniqueID) => value
+// @dec Can enable upgradeable contracts by setting a contract manager
+contract Database{
+ 
+    // Storage Variables
+    mapping(bytes32 => uint) public uintStorage;
+    mapping(bytes32 => string) public stringStorage;
+    mapping(bytes32 => address) public addressStorage;
+    mapping(bytes32 => bytes) public bytesStorage;
+    mapping(bytes32 => bytes32) public bytes32Storage;
+    mapping(bytes32 => bool) public boolStorage;
+    mapping(bytes32 => int) public intStorage;
+ 
+ 
+ 
+    // @notice Constructor: Sets the owners of the platform
+    // @dev Owners must set the contract manager to add more contracts
+    constructor(address[] _owners, bool _upgradeable) public {
+      for(uint i=0; i<_owners.length; i++){
+        boolStorage[keccak256(abi.encodePacked("owner", _owners[i]))] = true;
+        emit LogInitialized(_owners[i], _upgradeable);
+      }
+      if (_upgradeable){
+        boolStorage[keccak256("upgradeable")] = true;
+      }
+    }
+ 
+ 
+    // @notice ContractManager will be the only contract that can add/remove contracts on the platform.
+    // @param (address) _contractManager is the contract which can upgrade/remove contracts to platform
+    function enableContractManagement(address _contractManager)
+    external {
+        require(boolStorage[keccak256("upgradeable")]);
+        require(_contractManager != address(0));
+        require(boolStorage[keccak256(abi.encodePacked("owner", msg.sender))]);
+        require(addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] == address(0));
+        addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] = _contractManager;
+        boolStorage[keccak256(abi.encodePacked("contract", _contractManager))] = true;
+    }
+ 
+    // @notice Storage functions
+    function setAddress(bytes32 _key, address _value)
+    onlyApprovedContract
+    external {
+        addressStorage[_key] = _value;
+    }
+ 
+    function setUint(bytes32 _key, uint _value)
+    onlyApprovedContract
+    external {
+        uintStorage[_key] = _value;
+    }
+ 
+    function setString(bytes32 _key, string _value)
+    onlyApprovedContract
+    external {
+        stringStorage[_key] = _value;
+    }
+ 
+    function setBytes(bytes32 _key, bytes _value)
+    onlyApprovedContract
+    external {
+        bytesStorage[_key] = _value;
+    }
+ 
+    function setBytes32(bytes32 _key, bytes32 _value)
+    onlyApprovedContract
+    external {
+        bytes32Storage[_key] = _value;
+    }
+ 
+    function setBool(bytes32 _key, bool _value)
+    onlyApprovedContract
+    external {
+        boolStorage[_key] = _value;
+    }
+ 
+    function setInt(bytes32 _key, int _value)
+    onlyApprovedContract
+    external {
+        intStorage[_key] = _value;
+    }
+ 
+ 
+    // Deletion functions: Can alternatively use setter functions and set to null value (ie. uint = 0)
+    function deleteAddress(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete addressStorage[_key];
+    }
+ 
+    function deleteUint(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete uintStorage[_key];
+    }
+ 
+    function deleteString(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete stringStorage[_key];
+    }
+ 
+    function deleteBytes(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete bytesStorage[_key];
+    }
+ 
+    function deleteBytes32(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete bytes32Storage[_key];
+    }
+ 
+    function deleteBool(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete boolStorage[_key];
+    }
+ 
+    function deleteInt(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete intStorage[_key];
+    }
+ 
+ 
+    // --------------------------------------------------------------------------------------
+    //                                     Modifiers
+    // --------------------------------------------------------------------------------------
+ 
+    // Caller must be registered as a contract through ContractManager.sol
+    modifier onlyApprovedContract() {
+        require(boolStorage[keccak256(abi.encodePacked("contract", msg.sender))]);
+        _;
+    }
+ 
+    // --------------------------------------------------------------------------------------
+    //                                     Events
+    // --------------------------------------------------------------------------------------
+    event LogInitialized(address _owner, bool _upgradeable);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/database/Events.sol.html b/coverage/database/Events.sol.html new file mode 100644 index 00000000..dc7493a1 --- /dev/null +++ b/coverage/database/Events.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for database/Events.sol + + + + + + + +
+
+

+ all files / database/ Events.sol +

+
+
+ 0% + Statements + 0/2 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './Database.sol';
+ 
+contract Events {
+  Database public database;
+  // @dev This will emit the event from the Event contract
+  function numberStored(address _sender, uint _number)
+  external
+  onlyApprovedContract {
+      emit LogFavoriteNumberAdded(_sender, _number);
+  }
+ 
+  event LogFavoriteNumberAdded(address indexed _sender, uint _number);
+ 
+ 
+  // --------------------------------------------------------------------------------------
+  // Caller must be registered as a contract through ContractManager.sol
+  // --------------------------------------------------------------------------------------
+  modifier onlyApprovedContract() {
+      require(database.boolStorage(keccak256(abi.encodePacked("contract", msg.sender))));
+      _;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/database/HashEncode.sol.html b/coverage/database/HashEncode.sol.html new file mode 100644 index 00000000..9c37ca61 --- /dev/null +++ b/coverage/database/HashEncode.sol.html @@ -0,0 +1,131 @@ + + + + Code coverage report for database/HashEncode.sol + + + + + + + +
+
+

+ all files / database/ HashEncode.sol +

+
+
+ 0% + Statements + 0/6 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/6 +
+
+ 0% + Lines + 0/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+library HashEncode {
+  //Overloaded functions
+  function encode(string _label, bytes32 _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, bytes32 _arg1, bytes32 _arg2) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1, _arg2));
+  }
+  function encode(string _label, bytes32 _arg1, uint _arg2) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1, _arg2));
+  }
+  function encode(string _label, address _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, uint _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, bool _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/database/index.html b/coverage/database/index.html new file mode 100644 index 00000000..85354c66 --- /dev/null +++ b/coverage/database/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for database/ + + + + + + + +
+
+

+ all files database/ +

+
+
+ 54.78% + Statements + 63/115 +
+
+ 84.62% + Branches + 22/26 +
+
+ 54.93% + Functions + 39/71 +
+
+ 60.71% + Lines + 85/140 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
API.sol
36.76%25/68100%0/037.84%14/3736.76%25/68
ContractManager.sol
95%19/2083.33%10/1288.89%8/991.67%33/36
Database.sol
100%19/19100%12/12100%17/17100%27/27
Events.sol
0%0/20%0/20%0/20%0/3
HashEncode.sol
0%0/6100%0/00%0/60%0/6
+
+
+ + + + + + + diff --git a/coverage/ecosystem/AssetExchange.sol.html b/coverage/ecosystem/AssetExchange.sol.html new file mode 100644 index 00000000..b0a1c56e --- /dev/null +++ b/coverage/ecosystem/AssetExchange.sol.html @@ -0,0 +1,791 @@ + + + + Code coverage report for ecosystem/AssetExchange.sol + + + + + + + +
+
+

+ all files / ecosystem/ AssetExchange.sol +

+
+
+ 100% + Statements + 55/55 +
+
+ 92.5% + Branches + 37/40 +
+
+ 100% + Functions + 15/15 +
+
+ 100% + Lines + 66/66 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +3× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +3× +3× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +2× +1× +1× +1× +  +2× +2× +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +3× +2× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +10× +9× +8× +  +  +  +  +  +  +10× +9× +  +  +  +  +  +  +11× +10× +  +  +  +  +  +8× +8× +  +  +  +  +  +  +8× +7× +  +  +  +  +  +  +7× +6× +  +  +  +  +  +  +4× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/DivToken.sol';
+import "../access/ERC20Burner.sol";
+ 
+ 
+// @title Simple decentralized exchange contract
+// @notice A sample contract to implement rudimentary asset-token trading
+// @dev Note: Users can only have 1 sell order and 1 buy order for each individual asset
+// @dev The orders are stored as as sha3 hash of critical parameters to save storage costs
+contract AssetExchange {
+  using SafeMath for uint;
+ 
+  Database public database;
+  ERC20Burner private burner;
+ 
+  mapping (address => mapping (bytes32 => bool)) public orders;  // Hash of (assetID, sellerAddress, amountToBuy, price, boolean(BuyOrder = true))
+ 
+  mapping (address => uint) public weiDeposited;
+  mapping (address => uint) public weiOwed;
+  uint private decimals = uint256(1e18);
+ 
+ 
+  // @notice constructor: initializes database
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = Database(_database);
+    burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // Gives Ether sent to initatior of this sellOrder and transfers ownership units of asset to purchaser
+  // Note: Check if creator of sell order has enough ownership units left
+  // @Param: ID of the asset, which these ownershipUnits belong to
+  // @Param: Address of the user who created SellOrder
+  // @Param: Number of ownershipUnits being traded
+  // @Param: The WEI cost per unit
+  function buyAsset(bytes32 _assetID, address _seller, uint _amount, uint _price)
+  external
+  payable
+  whenNotPaused
+  isAllowed(_assetID, _seller, _amount)
+  burnRequired
+  returns (bool){
+    bytes32 thisOrder = keccak256(abi.encodePacked(_assetID, _seller, _amount, _price, false));
+    require(orders[_seller][thisOrder]);
+    require(msg.value == _amount.mul(_price).div(decimals));
+    DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    Erequire(assetToken.transferFrom(_seller, msg.sender, _amount));
+    weiOwed[_seller] = weiOwed[_seller].add(msg.value);
+    delete orders[_seller][thisOrder];
+    emit LogSellOrderCompleted(thisOrder, _assetID, msg.sender);
+    return true;
+  }
+ 
+  // Settles an open SellOrder, giving the deposited ether to sender and sender tokens to initiator of BuyOrder
+  // @Param: ID of the asset, which senders ownershipUnits belong to
+  // @Param: Address of the user who created BuyOrder
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  function sellAsset(bytes32 _assetID, address _buyer, uint _amount, uint _price)
+  public
+  whenNotPaused
+  isAllowed(_assetID, msg.sender, _amount)
+  returns (bool){
+    bytes32 thisOrder = keccak256(abi.encodePacked(_assetID, _buyer, _amount, _price, true));       // Get order ID
+    require(orders[_buyer][thisOrder]);    // Check order exists
+    uint value = _amount.mul(_price).div(decimals);
+    DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    Erequire(assetToken.transferFrom(msg.sender, _buyer, _amount));
+    weiDeposited[_buyer] = weiDeposited[_buyer].sub(value);
+    weiOwed[msg.sender] = weiOwed[msg.sender].add(value);
+    delete orders[_buyer][thisOrder];
+    emit LogBuyOrderCompleted(thisOrder, _assetID, msg.sender);
+    return true;
+  }
+ 
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset, which the sender wants to purchase ownershipUnits of
+  // @Param: Number of ownershipUnits being bought
+  // @Param: The WEI cost per unit
+  function createBuyOrder(bytes32 _assetID, uint _amount, uint _price)
+  external
+  payable
+  requiresEther
+  aboveZero(_amount, _price)
+  validAsset(_assetID)
+  burnRequired
+  returns (bool) {
+    require(msg.value == _amount.mul(_price).div(decimals));
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, true));
+    require(!orders[msg.sender][orderID]);
+    orders[msg.sender][orderID] = true;
+    weiDeposited[msg.sender] = weiDeposited[msg.sender].add(msg.value);
+    emit LogBuyOrderCreated(orderID, _assetID, msg.sender);
+    emit LogBuyOrderDetails(orderID, _amount, _price);
+    return true;
+  }
+ 
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset, which sender is trying to sell
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  function createSellOrder(bytes32 _assetID, uint _amount, uint _price)
+  external
+  aboveZero(_amount, _price)
+  validAsset(_assetID)
+  isAllowed(_assetID, msg.sender, _amount)
+  returns (bool) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, false));
+    require(!orders[msg.sender][orderID]);
+    orders[msg.sender][orderID] = true;
+    emit LogSellOrderCreated(orderID, _assetID, msg.sender);
+    emit LogSellOrderDetails(orderID, _amount, _price);
+    return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  // @Param: Is this order a BuyOrder?
+  //------------------------------------------------------------------------------------------------------------------
+  function deleteOrder(bytes32 _assetID, uint _amount, uint _price, bool _buyOrder)
+  external
+  returns (bool) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, _buyOrder));
+    require(orders[msg.sender][orderID]);
+    if (_buyOrder) {
+      uint returnValue = _amount.mul(_price).div(decimals);
+      weiDeposited[msg.sender] = weiDeposited[msg.sender].sub(returnValue);
+      weiOwed[msg.sender] = weiOwed[msg.sender].add(returnValue);
+    }
+    delete orders[msg.sender][orderID];
+    return true;
+  }
+  //------------------------------------------------------------------------------------------------------------------
+  // User can withdraw the wei they are owed here
+  //------------------------------------------------------------------------------------------------------------------
+  function withdraw()
+  external
+  whenNotPaused
+  returns (bool){
+    uint owed = weiOwed[msg.sender];
+    weiOwed[msg.sender] = 0;
+    msg.sender.transfer(owed);
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // @notice Destroys contract and sends WEI to _holdingAddress
+  //------------------------------------------------------------------------------------------------------------------
+  function destroy(address _functionInitiator, address _holdingAddress)
+  anyOwner
+  public {
+    require(_functionInitiator != msg.sender);
+    require(database.boolStorage(keccak256(abi.encodePacked(address(this), _functionInitiator, "destroy", keccak256(abi.encodePacked(_holdingAddress))))));
+    emit LogDestruction(_holdingAddress, address(this).balance, msg.sender);
+    selfdestruct(_holdingAddress);
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                      Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // This verifies that the asset is registered on the MyBit Platform and has successfully completed funding
+  //------------------------------------------------------------------------------------------------------------------
+  modifier validAsset(bytes32 _assetID) {
+    require (_assetID != bytes32(0));
+    require (database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Check if user has enough ownershipUnits to create SellOrder
+  //------------------------------------------------------------------------------------------------------------------
+  modifier isAllowed(bytes32 _assetID, address _sender, uint _tokens) {
+    require(DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)))).allowance(_sender, address(this)) >= _tokens);
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verifies that _amount or _price aren't null
+  //------------------------------------------------------------------------------------------------------------------
+  modifier aboveZero(uint _amount, uint _price) {
+    require(_amount.mul(_price) > 0);
+    _;
+  }
+ 
+  // @notice reverts if user hasn't approved burner to burn platform token
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verify contract isn't paused
+  //------------------------------------------------------------------------------------------------------------------
+  modifier whenNotPaused {
+    require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Throw if Ether hasn't been sent
+  //------------------------------------------------------------------------------------------------------------------
+  modifier requiresEther() {
+    require(msg.value > 0);
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verify that the sender is a registered owner
+  //------------------------------------------------------------------------------------------------------------------
+  modifier anyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                      Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  event LogDestruction(address indexed _locationSent, uint indexed _amountSent, address indexed _caller);
+  event LogBuyOrderCreated(bytes32 _orderID, bytes32 indexed _assetID, address indexed _creator);
+  event LogBuyOrderCompleted(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _purchaser);
+  event LogSellOrderCreated(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _creator);
+  event LogSellOrderCompleted(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _purchaser);
+  event LogBuyOrderDetails(bytes32 _orderID, uint indexed _amount, uint indexed _price);
+  event LogSellOrderDetails(bytes32 orderID, uint indexed _amount, uint indexed _price);
+  event LogownershipUnitsTraded(bytes32 _assetID, address _from, address _to, uint _amount);
+  event LogSig(bytes4 _sig);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ecosystem/AssetGenerator.sol.html b/coverage/ecosystem/AssetGenerator.sol.html new file mode 100644 index 00000000..251a7c2d --- /dev/null +++ b/coverage/ecosystem/AssetGenerator.sol.html @@ -0,0 +1,290 @@ + + + + Code coverage report for ecosystem/AssetGenerator.sol + + + + + + + +
+
+

+ all files / ecosystem/ AssetGenerator.sol +

+
+
+ 100% + Statements + 17/17 +
+
+ 70% + Branches + 7/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 24/24 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +2× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +2× +1× +1× +1× +1× +1× +4× +  +1× +1× +1× +1× +1× +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendToken.sol";
+import "../tokens/distribution/FixedDistribution.sol";
+ 
+// @title An asset generator contract for onboarding existing real-world assets
+// @author Kyle Dewhurst, MyBit Foundation
+contract AssetGenerator {
+  using SafeMath for uint256;
+ 
+  DBInterface private database;
+ 
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+  }
+ 
+ 
+  // @notice users can on-board non-tradeable assets here
+  // @dev creates an ERC20 dividend token (tradeable) or distribution token (not-tradeable)
+  function createAsset(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  external
+  burnRequired
+  returns (bool) {
+    require (_tokenHolders.length == _amount.length && _tokenHolders.length <= 200);
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _tokenURI));
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", assetID))) == address(0));
+    FixedDistribution assetInstance = new FixedDistribution(_tokenURI, _tokenHolders, _amount);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), address(assetInstance));
+    emit LogAssetCreated(assetID, address(assetInstance), msg.sender, _tokenURI);
+    return true;
+  }
+ 
+  // @notice users can on-board tradeable assets here
+  // @dev creates an ERC20 dividend token (tradeable) or
+  function createTradeableAsset(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  external
+  burnRequired
+  returns (bool) {
+    require (_tokenHolders.length == _amount.length && _tokenHolders.length <= uint8(200));
+    address assetGeneratorAddress = database.addressStorage(keccak256(abi.encodePacked("contract", "AssetGenerator")));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _tokenURI));
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", assetID))) == address(0));
+    DividendToken assetInstance = new DividendToken(_tokenURI, assetGeneratorAddress);   // Gives this contract all new asset tokens
+    for (uint8 i = 0; i < _tokenHolders.length; i++) {
+      assetInstance.mint(_tokenHolders[i], _amount[i]);
+    }
+    assetInstance.finishMinting();
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), address(assetInstance));
+    emit LogTradeableAssetCreated(assetID, address(assetInstance), msg.sender, _tokenURI);
+    return true;
+  }
+ 
+ 
+  // @notice reverts if user hasn't approved burner to burn platform token
+  modifier burnRequired {
+    ERC20Burner burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+ 
+  event LogAssetCreated(bytes32 indexed _assetID, address indexed _tokenAddress, address indexed _assetManager, string _tokenURI);
+  event LogTradeableAssetCreated(bytes32 indexed _assetID, address indexed _tokenAddress, address indexed _assetManager, string _tokenURI);
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ecosystem/PlatformFunds.sol.html b/coverage/ecosystem/PlatformFunds.sol.html new file mode 100644 index 00000000..a88d9b0e --- /dev/null +++ b/coverage/ecosystem/PlatformFunds.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for ecosystem/PlatformFunds.sol + + + + + + + +
+
+

+ all files / ecosystem/ PlatformFunds.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +9× +  +  +  +  +  +  +  +7× +7× +  +  +  +  +  +  +9× +9× +  +  +  +  +  +  +  +  +18× +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+contract PlatformFunds {
+ 
+  Database public database;
+ 
+  // @notice initialize database
+  constructor(address _database)
+  public {
+    database = Database(_database);
+  }
+ 
+  // @notice owners must set the wallet to receive payments here before initiating crowdsale
+  // @dev will overwrite old wallet address
+  function setPlatformWallet(address _walletAddress)
+  external
+  onlyOwner {
+    database.setAddress(keccak256(abi.encodePacked("platformWallet")), _walletAddress);
+    emit LogPlatformWallet(_walletAddress);
+  }
+ 
+  // @notice
+  function setPlatformToken(address _tokenAddress)
+  external
+  onlyOwner {
+    database.setAddress(keccak256(abi.encodePacked("platformToken")), _tokenAddress);
+    emit LogPlatformToken(_tokenAddress);
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Modifiers                                                                     //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Events                                                                        //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  event LogPlatformWallet(address _platformWallet);
+  event LogPlatformToken(address _platformToken);
+ 
+ 
+ 
+ 
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ecosystem/Staking.sol.html b/coverage/ecosystem/Staking.sol.html new file mode 100644 index 00000000..61ac1253 --- /dev/null +++ b/coverage/ecosystem/Staking.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for ecosystem/Staking.sol + + + + + + + +
+
+

+ all files / ecosystem/ Staking.sol +

+
+
+ 0% + Statements + 0/14 +
+
+ 0% + Branches + 0/10 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/18 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
  pragma solidity 0.4.24;
+ 
+  import "../math/SafeMath.sol";
+  import "../database/Database.sol";
+  import "../interfaces/ERC20.sol";
+  import "../tokens/distribution/MintableDistribution.sol";
+ 
+ 
+ 
+  // @title A contract for investors to loan ERC20 tokens to assetManagers who require escrow
+  // @author Kyle Dewhurst, MyBit Foundation
+  // @notice AssetManager can lock his escrow in this contract and retrieve it if asset funding fails or successfully returns ROI
+  contract Staking {
+ 
+    Database public database;
+ 
+ 
+    constructor(address _database)
+    public {
+      database = Database(_database);
+    }
+ 
+    // @notice AssetManager can request for a staker to lend tokens to cover escrow
+    function requestStaking(string _tokenURI, bytes32 _assetID, uint _amount, uint _sharePercentage)
+    external
+    returns (bool) {
+      bytes32 agreementHash = keccak256(abi.encodePacked(msg.sender, _assetID, _amount, _sharePercentage));
+      database.setBytes32(_assetID, agreementHash);
+      MintableDistribution mintableDistribution = new MintableDistribution(_tokenURI, address(this));
+      database.setAddress(keccak256(abi.encodePacked("stakingMint", _assetID)), address(mintableDistribution));
+      return true;
+    }
+ 
+    // @notice staker can purchase all of
+    function purchaseStake(bytes32 _assetID, address _requester, uint _amount, uint _sharePercentage)
+    external
+    returns (bool) {
+      bytes32 agreementHash = keccak256(abi.encodePacked(_requester, _assetID, _amount, _sharePercentage));
+      require (database.bytes32Storage(_assetID) == agreementHash);
+      ERC20 stakingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      MintableDistribution distributionToken = MintableDistribution(database.addressStorage(keccak256(abi.encodePacked("stakingMint", _assetID))));
+      bytes32 finalAgreement = keccak256(abi.encodePacked(msg.sender, agreementHash));
+      database.setBytes32(_assetID, finalAgreement);
+      require(stakingToken.transfer(_requester, _amount));
+      require(distributionToken.mint(msg.sender, _amount));
+      require(distributionToken.finishMinting());
+      return true;
+    }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Don't accept null value for bytes32 parameter
+  //------------------------------------------------------------------------------------------------------------------
+  modifier noEmptyBytes(bytes32 _data) {
+    require(_data != bytes32(0));
+    _;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ecosystem/index.html b/coverage/ecosystem/index.html new file mode 100644 index 00000000..cde3c292 --- /dev/null +++ b/coverage/ecosystem/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for ecosystem/ + + + + + + + +
+
+

+ all files ecosystem/ +

+
+
+ 84.44% + Statements + 76/90 +
+
+ 74.19% + Branches + 46/62 +
+
+ 85.19% + Functions + 23/27 +
+
+ 84.35% + Lines + 97/115 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetExchange.sol
100%55/5592.5%37/40100%15/15100%66/66
AssetGenerator.sol
100%17/1770%7/10100%4/4100%24/24
PlatformFunds.sol
100%4/4100%2/2100%4/4100%7/7
Staking.sol
0%0/140%0/100%0/40%0/18
+
+
+ + + + + + + diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 00000000..ac7c2a6f --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,223 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 75.06% + Statements + 596/794 +
+
+ 66.24% + Branches + 257/388 +
+
+ 72.56% + Functions + 230/317 +
+
+ 75.92% + Lines + 744/980 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
access/
100%34/3483.33%20/24100%21/21100%47/47
crowdsale/
93.46%100/10768.09%64/9488.89%32/3693.67%148/158
database/
54.78%63/11584.62%22/2654.93%39/7160.71%85/140
ecosystem/
84.44%76/9074.19%46/6285.19%23/2784.35%97/115
interfaces/
100%0/0100%0/0100%0/0100%0/0
math/
100%12/12100%8/8100%5/5100%12/12
ownership/
32.47%25/7737.5%9/2441.38%12/2932.71%35/107
roles/
73.64%81/11044.57%41/9290.48%19/2177.1%101/131
test/
48.84%21/43100%4/445.71%16/3546.67%21/45
tokens/distribution/
82.22%37/4575%6/883.33%15/1882%41/50
tokens/erc20/
91.3%147/16180.43%37/4688.89%48/5489.71%157/175
+
+
+ + + + + + + diff --git a/coverage/interfaces/ApproveAndCallFallback.sol.html b/coverage/interfaces/ApproveAndCallFallback.sol.html new file mode 100644 index 00000000..d10f049f --- /dev/null +++ b/coverage/interfaces/ApproveAndCallFallback.sol.html @@ -0,0 +1,83 @@ + + + + Code coverage report for interfaces/ApproveAndCallFallback.sol + + + + + + + +
+
+

+ all files / interfaces/ ApproveAndCallFallback.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @notice Receive approval and then execute function
+interface ApproveAndCallFallBack {
+    function receiveApproval(address from, uint tokens, address token, bytes data) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/BurnERC20.sol.html b/coverage/interfaces/BurnERC20.sol.html new file mode 100644 index 00000000..537d6688 --- /dev/null +++ b/coverage/interfaces/BurnERC20.sol.html @@ -0,0 +1,101 @@ + + + + Code coverage report for interfaces/BurnERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ BurnERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+interface BurnERC20 {
+ 
+    function burnFrom(address _tokenHolder, uint _amount) external returns (bool success);
+ 
+    function burn(uint _amount) external returns (bool success);
+ 
+    event LogBurn(address indexed _spender, uint256 _value);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/BurnableERC20.sol.html b/coverage/interfaces/BurnableERC20.sol.html new file mode 100644 index 00000000..d13bd461 --- /dev/null +++ b/coverage/interfaces/BurnableERC20.sol.html @@ -0,0 +1,146 @@ + + + + Code coverage report for interfaces/BurnableERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ BurnableERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @title An interface to interact with Burnable ERC20 tokens 
+interface BurnableERC20 { 
+ 
+  function allowance(address tokenOwner, address spender) external view returns (uint remaining);
+  
+  function burnFrom(address _tokenHolder, uint _amount) external returns (bool success); 
+ 
+  function burn(uint _amount) external returns (bool success); 
+  
+  function totalSupply() external view returns (uint256);
+ 
+  function balanceOf(address _who) external view returns (uint256);
+ 
+  function transfer(address _to, uint256 _value) external returns (bool);
+ 
+  function approve(address _spender, uint256 _value) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
+ 
+  event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+  event Approval(address indexed owner, address indexed spender, uint256 value);
+ 
+  event LogBurn(address indexed _spender, uint256 _value); 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/DBInterface.sol.html b/coverage/interfaces/DBInterface.sol.html new file mode 100644 index 00000000..1a0822fd --- /dev/null +++ b/coverage/interfaces/DBInterface.sol.html @@ -0,0 +1,341 @@ + + + + Code coverage report for interfaces/DBInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ DBInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// Database interface
+interface DBInterface {
+ 
+  function setContractManager(address _contractManager)
+  external;
+ 
+    // --------------------Set Functions------------------------
+ 
+    function setAddress(bytes32 _key, address _value)
+    external;
+ 
+    function setUint(bytes32 _key, uint _value)
+    external;
+ 
+    function setString(bytes32 _key, string _value)
+    external;
+ 
+    function setBytes(bytes32 _key, bytes _value)
+    external;
+ 
+    function setBytes32(bytes32 _key, bytes32 _value)
+    external;
+ 
+    function setBool(bytes32 _key, bool _value)
+    external;
+ 
+    function setInt(bytes32 _key, int _value)
+    external;
+ 
+ 
+     // -------------- Deletion Functions ------------------
+ 
+    function deleteAddress(bytes32 _key)
+    external;
+ 
+    function deleteUint(bytes32 _key)
+    external;
+ 
+    function deleteString(bytes32 _key)
+    external;
+ 
+    function deleteBytes(bytes32 _key)
+    external;
+ 
+    function deleteBytes32(bytes32 _key)
+    external;
+ 
+    function deleteBool(bytes32 _key)
+    external;
+ 
+    function deleteInt(bytes32 _key)
+    external;
+ 
+    // ----------------Variable Getters---------------------
+ 
+    function uintStorage(bytes32 _key)
+    external
+    view
+    returns (uint);
+ 
+    function stringStorage(bytes32 _key)
+    external
+    view
+    returns (string);
+ 
+    function addressStorage(bytes32 _key)
+    external
+    view
+    returns (address);
+ 
+    function bytesStorage(bytes32 _key)
+    external
+    view
+    returns (bytes);
+ 
+    function bytes32Storage(bytes32 _key)
+    external
+    view
+    returns (bytes32);
+ 
+    function boolStorage(bytes32 _key)
+    external
+    view
+    returns (bool);
+ 
+    function intStorage(bytes32 _key)
+    external
+    view
+    returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/DivToken.sol.html b/coverage/interfaces/DivToken.sol.html new file mode 100644 index 00000000..70310733 --- /dev/null +++ b/coverage/interfaces/DivToken.sol.html @@ -0,0 +1,401 @@ + + + + Code coverage report for interfaces/DivToken.sol + + + + + + + +
+
+

+ all files / interfaces/ DivToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners receive their share when transferring tokens.
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+// TODO: Suicide function
+interface DivToken {
+ 
+    // @notice Transfer _amount tokens to address _to.
+    // @dev Sender must have enough tokens. Cannot send to 0x0.
+    // @param (address) _to = The address which will receive the tokens
+    // @param (uint) _amount = The amount of tokens to send
+    function transfer(address _to, uint _amount)
+    external
+    returns (bool success);
+ 
+    // @notice A 3rd party can transfer tokens if user approves them to do so
+    // @dev Transfer _amount of tokens if _from has allowed msg.sender to do so.
+    // @param (address) _from = The address who approved msg.sender to spend tokens
+    // @param (address) _to = The address who will receive the tokens
+    // @param (uint) _amount = The number of tokens to send
+    function transferFrom(address _from, address _to, uint _amount)
+    external
+    returns (bool success);
+ 
+    // @notice approves a 3rd party to transfer msg.sender's tokens on behalf of him/her
+    // @param (address) _spender = The address of who msg.sender approves to spend tokens on their behalf
+    // @param (uint) _amount = The upper limit of how many tokens can be spent
+    function approve(address _spender, uint _amount)
+    external
+    returns (bool success);
+ 
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    external
+    returns (bool success);
+ 
+    function withdraw()
+    external
+    returns (bool);
+ 
+    // @notice Updates incomeClaimed, sends all wei to the token holder
+    function collectOwedDividends()
+    external
+    returns (uint _amount);
+ 
+ 
+    // @notice Returns amount of tokens _spender is allowed to transfer or burn
+    function allowance(address _tokenHolder, address _spender)
+    external
+    view
+    returns (uint);
+ 
+    // @notice Returns the number of tokens in circulation
+    function totalSupply()
+    external
+    view
+    returns (uint tokenSupply);
+ 
+    // @notice Returns the token balance of user
+    function balanceOf(address _tokenHolder)
+    external
+    view
+    returns (uint balance);
+ 
+    // @notice Returns the URI of this token
+    function tokenURI()
+    external
+    view
+    returns (string);
+ 
+    function valuePerToken()
+    external
+    view
+    returns (uint);
+ 
+    function scalingFactor()
+    external
+    view
+    returns (uint);
+ 
+    // @notice Calculates how much value _user holds
+    function getAmountOwed(address _user)
+    external
+    view
+    returns (uint);
+ 
+    // @notice Calculates how much wei user is owed. (points + incomeClaimed) / 10**32
+    function getOwedDividends(address _user)
+    external
+    constant
+    returns (uint);
+ 
+    function assetIncome()
+    external
+    view
+    returns (uint);
+ 
+    function getERC20()
+    external
+    view
+    returns (address);
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogIncomeCollected(uint _block, address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/ERC20.sol.html b/coverage/interfaces/ERC20.sol.html new file mode 100644 index 00000000..fc66e280 --- /dev/null +++ b/coverage/interfaces/ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for interfaces/ERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+/**
+ * @title ERC20 interface
+ * @dev see https://github.com/ethereum/EIPs/issues/20
+ */
+interface ERC20 {
+  function totalSupply() external view returns (uint256);
+ 
+  function balanceOf(address _who) external view returns (uint256);
+ 
+  function allowance(address _owner, address _spender) external view returns (uint256);
+ 
+  function transfer(address _to, uint256 _value) external returns (bool);
+ 
+  function approve(address _spender, uint256 _value) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
+ 
+  event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+  event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/ERC20DividendInterface.sol.html b/coverage/interfaces/ERC20DividendInterface.sol.html new file mode 100644 index 00000000..904464fa --- /dev/null +++ b/coverage/interfaces/ERC20DividendInterface.sol.html @@ -0,0 +1,113 @@ + + + + Code coverage report for interfaces/ERC20DividendInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ ERC20DividendInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface ERC20DividendInterface{
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount) external returns (bool);
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting() external returns (bool);
+ 
+  function issueDividends(uint _amount) external;
+ 
+  // @dev Total number of tokens in existence
+  function totalSupply() external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/EtherDividendInterface.sol.html b/coverage/interfaces/EtherDividendInterface.sol.html new file mode 100644 index 00000000..864c70e6 --- /dev/null +++ b/coverage/interfaces/EtherDividendInterface.sol.html @@ -0,0 +1,113 @@ + + + + Code coverage report for interfaces/EtherDividendInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ EtherDividendInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface EtherDividendInterface{
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount) external returns (bool);
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting() external returns (bool);
+ 
+  function issueDividends() external payable;
+ 
+  // @dev Total number of tokens in existence
+  function totalSupply() external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/GovToken.sol.html b/coverage/interfaces/GovToken.sol.html new file mode 100644 index 00000000..f5162422 --- /dev/null +++ b/coverage/interfaces/GovToken.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for interfaces/GovToken.sol + + + + + + + +
+
+

+ all files / interfaces/ GovToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+interface GovToken {
+ 
+  function totalSupply() external returns (uint);
+ 
+  function balanceOf(address _user) external returns (uint);
+ 
+  function unlockTokens() external returns (bool);
+ 
+  function lockTokens() external returns (bool); 
+ 
+  function transfer(address _to, uint _amount) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint _amount) external returns (bool);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/PullPayment.sol.html b/coverage/interfaces/PullPayment.sol.html new file mode 100644 index 00000000..fb41a14a --- /dev/null +++ b/coverage/interfaces/PullPayment.sol.html @@ -0,0 +1,89 @@ + + + + Code coverage report for interfaces/PullPayment.sol + + + + + + + +
+
+

+ all files / interfaces/ PullPayment.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @notice allows contract to call a basic withdraw() function taking no parameters on another contract
+interface PullPayment {
+ 
+	function withdraw()	external returns(bool);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/TokenFactoryInterface.sol.html b/coverage/interfaces/TokenFactoryInterface.sol.html new file mode 100644 index 00000000..62976f10 --- /dev/null +++ b/coverage/interfaces/TokenFactoryInterface.sol.html @@ -0,0 +1,92 @@ + + + + Code coverage report for interfaces/TokenFactoryInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ TokenFactoryInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface TokenFactoryInterface{
+ 
+  function createEtherDividend(string _tokenURI) external returns (address);
+ 
+  function createERC20Dividend(string _tokenURI, address _erc20Address) external returns (address);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/interfaces/index.html b/coverage/interfaces/index.html new file mode 100644 index 00000000..ff0cb80d --- /dev/null +++ b/coverage/interfaces/index.html @@ -0,0 +1,223 @@ + + + + Code coverage report for interfaces/ + + + + + + + +
+
+

+ all files interfaces/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ApproveAndCallFallback.sol
100%0/0100%0/0100%0/0100%0/0
BurnERC20.sol
100%0/0100%0/0100%0/0100%0/0
BurnableERC20.sol
100%0/0100%0/0100%0/0100%0/0
DBInterface.sol
100%0/0100%0/0100%0/0100%0/0
DivToken.sol
100%0/0100%0/0100%0/0100%0/0
ERC20.sol
100%0/0100%0/0100%0/0100%0/0
ERC20DividendInterface.sol
100%0/0100%0/0100%0/0100%0/0
EtherDividendInterface.sol
100%0/0100%0/0100%0/0100%0/0
GovToken.sol
100%0/0100%0/0100%0/0100%0/0
PullPayment.sol
100%0/0100%0/0100%0/0100%0/0
TokenFactoryInterface.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/access/AccessHierarchy.sol.html b/coverage/lcov-report/access/AccessHierarchy.sol.html new file mode 100644 index 00000000..68503504 --- /dev/null +++ b/coverage/lcov-report/access/AccessHierarchy.sol.html @@ -0,0 +1,296 @@ + + + + Code coverage report for access/AccessHierarchy.sol + + + + + + + +
+
+

+ all files / access/ AccessHierarchy.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 10/10 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +  +  +  +3× +2× +2× +2× +  +  +  +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  +3× +2× +  +  +  +  +5× +4× +  +  +  +  +13× +10× +  +  +  +  +5× +4× +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+// @title A contract for granting and revoking access levels to different users
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice Made for platforms that require hierarchical access restrictions
+contract AccessHierarchy {
+ 
+  Database public database;
+  uint8 public upperAccessLevel;
+ 
+  // @notice Constructor: Inititalize Database
+  constructor(address _database)
+  public  {
+    database = Database(_database);
+  }
+ 
+  // @notice Owner can manually grant access to a user here. WIll be used for KYC approval
+  // @param Address of new user.
+  // @param The level of access granted by owner/burningcontract
+  function approveUser(address _newUser, uint _accessLevel)
+  onlyPlatform
+  noEmptyAddress(_newUser)
+  public
+  returns (bool) {
+    require(_accessLevel < upperAccessLevel && _accessLevel != uint8(0));
+    database.setUint(keccak256(abi.encodePacked("userAccess", _newUser)), _accessLevel);
+    emit LogUserApproved(_newUser, _accessLevel);
+    return true;
+  }
+ 
+  // @notice Owner can remove access for users
+  // @param User to be removed
+  function removeUser(address _user)
+  onlyOwner
+  public
+  returns (bool) {
+    uint accessLevel = database.uintStorage(keccak256(abi.encodePacked("userAccess", _user)));
+    database.deleteUint(keccak256(abi.encodePacked("userAccess", _user)));
+    emit LogUserRemoved(_user, accessLevel);
+    return true;
+  }
+ 
+  // @notice Owner can set the upper bound on access levels
+  // @param (uint8) _newUpperLimit = The highest access level on the platform
+  function setUpperAccessLevel(uint8 _newUpperLimit)
+  public
+  onlyOwner {
+    require(_newUpperLimit > uint8(0));
+    upperAccessLevel = _newUpperLimit;
+  }
+ 
+  // @notice Deny empty address parameters
+  modifier noEmptyAddress(address _param) {
+    require(_param != address(0));
+    _;
+  }
+ 
+  // @notice Deny all callers except owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice only contracts on the platform can call.
+  modifier onlyPlatform {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", msg.sender))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                        Events
+  //------------------------------------------------------------------------------------------------------------------
+  event LogUserApproved(address _user, uint _approvalLevel);
+  event LogUserRemoved(address indexed _user, uint indexed _accessLevel);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/access/ERC20Burner.sol.html b/coverage/lcov-report/access/ERC20Burner.sol.html new file mode 100644 index 00000000..849e6763 --- /dev/null +++ b/coverage/lcov-report/access/ERC20Burner.sol.html @@ -0,0 +1,335 @@ + + + + Code coverage report for access/ERC20Burner.sol + + + + + + + +
+
+

+ all files / access/ ERC20Burner.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 80% + Branches + 8/10 +
+
+ 100% + Functions + 7/7 +
+
+ 100% + Lines + 17/17 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +6× +6× +  +  +  +  +  +  +  +  +  +  +40× +39× +39× +  +  +  +  +  +  +  +  +  +  +  +15× +15× +15× +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +15× +15× +  +  +  +  +45× +43× +  +  +  +  +43× +43× +40× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../interfaces/BurnableERC20.sol';
+import "../interfaces/DBInterface.sol";
+ 
+/// @title A contract for burning ERC20 tokens as usage fee for dapps
+/// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+/// @notice Allows Dapps to call this contract to burn ERC20 tokens as a usage fee
+/// @dev This contract does not accept tokens. It only burns tokens from investors wallets to run platform functionality
+contract ERC20Burner {
+ 
+  BurnableERC20 public token;  // The instance of the ERC20 burner contract
+  DBInterface public database;   // The datbase instance
+ 
+ 
+  // @notice constructor: initializes database and the MYB token
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+    token = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+    Erequire(address(token) != address(0));
+  }
+ 
+  // @notice authorized contracts can burn mybit tokens here if the investor has approved this contract to do so
+  // @param (address) _tokenHolder = the address of the mybit token holder who wishes to burn _amount of tokens
+  // @param (uint) _amount = the amount of tokens to be burnt (must include decimal places)
+  function burn(address _tokenHolder, uint _amount)
+  external
+  onlyPlatformContracts(msg.sender)
+  acceptedState(_tokenHolder)
+  returns (bool) {
+    require(token.burnFrom(_tokenHolder, _amount));
+    emit LogMYBBurned(_tokenHolder, msg.sender, _amount);
+    return true;
+  }
+ 
+  // @notice owners can set the cost of functionality on the platform here.
+  // @dev _amount will be how many platformTokens are burned to call the method at _contractAddress
+  // @param (bytes4) _methodID: the methodID of the function which is to require a burning fee
+  // @param (address) _contractAddress: the address of the contract where this method is contained
+  function setFee(bytes4 _methodID, address _contractAddress, uint _amount)
+  external
+  onlyOwner
+  returns (bool) {
+    //Sets the price to burn per function in MyB.
+    database.setUint(keccak256(abi.encodePacked(_methodID, _contractAddress)), _amount);
+    emit LogFeeAdded(_contractAddress, _methodID, _amount);
+    return true;
+  }
+ 
+ 
+  // @notice fallback function. Rejects all ether
+  function ()
+  external
+  payable {
+    revert();
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice reverts if msg.sender isn't the owner
+  modifier onlyOwner {
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice reverts if address isn't authorized to burn MYB
+  modifier onlyPlatformContracts(address _burner) {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", _burner))));
+    _;
+  }
+ 
+  // @notice reverts if investor hasn't accepted current contract state or if he doesn't ignore state changes entirely
+  modifier acceptedState(address _investor) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    require(database.boolStorage(keccak256(abi.encodePacked(currentState, _investor))) || database.boolStorage(keccak256(abi.encodePacked("ignoreStateChanges", _investor))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogMYBBurned(address _tokenHolder, address _burningContract, uint _amount);
+  event LogFeeAdded(address indexed _contractAddress, bytes4 _methodID, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/access/Expirable.sol.html b/coverage/lcov-report/access/Expirable.sol.html new file mode 100644 index 00000000..011d72e6 --- /dev/null +++ b/coverage/lcov-report/access/Expirable.sol.html @@ -0,0 +1,239 @@ + + + + Code coverage report for access/Expirable.sol + + + + + + + +
+
+

+ all files / access/ Expirable.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 50% + Branches + 2/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 10/10 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+import '../math/SafeMath.sol';
+import './AccessHierarchy.sol';
+ 
+// @title A contract extension that gives an expiration date to user access
+// @author Kyle Dewhurst, MyBit Foundation
+contract Expirable is AccessHierarchy {
+  using SafeMath for uint;
+ 
+  uint public expirationLength = uint256(31557600);    // 365 days
+ 
+  constructor(address _database) public AccessHierarchy(_database){}
+    
+  //------------------------------------------------------------------------------------------------------------------
+  // @notice Owner can manually grant access to a user here. WIll be used for KYC approval
+  // @param Address of new user.
+  // @param The level of access granted by owner/burningcontract
+  // TODO: does the modifier in AccessHierarchy throw?
+  //------------------------------------------------------------------------------------------------------------------
+  function approveTemporaryUser(address _newUser, uint _accessLevel)
+  onlyOwner
+  noEmptyAddress(_newUser)
+  public
+  returns (bool) {
+    Erequire(approveUser(_newUser, _accessLevel));
+    uint expiry = now.add(expiry);
+    database.setUint(keccak256(abi.encodePacked("userAccessExpiration", _newUser)), expiry);
+    return true;
+  }
+ 
+ 
+  // @notice Owner can remove access for users
+  // @param User to be removed
+  function removeTemporaryUser(address _user)
+  onlyOwner
+  public
+  returns (bool) {
+    Erequire(removeUser(_user));
+    database.deleteUint(keccak256(abi.encodePacked("userAccessExpiration", _user)));
+    return true;
+  }
+ 
+ 
+  // @notice Owner can change the length of expiration here
+  // @param (uint) _newExpirationLength = The number of seconds until the access expires
+  function changeExpirationLength(uint _newExpirationLength)
+  external
+  onlyOwner {
+    uint oldExpiration = expirationLength;
+    expirationLength = _newExpirationLength;
+    emit LogExpirationLengthChanged(oldExpiration, expirationLength);
+  }
+ 
+  event LogExpirationLengthChanged(uint _oldExpirationLength, uint _newExpirationLength);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/access/KYC.sol.html b/coverage/lcov-report/access/KYC.sol.html new file mode 100644 index 00000000..0c0f4f0f --- /dev/null +++ b/coverage/lcov-report/access/KYC.sol.html @@ -0,0 +1,155 @@ + + + + Code coverage report for access/KYC.sol + + + + + + + +
+
+

+ all files / access/ KYC.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 3/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +1× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './AccessHierarchy.sol';
+ 
+// @title A contract that manages KYC approval
+// @notice KYC can be granted or revoked here
+// @author Kyle Dewhurst, MyBit Foundation
+ 
+contract KYC is AccessHierarchy {
+ 
+  constructor(address _database) public AccessHierarchy(_database){}
+ 
+  // @notice Owner can approve KYC for user
+  function approveKYC(address _user)
+  onlyOwner
+  external {
+    database.setBool(keccak256(abi.encodePacked("kycApproved", _user)), true);
+    emit LogKYCApproved(msg.sender, _user);
+  }
+ 
+  // @notice Owner can approve KYC for user
+  function revokeKYC(address _user)
+  onlyOwner
+  external  {
+    database.deleteBool(keccak256(abi.encodePacked("kycApproved", _user)));
+  }
+ 
+ 
+  event LogKYCApproved(address _owner, address _user);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/access/index.html b/coverage/lcov-report/access/index.html new file mode 100644 index 00000000..4f4a7532 --- /dev/null +++ b/coverage/lcov-report/access/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for access/ + + + + + + + +
+
+

+ all files access/ +

+
+
+ 100% + Statements + 34/34 +
+
+ 83.33% + Branches + 20/24 +
+
+ 100% + Functions + 21/21 +
+
+ 100% + Lines + 47/47 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AccessHierarchy.sol
100%12/12100%10/10100%7/7100%17/17
ERC20Burner.sol
100%13/1380%8/10100%7/7100%17/17
Expirable.sol
100%8/850%2/4100%4/4100%10/10
KYC.sol
100%1/1100%0/0100%3/3100%3/3
+
+
+ + + + + + + diff --git a/coverage/lcov-report/base.css b/coverage/lcov-report/base.css new file mode 100644 index 00000000..29737bcb --- /dev/null +++ b/coverage/lcov-report/base.css @@ -0,0 +1,213 @@ +body, html { + margin:0; padding: 0; + height: 100%; +} +body { + font-family: Helvetica Neue, Helvetica, Arial; + font-size: 14px; + color:#333; +} +.small { font-size: 12px; } +*, *:after, *:before { + -webkit-box-sizing:border-box; + -moz-box-sizing:border-box; + box-sizing:border-box; + } +h1 { font-size: 20px; margin: 0;} +h2 { font-size: 14px; } +pre { + font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; + margin: 0; + padding: 0; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; +} +a { color:#0074D9; text-decoration:none; } +a:hover { text-decoration:underline; } +.strong { font-weight: bold; } +.space-top1 { padding: 10px 0 0 0; } +.pad2y { padding: 20px 0; } +.pad1y { padding: 10px 0; } +.pad2x { padding: 0 20px; } +.pad2 { padding: 20px; } +.pad1 { padding: 10px; } +.space-left2 { padding-left:55px; } +.space-right2 { padding-right:20px; } +.center { text-align:center; } +.clearfix { display:block; } +.clearfix:after { + content:''; + display:block; + height:0; + clear:both; + visibility:hidden; + } +.fl { float: left; } +@media only screen and (max-width:640px) { + .col3 { width:100%; max-width:100%; } + .hide-mobile { display:none!important; } +} + +.quiet { + color: #7f7f7f; + color: rgba(0,0,0,0.5); +} +.quiet a { opacity: 0.7; } + +.fraction { + font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; + font-size: 10px; + color: #555; + background: #E8E8E8; + padding: 4px 5px; + border-radius: 3px; + vertical-align: middle; +} + +div.path a:link, div.path a:visited { color: #333; } +table.coverage { + border-collapse: collapse; + margin: 10px 0 0 0; + padding: 0; +} + +table.coverage td { + margin: 0; + padding: 0; + vertical-align: top; +} +table.coverage td.line-count { + text-align: right; + padding: 0 5px 0 20px; +} +table.coverage td.line-coverage { + text-align: right; + padding-right: 10px; + min-width:20px; +} + +table.coverage td span.cline-any { + display: inline-block; + padding: 0 5px; + width: 100%; +} +.missing-if-branch { + display: inline-block; + margin-right: 5px; + border-radius: 3px; + position: relative; + padding: 0 4px; + background: #333; + color: yellow; +} + +.skip-if-branch { + display: none; + margin-right: 10px; + position: relative; + padding: 0 4px; + background: #ccc; + color: white; +} +.missing-if-branch .typ, .skip-if-branch .typ { + color: inherit !important; +} +.coverage-summary { + border-collapse: collapse; + width: 100%; +} +.coverage-summary tr { border-bottom: 1px solid #bbb; } +.keyline-all { border: 1px solid #ddd; } +.coverage-summary td, .coverage-summary th { padding: 10px; } +.coverage-summary tbody { border: 1px solid #bbb; } +.coverage-summary td { border-right: 1px solid #bbb; } +.coverage-summary td:last-child { border-right: none; } +.coverage-summary th { + text-align: left; + font-weight: normal; + white-space: nowrap; +} +.coverage-summary th.file { border-right: none !important; } +.coverage-summary th.pct { } +.coverage-summary th.pic, +.coverage-summary th.abs, +.coverage-summary td.pct, +.coverage-summary td.abs { text-align: right; } +.coverage-summary td.file { white-space: nowrap; } +.coverage-summary td.pic { min-width: 120px !important; } +.coverage-summary tfoot td { } + +.coverage-summary .sorter { + height: 10px; + width: 7px; + display: inline-block; + margin-left: 0.5em; + background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; +} +.coverage-summary .sorted .sorter { + background-position: 0 -20px; +} +.coverage-summary .sorted-desc .sorter { + background-position: 0 -10px; +} +.status-line { height: 10px; } +/* dark red */ +.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } +.low .chart { border:1px solid #C21F39 } +/* medium red */ +.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } +/* light red */ +.low, .cline-no { background:#FCE1E5 } +/* light green */ +.high, .cline-yes { background:rgb(230,245,208) } +/* medium green */ +.cstat-yes { background:rgb(161,215,106) } +/* dark green */ +.status-line.high, .high .cover-fill { background:rgb(77,146,33) } +.high .chart { border:1px solid rgb(77,146,33) } +/* dark yellow (gold) */ +.medium .chart { border:1px solid #f9cd0b; } +.status-line.medium, .medium .cover-fill { background: #f9cd0b; } +/* light yellow */ +.medium { background: #fff4c2; } +/* light gray */ +span.cline-neutral { background: #eaeaea; } + +.cbranch-no { background: yellow !important; color: #111; } + +.cstat-skip { background: #ddd; color: #111; } +.fstat-skip { background: #ddd; color: #111 !important; } +.cbranch-skip { background: #ddd !important; color: #111; } + + +.cover-fill, .cover-empty { + display:inline-block; + height: 12px; +} +.chart { + line-height: 0; +} +.cover-empty { + background: white; +} +.cover-full { + border-right: none !important; +} +pre.prettyprint { + border: none !important; + padding: 0 !important; + margin: 0 !important; +} +.com { color: #999 !important; } +.ignore-none { color: #999; font-weight: normal; } + +.wrapper { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -48px; +} +.footer, .push { + height: 48px; +} diff --git a/coverage/lcov-report/crowdsale/CrowdsaleERC20.sol.html b/coverage/lcov-report/crowdsale/CrowdsaleERC20.sol.html new file mode 100644 index 00000000..9308bff2 --- /dev/null +++ b/coverage/lcov-report/crowdsale/CrowdsaleERC20.sol.html @@ -0,0 +1,635 @@ + + + + Code coverage report for crowdsale/CrowdsaleERC20.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleERC20.sol +

+
+
+ 88.37% + Statements + 38/43 +
+
+ 66.67% + Branches + 24/36 +
+
+ 78.57% + Functions + 11/14 +
+
+ 88.14% + Lines + 52/59 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +5× +5× +5× +5× +3× +3× +3× +3× +3× +3× +  +  +2× +2× +  +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +2× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +9× +8× +  +  +  +  +5× +5× +  +  +  +  +9× +9× +  +  +  +  +7× +6× +  +  +  +  +2× +1× +  +  +  +  +7× +6× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../interfaces/ERC20DividendInterface.sol";
+import "../access/ERC20Burner.sol";
+ 
+// @title An asset crowdsale contract which accepts funding from ERC20 tokens.
+// @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice creates a dividend token to represent the newly created asset.
+contract CrowdsaleERC20{
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+  ERC20Burner public burner;
+ 
+  // @notice Constructor: initializes database instance
+  // @param: The address for the platform database
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+ 
+  // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens.
+  // @dev investor must approve this contract to transfer tokens
+  // @param (bytes32) _assetID = The ID of the asset tokens, investor wishes to purchase
+  // @param (uint) _amount = The amount to spend purchasing this asset
+  function buyAssetOrderERC20(bytes32 _assetID, uint _amount)
+  external
+  validAsset(_assetID)
+  beforeDeadline(_assetID)
+  notFinalized(_assetID)
+  burnRequired
+  returns (bool) {
+    ERC20DividendInterface assetToken = ERC20DividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    uint amountToRaise = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+    uint tokensRemaining = amountToRaise.sub(assetToken.totalSupply());
+    if (_amount >= tokensRemaining) {
+      Erequire(fundingToken.transferFrom(msg.sender, address(this), tokensRemaining));    // transfer investors tokens into contract
+      Erequire(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID))) ));
+      Erequire(finalizeCrowdsale(_assetID));
+      Erequire(assetToken.mint(msg.sender, tokensRemaining));   // Send remaining asset tokens to investor
+      Erequire(assetToken.finishMinting());
+      require(payoutERC20(_assetID, amountToRaise));          // 1 token = 1 wei
+    }
+    else {
+      Erequire(fundingToken.transferFrom(msg.sender, address(this), _amount));
+      Erequire(assetToken.mint(msg.sender, _amount));
+    }
+    emit LogAssetPurchased(_assetID, msg.sender, _amount); //Should amount listed be how much they spent or how much they received?
+    return true;
+  }
+ 
+ 
+  // @notice Contributors can retrieve their funds here if crowdsale has paased deadline
+  // @param (bytes32) _assetID =  The ID of the asset which didn't reach it's crowdfunding goals
+  function refund(bytes32 _assetID)
+  external
+  whenNotPaused
+  validAsset(_assetID)
+  afterDeadline(_assetID)
+  notFinalized(_assetID)
+  returns (bool) {
+    Erequire(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) != 0);
+    database.deleteUint(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+    address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    ERC20DividendInterface assetToken = ERC20DividendInterface(tokenAddress);
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    uint refundValue = assetToken.totalSupply(); //token=wei
+    fundingToken.approve(tokenAddress, refundValue);
+    assetToken.issueDividends(refundValue);
+    return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Internal Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw
+  // @dev The contract manager needs to know  the address PlatformDistribution contract
+  function payoutERC20(bytes32 _assetID, uint _amount)
+  private
+  whenNotPaused
+  returns (bool) {
+    ERC20 fundingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID))));
+    address operator = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+    address platformWallet = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+    require(operator != address(0) && platformWallet != address(0));
+    uint operatorPortion = _amount.mul(99).div(100);
+    uint platformPortion = _amount.sub(operatorPortion);
+    fundingToken.transfer(platformWallet, platformPortion);
+    fundingToken.transfer(operator, operatorPortion);
+    emit LogAssetPayout(_assetID, operator, _amount);
+    return true;
+  }
+ 
+  // @notice platform owners can recover tokens here
+  function recoverTokens(address _erc20Token)
+  onlyOwner
+  external {
+    ERC20 thisToken = ERC20(_erc20Token);
+    uint contractBalance = thisToken.balanceOf(address(this));
+    thisToken.transfer(msg.sender, contractBalance);
+  }
+ 
+  // @notice platform owners can destroy contract here
+  function destroy()
+  onlyOwner
+  external {
+    emit LogDestruction(address(this).balance, msg.sender);
+    selfdestruct(msg.sender);
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Internal functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice internal function for freeing up storage after crowdsale finishes
+  // @param the ID of this asset.
+  function finalizeCrowdsale(bytes32 _assetID)
+  internal
+  whenNotPaused
+  returns (bool) {
+      database.setBool(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)), true);
+      database.deleteUint(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+      database.deleteUint(keccak256(abi.encodePacked("assetManagerFee", _assetID)));
+      return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice function won't run if owners have paused this contract
+  modifier whenNotPaused {
+    require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+    _;
+  }
+ 
+  // @notice reverts if investor hasn't approved burner to burn platform token
+  modifier burnRequired {
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+      // @notice reverts if the asset does not have a token address set in the database
+  modifier validAsset(bytes32 _assetID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+    _;
+  }
+ 
+  // @notice reverts if the funding deadline has already past
+  modifier beforeDeadline(bytes32 _assetID) {
+    require(now <= database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+    _;
+  }
+ 
+  // @notice reverts if the funding deadline has already past
+  modifier afterDeadline(bytes32 _assetID) {
+    require(now > database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+    _;
+  }
+ 
+  // @notice returns true if crowdsale is not finshed
+  modifier notFinalized(bytes32 _assetID) {
+    require( !database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))) );
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  event LogAssetPurchased(bytes32 indexed _assetID, address indexed _sender, uint _amount);
+  event LogAssetPayout(bytes32 indexed _assetID, address indexed _operator, uint _amount);
+  event LogDestruction(uint _amountSent, address indexed _caller);
+  event LogAssetInfo(uint _investorAmount, uint _tokensRemaining);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/crowdsale/CrowdsaleETH.sol.html b/coverage/lcov-report/crowdsale/CrowdsaleETH.sol.html new file mode 100644 index 00000000..e4193301 --- /dev/null +++ b/coverage/lcov-report/crowdsale/CrowdsaleETH.sol.html @@ -0,0 +1,653 @@ + + + + Code coverage report for crowdsale/CrowdsaleETH.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleETH.sol +

+
+
+ 94.87% + Statements + 37/39 +
+
+ 61.76% + Branches + 21/34 +
+
+ 93.75% + Functions + 15/16 +
+
+ 94.74% + Lines + 54/57 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +5× +5× +5× +  +3× +3× +3× +3× +3× +3× +  +  +2× +  +5× +5× +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +8× +8× +  +  +  +  +2× +1× +  +  +  +  +5× +5× +  +  +  +  +3× +2× +  +  +  +  +10× +10× +  +  +  +  +8× +5× +  +  +  +  +2× +2× +  +  +  +  +7× +7× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../interfaces/EtherDividendInterface.sol";
+import "../access/ERC20Burner.sol";
+ 
+// @title An asset crowdsale contract, which accepts Ether for funding.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @notice Starts a new crowdsale and returns asset dividend tokens for Wei received.
+// @dev The AssetManager
+contract CrowdsaleETH {
+    using SafeMath for uint256;
+ 
+    DBInterface public database;
+    ERC20Burner public burner;
+ 
+    // @notice Constructor: Initiates the database
+    // @param: The address for the database contract
+    constructor(address _database)
+    public {
+        database = DBInterface(_database);
+        burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+    }
+ 
+ 
+    // @notice Investors can send Ether here to fund asset, receiving an equivalent number of asset-tokens.
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    function buyAssetOrderETH(bytes32 _assetID)
+    external
+    payable
+    requiresEther
+    validAsset(_assetID)
+    beforeDeadline(_assetID)
+    notFinalized(_assetID)
+    burnRequired
+    returns (bool) {
+      EtherDividendInterface assetToken = EtherDividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+      uint amountToRaise = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+      uint tokensRemaining = amountToRaise.sub(assetToken.totalSupply());
+      if (msg.value >= tokensRemaining) {
+        // Give assetManager his portion of tokens
+        Erequire(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID)))));
+        Erequire(finalizeCrowdsale(_assetID));    // delete unnecessary variables
+        Erequire(assetToken.mint(msg.sender, tokensRemaining));   // Send remaining asset tokens
+        Erequire(assetToken.finishMinting());
+        Erequire(payoutETH(_assetID, amountToRaise));          // 1 token = 1 wei
+        msg.sender.transfer(msg.value.sub(tokensRemaining));     // Return leftover WEI after cost of tokens calculated and subtracted from msg.value
+      }
+      else {
+        Erequire(assetToken.mint(msg.sender, msg.value));
+      }
+      emit LogAssetPurchased(_assetID, msg.sender, msg.value);
+      return true;
+    }
+ 
+ 
+    // @notice Contributors can retrieve their funds here if crowdsale has paased deadline and not reached its goal
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    function refund(bytes32 _assetID)
+    external
+    whenNotPaused
+    validAsset(_assetID)
+    afterDeadline(_assetID)
+    notFinalized(_assetID)
+    returns (bool) {
+      Erequire(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) != 0);
+      database.deleteUint(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+      database.deleteUint(keccak256(abi.encodePacked("investorSupply", _assetID)));
+      EtherDividendInterface assetToken = EtherDividendInterface(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+      uint refundValue = assetToken.totalSupply(); //token=wei
+      assetToken.issueDividends.value(refundValue)();
+      return true;
+    }
+ 
+    // @notice platform owners can recover tokens here
+    function recoverTokens(address _erc20Token)
+    onlyOwner
+    external {
+      ERC20 thisToken = ERC20(_erc20Token);
+      uint contractBalance = thisToken.balanceOf(address(this));
+      thisToken.transfer(msg.sender, contractBalance);
+    }
+ 
+    // @notice platform owners can destroy contract here
+    function destroy()
+    onlyOwner
+    external {
+      emit LogDestruction(address(this).balance, msg.sender);
+      selfdestruct(msg.sender);
+    }
+ 
+    // @notice fallback function: reject ether
+    function ()
+    public
+    payable {
+      revert();
+    }
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Internal Functions
+    //------------------------------------------------------------------------------------------------------------------
+ 
+    // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator & assetManager can withdraw
+    // @dev The contract manager needs to know  the address PlatformDistribution contract
+    // @param (bytes32) _assetID = The ID of the asset which completed the crowdsale
+    // @param (uint) _amount = The amount of WEI to be sent to the platform + the operator
+    function payoutETH(bytes32 _assetID, uint _amount)
+    internal
+    returns (bool) {
+      address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+      address platformWallet = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+      Erequire(operatorAddress != address(0) && platformWallet != address(0));
+      uint operatorPortion = _amount.mul(99).div(100);
+      uint platformPortion = _amount.sub(operatorPortion);
+      platformWallet.transfer(platformPortion);
+      operatorAddress.transfer(operatorPortion);
+      emit LogAssetPayout(_assetID, operatorAddress, _amount);
+      return true;
+    }
+ 
+    // @notice internal function for freeing up storage after crowdsale finishes
+    // @param the ID of this asset.
+    function finalizeCrowdsale(bytes32 _assetID)
+    internal
+    returns (bool) {
+        database.setBool(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)), true);
+        database.deleteUint(keccak256(abi.encodePacked("amountToRaise", _assetID)));     // This is now represented as totalSupply in the asset-token
+        database.deleteUint(keccak256(abi.encodePacked("assetManagerFee", _assetID)));   // This is now represented as tokens in AssetManagerFunds.sol
+        return true;
+    }
+ 
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Modifiers
+    //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+    // @notice Requires that Ether is sent with the transaction
+    modifier requiresEther() {
+      Erequire(msg.value > 0);
+      _;
+    }
+ 
+    // @notice Sender must be a registered owner
+    modifier onlyOwner {
+      require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+      _;
+    }
+ 
+    // @notice reverts if investor hasn't approved burner to burn platform token
+    modifier burnRequired {
+      Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+      _;
+    }
+ 
+    // @notice function won't run if owners have paused this contract
+    modifier whenNotPaused {
+      require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+      _;
+    }
+ 
+    // @notice reverts if the asset does not have a token address set in the database
+    modifier validAsset(bytes32 _assetID) {
+      Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+      _;
+    }
+ 
+    // @notice reverts if the funding deadline has already past
+    modifier beforeDeadline(bytes32 _assetID) {
+      require(now <= database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+      _;
+    }
+ 
+    // @notice reverts if the funding deadline has already past
+    modifier afterDeadline(bytes32 _assetID) {
+      Erequire(now > database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))));
+      _;
+    }
+ 
+    // @notice returns true if crowdsale is not finshed
+    modifier notFinalized(bytes32 _assetID) {
+      Erequire( !database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))) );
+      _;
+    }
+ 
+    //------------------------------------------------------------------------------------------------------------------
+    //                                            Events
+    //------------------------------------------------------------------------------------------------------------------
+ 
+    event LogAssetPurchased(bytes32 indexed _assetID, address indexed _sender, uint _amount);
+    event LogRefund(bytes32 indexed _assetID, address indexed _funder, uint _amount);
+    event LogAssetPayout(bytes32 indexed _assetID, address indexed _distributionContract, uint _amount);
+    event LogDestruction(uint _amountSent, address indexed _caller);
+  }
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/crowdsale/CrowdsaleGeneratorERC20.sol.html b/coverage/lcov-report/crowdsale/CrowdsaleGeneratorERC20.sol.html new file mode 100644 index 00000000..94516fc6 --- /dev/null +++ b/coverage/lcov-report/crowdsale/CrowdsaleGeneratorERC20.sol.html @@ -0,0 +1,290 @@ + + + + Code coverage report for crowdsale/CrowdsaleGeneratorERC20.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleGeneratorERC20.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 75% + Branches + 9/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +5× +5× +5× +4× +4× +3× +3× +3× +3× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +6× +6× +  +  +  +  +  +  +  +  +  + 
 pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendTokenERC20.sol";
+ 
+// @title A crowdsale generator contract
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @notice AssetManagers can initiate a crowdsale that accepts ERC20 tokens as payment here
+contract CrowdsaleGeneratorERC20 {
+  using SafeMath for uint256;
+ 
+  DBInterface private database;
+  ERC20Burner private burner;
+ 
+  uint constant scalingFactor = 1e32;
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // @notice AssetManagers can initiate a crowdfund for a new asset here
+  // @dev the crowdsaleERC20 contract is granted rights to mint asset-tokens as it receives funding
+  // @param (string) _assetURI = The location where information about the asset can be found
+  // @param (bytes32) _operatorID = The ID of the operator who is to create and install this asset
+  // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails
+  // @param (uint) _amountToRaise = The amount of tokens required to raise for the crowdsale to be a success
+  // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success
+  // @param (address) _fundingToken = The ERC20 token to be used to fund the crowdsale (Operator must accept this token as payment)
+  function createAssetOrderERC20(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc, address _fundingToken)
+  external
+  burnRequired {
+    require(_amountToRaise > 0);
+    Erequire(_assetManagerPerc < 100);
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("acceptsToken", _operatorID, _fundingToken))));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) != address(0));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+    require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", assetID))) == 0);
+    address assetAddress = address(new DividendTokenERC20(_assetURI, database.addressStorage(keccak256(abi.encodePacked("contract", "CrowdsaleERC20"))), _fundingToken));
+    database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), now.add(_fundingLength));
+    uint assetManagerFee = _amountToRaise.mul(uint(100).mul(scalingFactor).div(uint(100).sub(_assetManagerPerc)).sub(scalingFactor)).div(scalingFactor);
+    database.setUint(keccak256(abi.encodePacked("amountToRaise", assetID)), _amountToRaise);
+    database.setUint(keccak256(abi.encodePacked("assetManagerFee", assetID)), assetManagerFee);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), assetAddress);
+    database.setBytes32(keccak256(abi.encodePacked("assetTokenID", assetAddress)), assetID);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("operator", assetID)), database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))));
+    database.setAddress(keccak256(abi.encodePacked("fundingToken", assetID)), _fundingToken);
+    emit LogAssetFundingStarted(assetID, msg.sender, _assetURI, assetAddress);
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice reverts if AssetManager hasn't approved burner to burn platform token
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogAssetFundingStarted(bytes32 indexed _assetID, address indexed _assetManager, string _assetURI, address indexed _tokenAddress);
+  event LogSig(bytes4 _sig);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/crowdsale/CrowdsaleGeneratorETH.sol.html b/coverage/lcov-report/crowdsale/CrowdsaleGeneratorETH.sol.html new file mode 100644 index 00000000..597e46c8 --- /dev/null +++ b/coverage/lcov-report/crowdsale/CrowdsaleGeneratorETH.sol.html @@ -0,0 +1,293 @@ + + + + Code coverage report for crowdsale/CrowdsaleGeneratorETH.sol + + + + + + + +
+
+

+ all files / crowdsale/ CrowdsaleGeneratorETH.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 21/21 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +9× +8× +7× +7× +6× +6× +5× +5× +5× +5× +5× +5× +5× +5× +5× +5× +5× +  +  +  +  +  +  +  +  +  +  +9× +9× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendToken.sol";
+ 
+// @title A crowdsale generator contract
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice AssetManagers can initiate a crowdsale that accepts Ether as payment here
+contract CrowdsaleGeneratorETH {
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+  ERC20Burner public burner;
+ 
+  uint constant scalingFactor = 1e32;   // Used to avoid rounding errors
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+      burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // @notice AssetManagers can initiate a crowdfund for a new asset here
+  // @dev the crowdsaleETH contract is granted rights to mint asset-tokens as it receives funding
+  // @param (string) _assetURI = The location where information about the asset can be found
+  // @param (bytes32) _operatorID = The ID of the operator who is to create and install this asset
+  // @param (uint) _fundingLength = The number of seconds this crowdsale is to go on for until it fails
+  // @param (uint) _amountToRaise = The amount of WEI required to raise for the crowdsale to be a success
+  // @param (uint) _assetManagerPerc = The percentage of the total revenue which is to go to the AssetManager if asset is a success
+  function createAssetOrderETH(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc)
+  external
+  burnRequired
+  returns (bool) {
+    require(_amountToRaise > 0);
+    require(_assetManagerPerc < 100);
+    Erequire(database.boolStorage(keccak256(abi.encodePacked("acceptsEther", _operatorID))));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) != address(0));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+    require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", assetID))) == 0);
+    address assetAddress = address(new DividendToken(_assetURI, database.addressStorage(keccak256(abi.encodePacked("contract", "CrowdsaleETH")))));   // Gives this contract all new asset tokens
+    database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), now.add(_fundingLength));
+    uint assetManagerFee = _amountToRaise.mul(uint(100).mul(scalingFactor).div(uint(100).sub(_assetManagerPerc)).sub(scalingFactor)).div(scalingFactor);
+    database.setUint(keccak256(abi.encodePacked("assetManagerFee", assetID)), assetManagerFee);
+    database.setUint(keccak256(abi.encodePacked("amountToRaise", assetID)), _amountToRaise);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), assetAddress);
+    database.setBytes32(keccak256(abi.encodePacked("assetTokenID", assetAddress)), assetID);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("operator", assetID)), database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))));
+    emit LogAssetFundingStarted(assetID, msg.sender, _assetURI, address(assetAddress));
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  // @notice reverts if asset manager is unable to burn pp
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Events
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogAssetFundingStarted(bytes32 indexed _assetID, address indexed _assetManager, string _assetURI, address indexed _tokenAddress);
+  event LogSig(bytes4 _sig);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/crowdsale/index.html b/coverage/lcov-report/crowdsale/index.html new file mode 100644 index 00000000..fd159306 --- /dev/null +++ b/coverage/lcov-report/crowdsale/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for crowdsale/ + + + + + + + +
+
+

+ all files crowdsale/ +

+
+
+ 93.46% + Statements + 100/107 +
+
+ 68.09% + Branches + 64/94 +
+
+ 88.89% + Functions + 32/36 +
+
+ 93.67% + Lines + 148/158 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
CrowdsaleERC20.sol
88.37%38/4366.67%24/3678.57%11/1488.14%52/59
CrowdsaleETH.sol
94.87%37/3961.76%21/3493.75%15/1694.74%54/57
CrowdsaleGeneratorERC20.sol
100%12/1275%9/12100%3/3100%21/21
CrowdsaleGeneratorETH.sol
100%13/1383.33%10/12100%3/3100%21/21
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/API.sol.html b/coverage/lcov-report/database/API.sol.html new file mode 100644 index 00000000..62fb1a53 --- /dev/null +++ b/coverage/lcov-report/database/API.sol.html @@ -0,0 +1,1139 @@ + + + + Code coverage report for database/API.sol + + + + + + + +
+
+

+ all files / database/ API.sol +

+
+
+ 36.76% + Statements + 25/68 +
+
+ 100% + Branches + 0/0 +
+
+ 37.84% + Functions + 14/37 +
+
+ 36.76% + Lines + 25/68 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +6× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +3× +  +  +  +  +  +  +1× +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+import "../math/SafeMath.sol";
+ 
+interface TokenView {
+  function totalSupply() external view returns (uint);
+  function balanceOf(address _investor) external view returns (uint);
+  function valuePerToken() external view returns (uint);
+  function scalingFactor() external view returns (uint);
+  function assetIncome() external view returns (uint);
+}
+ 
+interface DBView {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function stringStorage(bytes32 _key) external  view returns (string);
+  function addressStorage(bytes32 _key) external  view returns (address);
+  function bytesStorage(bytes32 _key) external view returns (bytes);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+  function boolStorage(bytes32 _key) external view returns (bool);
+  function intStorage(bytes32 _key) external view returns (bool);
+}
+ 
+// @title A contract that gets variables from the _database
+// @notice The API contract can only view the database. It has no write privileges
+contract API {
+  using SafeMath for uint256;
+ 
+  DBView private database;
+ 
+  constructor(address _database)
+  public {
+    database = DBView(_database);
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Governance + Function ID's
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  // @notice returns the amount of tokens unlocked and free to spend for _ser
+  function getNumTokensAvailable(bytes32 _assetID, address _investor)
+  public
+  view
+  returns (uint) {
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)));
+    address assetToken = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    uint balance = TokenView(assetToken).balanceOf(_investor);
+    return balance.sub(amountLocked);
+  }
+ 
+  function getInvestorVotes(bytes32 _executionID, address _investor)
+  public
+  view
+  returns (uint) {
+    return database.uintStorage(keccak256(abi.encodePacked("investorVotes", _executionID, _investor)));
+  }
+ 
+  function getTotalVotes(bytes32 _executionID)
+  public
+  view
+  returns (uint) {
+  return database.uintStorage(keccak256(abi.encodePacked("voteTotal", _executionID)));
+  }
+ 
+  function getCurrentConsensus(bytes32 _executionID, address _assetToken)
+  public
+  view
+  returns (uint) {
+    uint totalVotes = getTotalVotes(_executionID);
+    return (totalVotes * 100) / TokenView(_assetToken).totalSupply();
+  }
+ 
+  function getAssetManagerParameterHash(bytes32 _assetID, address _oldAssetManager, address _newAssetManager, uint _amount, bool _burn)
+  public
+  pure
+  returns (bytes32){
+    return keccak256(abi.encodePacked(_assetID, _oldAssetManager, _newAssetManager, _amount, _burn));
+  }
+ 
+  function getExecutionID(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+  }
+ 
+  function getMethodID(string _functionString)
+  public
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked(_functionString)));
+  }
+ 
+  function getAssetID(address _broker, string _assetURI, uint _amountToRaise, bytes32 _operatorID)
+  public
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_broker, _amountToRaise, _operatorID, _assetURI));
+  }
+ 
+  function getOrderID(bytes _assetID, address _investor, uint _amount, uint _price, bool _buyOrder)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_assetID, _investor, _amount, _price, _buyOrder));
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Crowdsale and Assets
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  function generateAssetID(address _broker, uint _amountToRaise, bytes32 _operatorID, string _assetURI)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 assetID = keccak256(abi.encodePacked(_broker, _amountToRaise, _operatorID, _assetURI));
+    return assetID;
+  }
+ 
+  function getAssetID(address _tokenAddress)
+  public
+  view
+  returns(bytes32) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", _tokenAddress)));
+    return assetID;
+  }
+ 
+  function getAssetAddress(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address assetAddress = database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)));
+    return assetAddress;
+  }
+ 
+  function getAssetFundingToken(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address fundingTokenAddress = database.addressStorage(keccak256(abi.encodePacked("fundingToken", _assetID)));
+    return fundingTokenAddress;
+  }
+ 
+  // IF we decide not to store assetIncome
+  // function getAssetIncome(bytes32 _assetID)
+  // public
+  // view
+  // returns (uint) {
+  //   TokenView asset = TokenView(getAssetAddress(_assetID));
+  //   uint valuePerToken =  asset.valuePerToken();
+  //   return (valuePerToken * (asset.totalSupply())) / asset.scalingFactor();
+  // }
+ 
+  function getAssetROI(bytes32 _assetID)
+  public
+  view
+  returns (uint) {
+    TokenView assetToken = TokenView(getAssetAddress(_assetID));
+    return (assetToken.assetIncome() * 100) /  assetToken.totalSupply();
+  }
+ 
+  function getAssetFundingGoal(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint fundingGoal = database.uintStorage(keccak256(abi.encodePacked("amountToRaise", _assetID)));
+    return fundingGoal;
+  }
+ 
+  function getAssetFundingDeadline(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint fundingDeadline = database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID)));
+    return fundingDeadline;
+  }
+ 
+  function crowdsaleFinalized(bytes32 _assetID)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)));
+    return status;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Asset Manager and Operator
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function getAssetManager(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address managerAddress = database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID)));
+    return managerAddress;
+  }
+ 
+  function getAssetManagerFee(bytes32 _assetID)
+  public
+  view
+  returns(uint) {
+    uint managerFee = database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID)));
+    return managerFee;
+  }
+ 
+  function getAssetManagerEscrowID(bytes32 _assetID, address _manager)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 managerEscrowID = keccak256(abi.encodePacked(_assetID, _manager));
+    return managerEscrowID;
+  }
+ 
+  function getAssetManagerEscrow(bytes32 _managerEscrowID)
+  public
+  view
+  returns (uint) {
+    return database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", _managerEscrowID)));
+  }
+ 
+  function getAssetManagerEscrowRemaining(bytes32 _managerEscrowID)
+  public
+  view
+  returns(uint) {
+    uint redeemed = getAssetManagerEscrowRedeemed(_managerEscrowID);
+    uint brokerEscrow = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", _managerEscrowID))).sub(redeemed);
+    return brokerEscrow;
+  }
+ 
+  function getAssetManagerEscrowRedeemed(bytes32 _managerEscrowID)
+  public
+  view
+  returns(uint) {
+    uint escrowRedeemed = database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", _managerEscrowID)));
+    return escrowRedeemed;
+  }
+ 
+  function getAssetOperator(bytes32 _assetID)
+  public
+  view
+  returns(address) {
+    address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _assetID)));
+    return operatorAddress;
+  }
+ 
+  function generateOperatorID(string _operatorURI)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 operatorID = keccak256(abi.encodePacked(_operatorURI));
+    return operatorID;
+  }
+ 
+  function getOperatorID(address _operatorAddress)
+  public
+  view
+  returns(bytes32) {
+    bytes32 operatorID = database.bytes32Storage(keccak256(abi.encodePacked("operator", _operatorAddress)));
+    return operatorID;
+  }
+ 
+  function getOperatorAddress(bytes32 _operatorID)
+  public
+  view
+  returns(address) {
+    address operatorAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID)));
+    return operatorAddress;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Stakeholders
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function generateOrderID(bytes32 _assetID, address _sender, uint _amount, uint _price, bool _buyOrder)
+  public
+  pure
+  returns(bytes32) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, _sender, _amount, _price, _buyOrder));
+    return orderID;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Platform and Contract State
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//Platform functions
+  function getPlatformToken()
+  public
+  view
+  returns(address) {
+    address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken")));
+    return tokenAddress;
+  }
+ 
+  function getPlatformWallet()
+  public
+  view
+  returns(address) {
+    address walletAddress = database.addressStorage(keccak256(abi.encodePacked("platformWallet")));
+    return walletAddress;
+  }
+ 
+  function getContractAddress(string _contractName)
+  public
+  view
+  returns(address) {
+    address contractAddress = database.addressStorage(keccak256(abi.encodePacked("contract", _contractName)));
+    return contractAddress;
+  }
+ 
+  function getCurrentState()
+  public
+  view
+  returns(bytes32) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    return currentState;
+  }
+ 
+  function getUserPermission(address _investor)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked(getCurrentState(), _investor)));
+    return status;
+  }
+ 
+  function getFunctionCost(bytes4 _sig, address _contract)
+  public
+  view
+  returns(uint) {
+    uint cost = database.uintStorage(keccak256(abi.encodePacked(_sig, _contract)));
+    return cost;
+  }
+ 
+  function contractPaused(address _contract)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("paused", _contract)));
+    return status;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                        Ownership
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  function contractOwner(address _account)
+  public
+  view
+  returns(bool) {
+    bool status = database.boolStorage(keccak256(abi.encodePacked("owner", _account)));
+    return status;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/ContractManager.sol.html b/coverage/lcov-report/database/ContractManager.sol.html new file mode 100644 index 00000000..9e05f163 --- /dev/null +++ b/coverage/lcov-report/database/ContractManager.sol.html @@ -0,0 +1,431 @@ + + + + Code coverage report for database/ContractManager.sol + + + + + + + +
+
+

+ all files / database/ ContractManager.sol +

+
+
+ 95% + Statements + 19/20 +
+
+ 83.33% + Branches + 10/12 +
+
+ 88.89% + Functions + 8/9 +
+
+ 91.67% + Lines + 33/36 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +  +  +  +  +  +  +  +  +  +  +69× +68× +67× +67× +67× +67× +67× +67× +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +177× +177× +177× +177× +177× +  +  +  +  +  +  +  +  +  +72× +71× +  +  +  +  +  +  +  +  +  +  +  +4× +2× +  +  +  +147× +145× +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../interfaces/DBInterface.sol";
+ 
+// @title A contract manager that determines which contracts have write access to platform database
+// @notice This contract determines which contracts are allowed to make changes to the database contract.
+// @author Kyle Dewhurst, MyBit Foundation
+contract ContractManager{
+  DBInterface public database;
+ 
+  // @notice constructor: initializes database
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+  }
+ 
+  // @notice This function adds new contracts to the platform. Giving them write access to Database.sol
+  // @Param: The name of the contract
+  // @Param: The address of the new contract
+  function addContract(string _name, address _contractAddress)
+  external
+  isTrue(_contractAddress != address(0))
+  isTrue(bytes(_name).length != uint(0))
+  anyOwner {
+    require(!database.boolStorage(keccak256(abi.encodePacked("contract", _contractAddress))));
+    require(database.addressStorage(keccak256(abi.encodePacked("contract", _name))) == address(0));
+    database.setAddress(keccak256(abi.encodePacked("contract", _name)), _contractAddress);
+    database.setBool(keccak256(abi.encodePacked("contract", _contractAddress)), true);
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));      //Update currentState
+    bytes32 newState = keccak256(abi.encodePacked(currentState, _contractAddress));
+    database.setBytes32(keccak256(abi.encodePacked("currentState")), newState);
+    emit LogContractAdded(_contractAddress, _name, block.number);
+  }
+ 
+  // @notice Owner can remove an existing contract on the platform.
+  // @Param: The name of the contract
+  // @Param: The owner who authorized this function to be called
+  function removeContract(string _name)
+  external
+  isTrue(bytes(_name).length != uint(0))
+  contractExists(database.addressStorage(keccak256(abi.encodePacked("contract", _name))))
+  anyOwner {
+    address contractToDelete = database.addressStorage(keccak256(abi.encodePacked("contract", _name)));
+    database.deleteBool(keccak256(abi.encodePacked("contract", contractToDelete)));
+    database.deleteAddress(keccak256(abi.encodePacked("contract", _name)));
+    emit LogContractRemoved(contractToDelete, _name, block.number);
+  }
+ 
+  // @notice Owner can update an existing contract on the platform, giving it write access to Database
+  // @Param: The name of the contract (First Letter Capitalized)
+  // @Param: The address of the new contract
+  function updateContract(string _name, address _newContractAddress)
+  external
+  isTrue(_newContractAddress != 0)
+  contractExists(database.addressStorage(keccak256(abi.encodePacked("contract", _name))))
+  anyOwner {
+    address oldAddress = database.addressStorage(keccak256(abi.encodePacked("contract", _name)));
+    database.setAddress(keccak256(abi.encodePacked("contract", _name)), _newContractAddress);
+    database.setBool(keccak256(abi.encodePacked("contract", _newContractAddress)), true);
+    database.deleteBool(keccak256(abi.encodePacked("contract", oldAddress)));
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));      //Update currentState
+    bytes32 newState = keccak256(abi.encodePacked(currentState, _newContractAddress));
+    database.setBytes32(keccak256(abi.encodePacked("currentState")), newState);
+    emit LogContractUpdated(oldAddress, _name, block.number);
+    emit LogNewContractLocation(_newContractAddress, _name, block.number);
+  }
+ 
+  // @notice user can decide to accept or deny the current and future state of the platform contracts
+  // @notice if user accepts future upgrades they will automatically be able to interact with upgraded contracts
+  // @param (bool) _acceptCurrentState: does the user agree to use the current contracts in the platform
+  // @param (bool) _ignoreStateChanges: does the user agree to use the platform despite contract changes
+  function setContractStatePreferences(bool _acceptCurrentState, bool _ignoreStateChanges)
+  external
+  returns (bool) {
+    bytes32 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState")));
+    database.setBool(keccak256(abi.encodePacked(currentState, msg.sender)), _acceptCurrentState);
+    database.setBool(keccak256(abi.encodePacked("ignoreStateChanges", msg.sender)), _ignoreStateChanges);
+    emit LogContractStatePreferenceChanged(msg.sender, _acceptCurrentState, _ignoreStateChanges);
+    return true;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+  // @notice Verify that sender is an owner
+  modifier anyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+      require(database.boolStorage(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash))));  // owners must have agreed on function + parameters
+    _;
+      database.deleteBool(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+  modifier contractExists(address _contract) {
+    require(database.boolStorage(keccak256(abi.encodePacked("contract", _contract))));
+    _;
+  }
+ 
+  modifier isTrue(bool _conditional) {
+    require(_conditional);
+    _;
+  }
+ 
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                    Events
+  // ------------------------------------------------------------------------------------------------
+  event LogContractAdded(address _contractAddress, string _name, uint _blockNumber);
+  event LogContractRemoved(address contractToDelete, string _name, uint _blockNumber);
+  event LogContractUpdated(address oldAddress, string _name, uint _blockNumber);
+  event LogNewContractLocation(address _contractAddress, string _name, uint _blockNumber);
+  event LogContractStatePreferenceChanged(address indexed _user, bool _currentStateAcceptance, bool _ignoreStateChanges);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/Database.sol.html b/coverage/lcov-report/database/Database.sol.html new file mode 100644 index 00000000..32be4532 --- /dev/null +++ b/coverage/lcov-report/database/Database.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for database/Database.sol + + + + + + + +
+
+

+ all files / database/ Database.sol +

+
+
+ 100% + Statements + 19/19 +
+
+ 100% + Branches + 12/12 +
+
+ 100% + Functions + 17/17 +
+
+ 100% + Lines + 27/27 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +16× +17× +17× +  +16× +15× +  +  +  +  +  +  +  +  +19× +18× +17× +16× +15× +15× +  +  +  +  +  +  +142× +  +  +  +  +  +67× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +87× +  +  +  +  +  +445× +  +  +  +  +  +1× +  +  +  +  +  +  +  +7× +  +  +  +  +  +23× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +1× +  +  +  +  +  +7× +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +786× +785× +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+// @title A shared storage contract for platform contracts to store and retrieve data
+// @notice This contract holds all long-term data for smart-contract systems
+// @dev The bytes32 hashes are derived from keccak256(variableName, uniqueID) => value
+// @dec Can enable upgradeable contracts by setting a contract manager
+contract Database{
+ 
+    // Storage Variables
+    mapping(bytes32 => uint) public uintStorage;
+    mapping(bytes32 => string) public stringStorage;
+    mapping(bytes32 => address) public addressStorage;
+    mapping(bytes32 => bytes) public bytesStorage;
+    mapping(bytes32 => bytes32) public bytes32Storage;
+    mapping(bytes32 => bool) public boolStorage;
+    mapping(bytes32 => int) public intStorage;
+ 
+ 
+ 
+    // @notice Constructor: Sets the owners of the platform
+    // @dev Owners must set the contract manager to add more contracts
+    constructor(address[] _owners, bool _upgradeable) public {
+      for(uint i=0; i<_owners.length; i++){
+        boolStorage[keccak256(abi.encodePacked("owner", _owners[i]))] = true;
+        emit LogInitialized(_owners[i], _upgradeable);
+      }
+      if (_upgradeable){
+        boolStorage[keccak256("upgradeable")] = true;
+      }
+    }
+ 
+ 
+    // @notice ContractManager will be the only contract that can add/remove contracts on the platform.
+    // @param (address) _contractManager is the contract which can upgrade/remove contracts to platform
+    function enableContractManagement(address _contractManager)
+    external {
+        require(boolStorage[keccak256("upgradeable")]);
+        require(_contractManager != address(0));
+        require(boolStorage[keccak256(abi.encodePacked("owner", msg.sender))]);
+        require(addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] == address(0));
+        addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] = _contractManager;
+        boolStorage[keccak256(abi.encodePacked("contract", _contractManager))] = true;
+    }
+ 
+    // @notice Storage functions
+    function setAddress(bytes32 _key, address _value)
+    onlyApprovedContract
+    external {
+        addressStorage[_key] = _value;
+    }
+ 
+    function setUint(bytes32 _key, uint _value)
+    onlyApprovedContract
+    external {
+        uintStorage[_key] = _value;
+    }
+ 
+    function setString(bytes32 _key, string _value)
+    onlyApprovedContract
+    external {
+        stringStorage[_key] = _value;
+    }
+ 
+    function setBytes(bytes32 _key, bytes _value)
+    onlyApprovedContract
+    external {
+        bytesStorage[_key] = _value;
+    }
+ 
+    function setBytes32(bytes32 _key, bytes32 _value)
+    onlyApprovedContract
+    external {
+        bytes32Storage[_key] = _value;
+    }
+ 
+    function setBool(bytes32 _key, bool _value)
+    onlyApprovedContract
+    external {
+        boolStorage[_key] = _value;
+    }
+ 
+    function setInt(bytes32 _key, int _value)
+    onlyApprovedContract
+    external {
+        intStorage[_key] = _value;
+    }
+ 
+ 
+    // Deletion functions: Can alternatively use setter functions and set to null value (ie. uint = 0)
+    function deleteAddress(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete addressStorage[_key];
+    }
+ 
+    function deleteUint(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete uintStorage[_key];
+    }
+ 
+    function deleteString(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete stringStorage[_key];
+    }
+ 
+    function deleteBytes(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete bytesStorage[_key];
+    }
+ 
+    function deleteBytes32(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete bytes32Storage[_key];
+    }
+ 
+    function deleteBool(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete boolStorage[_key];
+    }
+ 
+    function deleteInt(bytes32 _key)
+    onlyApprovedContract
+    external {
+        delete intStorage[_key];
+    }
+ 
+ 
+    // --------------------------------------------------------------------------------------
+    //                                     Modifiers
+    // --------------------------------------------------------------------------------------
+ 
+    // Caller must be registered as a contract through ContractManager.sol
+    modifier onlyApprovedContract() {
+        require(boolStorage[keccak256(abi.encodePacked("contract", msg.sender))]);
+        _;
+    }
+ 
+    // --------------------------------------------------------------------------------------
+    //                                     Events
+    // --------------------------------------------------------------------------------------
+    event LogInitialized(address _owner, bool _upgradeable);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/Events.sol.html b/coverage/lcov-report/database/Events.sol.html new file mode 100644 index 00000000..dc7493a1 --- /dev/null +++ b/coverage/lcov-report/database/Events.sol.html @@ -0,0 +1,140 @@ + + + + Code coverage report for database/Events.sol + + + + + + + +
+
+

+ all files / database/ Events.sol +

+
+
+ 0% + Statements + 0/2 +
+
+ 0% + Branches + 0/2 +
+
+ 0% + Functions + 0/2 +
+
+ 0% + Lines + 0/3 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './Database.sol';
+ 
+contract Events {
+  Database public database;
+  // @dev This will emit the event from the Event contract
+  function numberStored(address _sender, uint _number)
+  external
+  onlyApprovedContract {
+      emit LogFavoriteNumberAdded(_sender, _number);
+  }
+ 
+  event LogFavoriteNumberAdded(address indexed _sender, uint _number);
+ 
+ 
+  // --------------------------------------------------------------------------------------
+  // Caller must be registered as a contract through ContractManager.sol
+  // --------------------------------------------------------------------------------------
+  modifier onlyApprovedContract() {
+      require(database.boolStorage(keccak256(abi.encodePacked("contract", msg.sender))));
+      _;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/HashEncode.sol.html b/coverage/lcov-report/database/HashEncode.sol.html new file mode 100644 index 00000000..9c37ca61 --- /dev/null +++ b/coverage/lcov-report/database/HashEncode.sol.html @@ -0,0 +1,131 @@ + + + + Code coverage report for database/HashEncode.sol + + + + + + + +
+
+

+ all files / database/ HashEncode.sol +

+
+
+ 0% + Statements + 0/6 +
+
+ 100% + Branches + 0/0 +
+
+ 0% + Functions + 0/6 +
+
+ 0% + Lines + 0/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+library HashEncode {
+  //Overloaded functions
+  function encode(string _label, bytes32 _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, bytes32 _arg1, bytes32 _arg2) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1, _arg2));
+  }
+  function encode(string _label, bytes32 _arg1, uint _arg2) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1, _arg2));
+  }
+  function encode(string _label, address _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, uint _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+  function encode(string _label, bool _arg1) pure public returns(bytes32){
+    return keccak256(abi.encodePacked(_label, _arg1));
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/database/index.html b/coverage/lcov-report/database/index.html new file mode 100644 index 00000000..85354c66 --- /dev/null +++ b/coverage/lcov-report/database/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for database/ + + + + + + + +
+
+

+ all files database/ +

+
+
+ 54.78% + Statements + 63/115 +
+
+ 84.62% + Branches + 22/26 +
+
+ 54.93% + Functions + 39/71 +
+
+ 60.71% + Lines + 85/140 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
API.sol
36.76%25/68100%0/037.84%14/3736.76%25/68
ContractManager.sol
95%19/2083.33%10/1288.89%8/991.67%33/36
Database.sol
100%19/19100%12/12100%17/17100%27/27
Events.sol
0%0/20%0/20%0/20%0/3
HashEncode.sol
0%0/6100%0/00%0/60%0/6
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ecosystem/AssetExchange.sol.html b/coverage/lcov-report/ecosystem/AssetExchange.sol.html new file mode 100644 index 00000000..b0a1c56e --- /dev/null +++ b/coverage/lcov-report/ecosystem/AssetExchange.sol.html @@ -0,0 +1,791 @@ + + + + Code coverage report for ecosystem/AssetExchange.sol + + + + + + + +
+
+

+ all files / ecosystem/ AssetExchange.sol +

+
+
+ 100% + Statements + 55/55 +
+
+ 92.5% + Branches + 37/40 +
+
+ 100% + Functions + 15/15 +
+
+ 100% + Lines + 66/66 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +3× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +3× +3× +2× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +3× +3× +2× +1× +1× +1× +  +2× +2× +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +3× +2× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +10× +9× +8× +  +  +  +  +  +  +10× +9× +  +  +  +  +  +  +11× +10× +  +  +  +  +  +8× +8× +  +  +  +  +  +  +8× +7× +  +  +  +  +  +  +7× +6× +  +  +  +  +  +  +4× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/DivToken.sol';
+import "../access/ERC20Burner.sol";
+ 
+ 
+// @title Simple decentralized exchange contract
+// @notice A sample contract to implement rudimentary asset-token trading
+// @dev Note: Users can only have 1 sell order and 1 buy order for each individual asset
+// @dev The orders are stored as as sha3 hash of critical parameters to save storage costs
+contract AssetExchange {
+  using SafeMath for uint;
+ 
+  Database public database;
+  ERC20Burner private burner;
+ 
+  mapping (address => mapping (bytes32 => bool)) public orders;  // Hash of (assetID, sellerAddress, amountToBuy, price, boolean(BuyOrder = true))
+ 
+  mapping (address => uint) public weiDeposited;
+  mapping (address => uint) public weiOwed;
+  uint private decimals = uint256(1e18);
+ 
+ 
+  // @notice constructor: initializes database
+  // @param: the address for the database contract used by this platform
+  constructor(address _database)
+  public {
+    database = Database(_database);
+    burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+  }
+ 
+  // Gives Ether sent to initatior of this sellOrder and transfers ownership units of asset to purchaser
+  // Note: Check if creator of sell order has enough ownership units left
+  // @Param: ID of the asset, which these ownershipUnits belong to
+  // @Param: Address of the user who created SellOrder
+  // @Param: Number of ownershipUnits being traded
+  // @Param: The WEI cost per unit
+  function buyAsset(bytes32 _assetID, address _seller, uint _amount, uint _price)
+  external
+  payable
+  whenNotPaused
+  isAllowed(_assetID, _seller, _amount)
+  burnRequired
+  returns (bool){
+    bytes32 thisOrder = keccak256(abi.encodePacked(_assetID, _seller, _amount, _price, false));
+    require(orders[_seller][thisOrder]);
+    require(msg.value == _amount.mul(_price).div(decimals));
+    DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    Erequire(assetToken.transferFrom(_seller, msg.sender, _amount));
+    weiOwed[_seller] = weiOwed[_seller].add(msg.value);
+    delete orders[_seller][thisOrder];
+    emit LogSellOrderCompleted(thisOrder, _assetID, msg.sender);
+    return true;
+  }
+ 
+  // Settles an open SellOrder, giving the deposited ether to sender and sender tokens to initiator of BuyOrder
+  // @Param: ID of the asset, which senders ownershipUnits belong to
+  // @Param: Address of the user who created BuyOrder
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  function sellAsset(bytes32 _assetID, address _buyer, uint _amount, uint _price)
+  public
+  whenNotPaused
+  isAllowed(_assetID, msg.sender, _amount)
+  returns (bool){
+    bytes32 thisOrder = keccak256(abi.encodePacked(_assetID, _buyer, _amount, _price, true));       // Get order ID
+    require(orders[_buyer][thisOrder]);    // Check order exists
+    uint value = _amount.mul(_price).div(decimals);
+    DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    Erequire(assetToken.transferFrom(msg.sender, _buyer, _amount));
+    weiDeposited[_buyer] = weiDeposited[_buyer].sub(value);
+    weiOwed[msg.sender] = weiOwed[msg.sender].add(value);
+    delete orders[_buyer][thisOrder];
+    emit LogBuyOrderCompleted(thisOrder, _assetID, msg.sender);
+    return true;
+  }
+ 
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset, which the sender wants to purchase ownershipUnits of
+  // @Param: Number of ownershipUnits being bought
+  // @Param: The WEI cost per unit
+  function createBuyOrder(bytes32 _assetID, uint _amount, uint _price)
+  external
+  payable
+  requiresEther
+  aboveZero(_amount, _price)
+  validAsset(_assetID)
+  burnRequired
+  returns (bool) {
+    require(msg.value == _amount.mul(_price).div(decimals));
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, true));
+    require(!orders[msg.sender][orderID]);
+    orders[msg.sender][orderID] = true;
+    weiDeposited[msg.sender] = weiDeposited[msg.sender].add(msg.value);
+    emit LogBuyOrderCreated(orderID, _assetID, msg.sender);
+    emit LogBuyOrderDetails(orderID, _amount, _price);
+    return true;
+  }
+ 
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset, which sender is trying to sell
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  function createSellOrder(bytes32 _assetID, uint _amount, uint _price)
+  external
+  aboveZero(_amount, _price)
+  validAsset(_assetID)
+  isAllowed(_assetID, msg.sender, _amount)
+  returns (bool) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, false));
+    require(!orders[msg.sender][orderID]);
+    orders[msg.sender][orderID] = true;
+    emit LogSellOrderCreated(orderID, _assetID, msg.sender);
+    emit LogSellOrderDetails(orderID, _amount, _price);
+    return true;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Create a BuyOrder and leave WEI as a deposit for user that picks up order
+  // @Param: ID of the asset
+  // @Param: Number of ownershipUnits being sold
+  // @Param: The WEI cost per unit
+  // @Param: Is this order a BuyOrder?
+  //------------------------------------------------------------------------------------------------------------------
+  function deleteOrder(bytes32 _assetID, uint _amount, uint _price, bool _buyOrder)
+  external
+  returns (bool) {
+    bytes32 orderID = keccak256(abi.encodePacked(_assetID, msg.sender, _amount, _price, _buyOrder));
+    require(orders[msg.sender][orderID]);
+    if (_buyOrder) {
+      uint returnValue = _amount.mul(_price).div(decimals);
+      weiDeposited[msg.sender] = weiDeposited[msg.sender].sub(returnValue);
+      weiOwed[msg.sender] = weiOwed[msg.sender].add(returnValue);
+    }
+    delete orders[msg.sender][orderID];
+    return true;
+  }
+  //------------------------------------------------------------------------------------------------------------------
+  // User can withdraw the wei they are owed here
+  //------------------------------------------------------------------------------------------------------------------
+  function withdraw()
+  external
+  whenNotPaused
+  returns (bool){
+    uint owed = weiOwed[msg.sender];
+    weiOwed[msg.sender] = 0;
+    msg.sender.transfer(owed);
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // @notice Destroys contract and sends WEI to _holdingAddress
+  //------------------------------------------------------------------------------------------------------------------
+  function destroy(address _functionInitiator, address _holdingAddress)
+  anyOwner
+  public {
+    require(_functionInitiator != msg.sender);
+    require(database.boolStorage(keccak256(abi.encodePacked(address(this), _functionInitiator, "destroy", keccak256(abi.encodePacked(_holdingAddress))))));
+    emit LogDestruction(_holdingAddress, address(this).balance, msg.sender);
+    selfdestruct(_holdingAddress);
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                      Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // This verifies that the asset is registered on the MyBit Platform and has successfully completed funding
+  //------------------------------------------------------------------------------------------------------------------
+  modifier validAsset(bytes32 _assetID) {
+    require (_assetID != bytes32(0));
+    require (database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Check if user has enough ownershipUnits to create SellOrder
+  //------------------------------------------------------------------------------------------------------------------
+  modifier isAllowed(bytes32 _assetID, address _sender, uint _tokens) {
+    require(DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)))).allowance(_sender, address(this)) >= _tokens);
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verifies that _amount or _price aren't null
+  //------------------------------------------------------------------------------------------------------------------
+  modifier aboveZero(uint _amount, uint _price) {
+    require(_amount.mul(_price) > 0);
+    _;
+  }
+ 
+  // @notice reverts if user hasn't approved burner to burn platform token
+  modifier burnRequired {
+    //emit LogSig(msg.sig);
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verify contract isn't paused
+  //------------------------------------------------------------------------------------------------------------------
+  modifier whenNotPaused {
+    require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))));
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Throw if Ether hasn't been sent
+  //------------------------------------------------------------------------------------------------------------------
+  modifier requiresEther() {
+    require(msg.value > 0);
+    _;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Verify that the sender is a registered owner
+  //------------------------------------------------------------------------------------------------------------------
+  modifier anyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                      Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  event LogDestruction(address indexed _locationSent, uint indexed _amountSent, address indexed _caller);
+  event LogBuyOrderCreated(bytes32 _orderID, bytes32 indexed _assetID, address indexed _creator);
+  event LogBuyOrderCompleted(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _purchaser);
+  event LogSellOrderCreated(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _creator);
+  event LogSellOrderCompleted(bytes32 _orderID, bytes32 indexed _assetAddress, address indexed _purchaser);
+  event LogBuyOrderDetails(bytes32 _orderID, uint indexed _amount, uint indexed _price);
+  event LogSellOrderDetails(bytes32 orderID, uint indexed _amount, uint indexed _price);
+  event LogownershipUnitsTraded(bytes32 _assetID, address _from, address _to, uint _amount);
+  event LogSig(bytes4 _sig);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ecosystem/AssetGenerator.sol.html b/coverage/lcov-report/ecosystem/AssetGenerator.sol.html new file mode 100644 index 00000000..251a7c2d --- /dev/null +++ b/coverage/lcov-report/ecosystem/AssetGenerator.sol.html @@ -0,0 +1,290 @@ + + + + Code coverage report for ecosystem/AssetGenerator.sol + + + + + + + +
+
+

+ all files / ecosystem/ AssetGenerator.sol +

+
+
+ 100% + Statements + 17/17 +
+
+ 70% + Branches + 7/10 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 24/24 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +2× +1× +1× +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +2× +1× +1× +1× +1× +1× +4× +  +1× +1× +1× +1× +1× +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+import "../interfaces/DBInterface.sol";
+import "../access/ERC20Burner.sol";
+import "../tokens/erc20/DividendToken.sol";
+import "../tokens/distribution/FixedDistribution.sol";
+ 
+// @title An asset generator contract for onboarding existing real-world assets
+// @author Kyle Dewhurst, MyBit Foundation
+contract AssetGenerator {
+  using SafeMath for uint256;
+ 
+  DBInterface private database;
+ 
+ 
+  // @notice This contract
+  // @param: The address for the database contract used by this platform
+  constructor(address _database)
+  public{
+      database = DBInterface(_database);
+  }
+ 
+ 
+  // @notice users can on-board non-tradeable assets here
+  // @dev creates an ERC20 dividend token (tradeable) or distribution token (not-tradeable)
+  function createAsset(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  external
+  burnRequired
+  returns (bool) {
+    require (_tokenHolders.length == _amount.length && _tokenHolders.length <= 200);
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _tokenURI));
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", assetID))) == address(0));
+    FixedDistribution assetInstance = new FixedDistribution(_tokenURI, _tokenHolders, _amount);
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), address(assetInstance));
+    emit LogAssetCreated(assetID, address(assetInstance), msg.sender, _tokenURI);
+    return true;
+  }
+ 
+  // @notice users can on-board tradeable assets here
+  // @dev creates an ERC20 dividend token (tradeable) or
+  function createTradeableAsset(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  external
+  burnRequired
+  returns (bool) {
+    require (_tokenHolders.length == _amount.length && _tokenHolders.length <= uint8(200));
+    address assetGeneratorAddress = database.addressStorage(keccak256(abi.encodePacked("contract", "AssetGenerator")));
+    bytes32 assetID = keccak256(abi.encodePacked(msg.sender, _tokenURI));
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", assetID))) == address(0));
+    DividendToken assetInstance = new DividendToken(_tokenURI, assetGeneratorAddress);   // Gives this contract all new asset tokens
+    for (uint8 i = 0; i < _tokenHolders.length; i++) {
+      assetInstance.mint(_tokenHolders[i], _amount[i]);
+    }
+    assetInstance.finishMinting();
+    database.setAddress(keccak256(abi.encodePacked("assetManager", assetID)), msg.sender);
+    database.setAddress(keccak256(abi.encodePacked("tokenAddress", assetID)), address(assetInstance));
+    emit LogTradeableAssetCreated(assetID, address(assetInstance), msg.sender, _tokenURI);
+    return true;
+  }
+ 
+ 
+  // @notice reverts if user hasn't approved burner to burn platform token
+  modifier burnRequired {
+    ERC20Burner burner = ERC20Burner(database.addressStorage(keccak256(abi.encodePacked("contract", "ERC20Burner"))));
+    Erequire(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this))))));
+    _;
+  }
+ 
+ 
+  event LogAssetCreated(bytes32 indexed _assetID, address indexed _tokenAddress, address indexed _assetManager, string _tokenURI);
+  event LogTradeableAssetCreated(bytes32 indexed _assetID, address indexed _tokenAddress, address indexed _assetManager, string _tokenURI);
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ecosystem/PlatformFunds.sol.html b/coverage/lcov-report/ecosystem/PlatformFunds.sol.html new file mode 100644 index 00000000..a88d9b0e --- /dev/null +++ b/coverage/lcov-report/ecosystem/PlatformFunds.sol.html @@ -0,0 +1,230 @@ + + + + Code coverage report for ecosystem/PlatformFunds.sol + + + + + + + +
+
+

+ all files / ecosystem/ PlatformFunds.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56  +  +  +  +  +  +  +  +  +  +  +9× +  +  +  +  +  +  +  +7× +7× +  +  +  +  +  +  +9× +9× +  +  +  +  +  +  +  +  +18× +16× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+contract PlatformFunds {
+ 
+  Database public database;
+ 
+  // @notice initialize database
+  constructor(address _database)
+  public {
+    database = Database(_database);
+  }
+ 
+  // @notice owners must set the wallet to receive payments here before initiating crowdsale
+  // @dev will overwrite old wallet address
+  function setPlatformWallet(address _walletAddress)
+  external
+  onlyOwner {
+    database.setAddress(keccak256(abi.encodePacked("platformWallet")), _walletAddress);
+    emit LogPlatformWallet(_walletAddress);
+  }
+ 
+  // @notice
+  function setPlatformToken(address _tokenAddress)
+  external
+  onlyOwner {
+    database.setAddress(keccak256(abi.encodePacked("platformToken")), _tokenAddress);
+    emit LogPlatformToken(_tokenAddress);
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Modifiers                                                                     //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Events                                                                        //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+  event LogPlatformWallet(address _platformWallet);
+  event LogPlatformToken(address _platformToken);
+ 
+ 
+ 
+ 
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ecosystem/Staking.sol.html b/coverage/lcov-report/ecosystem/Staking.sol.html new file mode 100644 index 00000000..61ac1253 --- /dev/null +++ b/coverage/lcov-report/ecosystem/Staking.sol.html @@ -0,0 +1,272 @@ + + + + Code coverage report for ecosystem/Staking.sol + + + + + + + +
+
+

+ all files / ecosystem/ Staking.sol +

+
+
+ 0% + Statements + 0/14 +
+
+ 0% + Branches + 0/10 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/18 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
  pragma solidity 0.4.24;
+ 
+  import "../math/SafeMath.sol";
+  import "../database/Database.sol";
+  import "../interfaces/ERC20.sol";
+  import "../tokens/distribution/MintableDistribution.sol";
+ 
+ 
+ 
+  // @title A contract for investors to loan ERC20 tokens to assetManagers who require escrow
+  // @author Kyle Dewhurst, MyBit Foundation
+  // @notice AssetManager can lock his escrow in this contract and retrieve it if asset funding fails or successfully returns ROI
+  contract Staking {
+ 
+    Database public database;
+ 
+ 
+    constructor(address _database)
+    public {
+      database = Database(_database);
+    }
+ 
+    // @notice AssetManager can request for a staker to lend tokens to cover escrow
+    function requestStaking(string _tokenURI, bytes32 _assetID, uint _amount, uint _sharePercentage)
+    external
+    returns (bool) {
+      bytes32 agreementHash = keccak256(abi.encodePacked(msg.sender, _assetID, _amount, _sharePercentage));
+      database.setBytes32(_assetID, agreementHash);
+      MintableDistribution mintableDistribution = new MintableDistribution(_tokenURI, address(this));
+      database.setAddress(keccak256(abi.encodePacked("stakingMint", _assetID)), address(mintableDistribution));
+      return true;
+    }
+ 
+    // @notice staker can purchase all of
+    function purchaseStake(bytes32 _assetID, address _requester, uint _amount, uint _sharePercentage)
+    external
+    returns (bool) {
+      bytes32 agreementHash = keccak256(abi.encodePacked(_requester, _assetID, _amount, _sharePercentage));
+      require (database.bytes32Storage(_assetID) == agreementHash);
+      ERC20 stakingToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      MintableDistribution distributionToken = MintableDistribution(database.addressStorage(keccak256(abi.encodePacked("stakingMint", _assetID))));
+      bytes32 finalAgreement = keccak256(abi.encodePacked(msg.sender, agreementHash));
+      database.setBytes32(_assetID, finalAgreement);
+      require(stakingToken.transfer(_requester, _amount));
+      require(distributionToken.mint(msg.sender, _amount));
+      require(distributionToken.finishMinting());
+      return true;
+    }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  // Don't accept null value for bytes32 parameter
+  //------------------------------------------------------------------------------------------------------------------
+  modifier noEmptyBytes(bytes32 _data) {
+    require(_data != bytes32(0));
+    _;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                            Events
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ecosystem/index.html b/coverage/lcov-report/ecosystem/index.html new file mode 100644 index 00000000..cde3c292 --- /dev/null +++ b/coverage/lcov-report/ecosystem/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for ecosystem/ + + + + + + + +
+
+

+ all files ecosystem/ +

+
+
+ 84.44% + Statements + 76/90 +
+
+ 74.19% + Branches + 46/62 +
+
+ 85.19% + Functions + 23/27 +
+
+ 84.35% + Lines + 97/115 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetExchange.sol
100%55/5592.5%37/40100%15/15100%66/66
AssetGenerator.sol
100%17/1770%7/10100%4/4100%24/24
PlatformFunds.sol
100%4/4100%2/2100%4/4100%7/7
Staking.sol
0%0/140%0/100%0/40%0/18
+
+
+ + + + + + + diff --git a/coverage/lcov-report/index.html b/coverage/lcov-report/index.html new file mode 100644 index 00000000..ac7c2a6f --- /dev/null +++ b/coverage/lcov-report/index.html @@ -0,0 +1,223 @@ + + + + Code coverage report for All files + + + + + + + +
+
+

+ / +

+
+
+ 75.06% + Statements + 596/794 +
+
+ 66.24% + Branches + 257/388 +
+
+ 72.56% + Functions + 230/317 +
+
+ 75.92% + Lines + 744/980 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
access/
100%34/3483.33%20/24100%21/21100%47/47
crowdsale/
93.46%100/10768.09%64/9488.89%32/3693.67%148/158
database/
54.78%63/11584.62%22/2654.93%39/7160.71%85/140
ecosystem/
84.44%76/9074.19%46/6285.19%23/2784.35%97/115
interfaces/
100%0/0100%0/0100%0/0100%0/0
math/
100%12/12100%8/8100%5/5100%12/12
ownership/
32.47%25/7737.5%9/2441.38%12/2932.71%35/107
roles/
73.64%81/11044.57%41/9290.48%19/2177.1%101/131
test/
48.84%21/43100%4/445.71%16/3546.67%21/45
tokens/distribution/
82.22%37/4575%6/883.33%15/1882%41/50
tokens/erc20/
91.3%147/16180.43%37/4688.89%48/5489.71%157/175
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/ApproveAndCallFallback.sol.html b/coverage/lcov-report/interfaces/ApproveAndCallFallback.sol.html new file mode 100644 index 00000000..d10f049f --- /dev/null +++ b/coverage/lcov-report/interfaces/ApproveAndCallFallback.sol.html @@ -0,0 +1,83 @@ + + + + Code coverage report for interfaces/ApproveAndCallFallback.sol + + + + + + + +
+
+

+ all files / interfaces/ ApproveAndCallFallback.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @notice Receive approval and then execute function
+interface ApproveAndCallFallBack {
+    function receiveApproval(address from, uint tokens, address token, bytes data) external;
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/BurnERC20.sol.html b/coverage/lcov-report/interfaces/BurnERC20.sol.html new file mode 100644 index 00000000..537d6688 --- /dev/null +++ b/coverage/lcov-report/interfaces/BurnERC20.sol.html @@ -0,0 +1,101 @@ + + + + Code coverage report for interfaces/BurnERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ BurnERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+interface BurnERC20 {
+ 
+    function burnFrom(address _tokenHolder, uint _amount) external returns (bool success);
+ 
+    function burn(uint _amount) external returns (bool success);
+ 
+    event LogBurn(address indexed _spender, uint256 _value);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/BurnableERC20.sol.html b/coverage/lcov-report/interfaces/BurnableERC20.sol.html new file mode 100644 index 00000000..d13bd461 --- /dev/null +++ b/coverage/lcov-report/interfaces/BurnableERC20.sol.html @@ -0,0 +1,146 @@ + + + + Code coverage report for interfaces/BurnableERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ BurnableERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @title An interface to interact with Burnable ERC20 tokens 
+interface BurnableERC20 { 
+ 
+  function allowance(address tokenOwner, address spender) external view returns (uint remaining);
+  
+  function burnFrom(address _tokenHolder, uint _amount) external returns (bool success); 
+ 
+  function burn(uint _amount) external returns (bool success); 
+  
+  function totalSupply() external view returns (uint256);
+ 
+  function balanceOf(address _who) external view returns (uint256);
+ 
+  function transfer(address _to, uint256 _value) external returns (bool);
+ 
+  function approve(address _spender, uint256 _value) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
+ 
+  event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+  event Approval(address indexed owner, address indexed spender, uint256 value);
+ 
+  event LogBurn(address indexed _spender, uint256 _value); 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/DBInterface.sol.html b/coverage/lcov-report/interfaces/DBInterface.sol.html new file mode 100644 index 00000000..1a0822fd --- /dev/null +++ b/coverage/lcov-report/interfaces/DBInterface.sol.html @@ -0,0 +1,341 @@ + + + + Code coverage report for interfaces/DBInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ DBInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// Database interface
+interface DBInterface {
+ 
+  function setContractManager(address _contractManager)
+  external;
+ 
+    // --------------------Set Functions------------------------
+ 
+    function setAddress(bytes32 _key, address _value)
+    external;
+ 
+    function setUint(bytes32 _key, uint _value)
+    external;
+ 
+    function setString(bytes32 _key, string _value)
+    external;
+ 
+    function setBytes(bytes32 _key, bytes _value)
+    external;
+ 
+    function setBytes32(bytes32 _key, bytes32 _value)
+    external;
+ 
+    function setBool(bytes32 _key, bool _value)
+    external;
+ 
+    function setInt(bytes32 _key, int _value)
+    external;
+ 
+ 
+     // -------------- Deletion Functions ------------------
+ 
+    function deleteAddress(bytes32 _key)
+    external;
+ 
+    function deleteUint(bytes32 _key)
+    external;
+ 
+    function deleteString(bytes32 _key)
+    external;
+ 
+    function deleteBytes(bytes32 _key)
+    external;
+ 
+    function deleteBytes32(bytes32 _key)
+    external;
+ 
+    function deleteBool(bytes32 _key)
+    external;
+ 
+    function deleteInt(bytes32 _key)
+    external;
+ 
+    // ----------------Variable Getters---------------------
+ 
+    function uintStorage(bytes32 _key)
+    external
+    view
+    returns (uint);
+ 
+    function stringStorage(bytes32 _key)
+    external
+    view
+    returns (string);
+ 
+    function addressStorage(bytes32 _key)
+    external
+    view
+    returns (address);
+ 
+    function bytesStorage(bytes32 _key)
+    external
+    view
+    returns (bytes);
+ 
+    function bytes32Storage(bytes32 _key)
+    external
+    view
+    returns (bytes32);
+ 
+    function boolStorage(bytes32 _key)
+    external
+    view
+    returns (bool);
+ 
+    function intStorage(bytes32 _key)
+    external
+    view
+    returns (bool);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/DivToken.sol.html b/coverage/lcov-report/interfaces/DivToken.sol.html new file mode 100644 index 00000000..70310733 --- /dev/null +++ b/coverage/lcov-report/interfaces/DivToken.sol.html @@ -0,0 +1,401 @@ + + + + Code coverage report for interfaces/DivToken.sol + + + + + + + +
+
+

+ all files / interfaces/ DivToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners receive their share when transferring tokens.
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+// TODO: Suicide function
+interface DivToken {
+ 
+    // @notice Transfer _amount tokens to address _to.
+    // @dev Sender must have enough tokens. Cannot send to 0x0.
+    // @param (address) _to = The address which will receive the tokens
+    // @param (uint) _amount = The amount of tokens to send
+    function transfer(address _to, uint _amount)
+    external
+    returns (bool success);
+ 
+    // @notice A 3rd party can transfer tokens if user approves them to do so
+    // @dev Transfer _amount of tokens if _from has allowed msg.sender to do so.
+    // @param (address) _from = The address who approved msg.sender to spend tokens
+    // @param (address) _to = The address who will receive the tokens
+    // @param (uint) _amount = The number of tokens to send
+    function transferFrom(address _from, address _to, uint _amount)
+    external
+    returns (bool success);
+ 
+    // @notice approves a 3rd party to transfer msg.sender's tokens on behalf of him/her
+    // @param (address) _spender = The address of who msg.sender approves to spend tokens on their behalf
+    // @param (uint) _amount = The upper limit of how many tokens can be spent
+    function approve(address _spender, uint _amount)
+    external
+    returns (bool success);
+ 
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    external
+    returns (bool success);
+ 
+    function withdraw()
+    external
+    returns (bool);
+ 
+    // @notice Updates incomeClaimed, sends all wei to the token holder
+    function collectOwedDividends()
+    external
+    returns (uint _amount);
+ 
+ 
+    // @notice Returns amount of tokens _spender is allowed to transfer or burn
+    function allowance(address _tokenHolder, address _spender)
+    external
+    view
+    returns (uint);
+ 
+    // @notice Returns the number of tokens in circulation
+    function totalSupply()
+    external
+    view
+    returns (uint tokenSupply);
+ 
+    // @notice Returns the token balance of user
+    function balanceOf(address _tokenHolder)
+    external
+    view
+    returns (uint balance);
+ 
+    // @notice Returns the URI of this token
+    function tokenURI()
+    external
+    view
+    returns (string);
+ 
+    function valuePerToken()
+    external
+    view
+    returns (uint);
+ 
+    function scalingFactor()
+    external
+    view
+    returns (uint);
+ 
+    // @notice Calculates how much value _user holds
+    function getAmountOwed(address _user)
+    external
+    view
+    returns (uint);
+ 
+    // @notice Calculates how much wei user is owed. (points + incomeClaimed) / 10**32
+    function getOwedDividends(address _user)
+    external
+    constant
+    returns (uint);
+ 
+    function assetIncome()
+    external
+    view
+    returns (uint);
+ 
+    function getERC20()
+    external
+    view
+    returns (address);
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogIncomeCollected(uint _block, address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/ERC20.sol.html b/coverage/lcov-report/interfaces/ERC20.sol.html new file mode 100644 index 00000000..fc66e280 --- /dev/null +++ b/coverage/lcov-report/interfaces/ERC20.sol.html @@ -0,0 +1,137 @@ + + + + Code coverage report for interfaces/ERC20.sol + + + + + + + +
+
+

+ all files / interfaces/ ERC20.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+ 
+/**
+ * @title ERC20 interface
+ * @dev see https://github.com/ethereum/EIPs/issues/20
+ */
+interface ERC20 {
+  function totalSupply() external view returns (uint256);
+ 
+  function balanceOf(address _who) external view returns (uint256);
+ 
+  function allowance(address _owner, address _spender) external view returns (uint256);
+ 
+  function transfer(address _to, uint256 _value) external returns (bool);
+ 
+  function approve(address _spender, uint256 _value) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
+ 
+  event Transfer(address indexed from, address indexed to, uint256 value);
+ 
+  event Approval(address indexed owner, address indexed spender, uint256 value);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/ERC20DividendInterface.sol.html b/coverage/lcov-report/interfaces/ERC20DividendInterface.sol.html new file mode 100644 index 00000000..904464fa --- /dev/null +++ b/coverage/lcov-report/interfaces/ERC20DividendInterface.sol.html @@ -0,0 +1,113 @@ + + + + Code coverage report for interfaces/ERC20DividendInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ ERC20DividendInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface ERC20DividendInterface{
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount) external returns (bool);
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting() external returns (bool);
+ 
+  function issueDividends(uint _amount) external;
+ 
+  // @dev Total number of tokens in existence
+  function totalSupply() external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/EtherDividendInterface.sol.html b/coverage/lcov-report/interfaces/EtherDividendInterface.sol.html new file mode 100644 index 00000000..864c70e6 --- /dev/null +++ b/coverage/lcov-report/interfaces/EtherDividendInterface.sol.html @@ -0,0 +1,113 @@ + + + + Code coverage report for interfaces/EtherDividendInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ EtherDividendInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface EtherDividendInterface{
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount) external returns (bool);
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting() external returns (bool);
+ 
+  function issueDividends() external payable;
+ 
+  // @dev Total number of tokens in existence
+  function totalSupply() external view returns (uint256);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/GovToken.sol.html b/coverage/lcov-report/interfaces/GovToken.sol.html new file mode 100644 index 00000000..f5162422 --- /dev/null +++ b/coverage/lcov-report/interfaces/GovToken.sol.html @@ -0,0 +1,119 @@ + + + + Code coverage report for interfaces/GovToken.sol + + + + + + + +
+
+

+ all files / interfaces/ GovToken.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+interface GovToken {
+ 
+  function totalSupply() external returns (uint);
+ 
+  function balanceOf(address _user) external returns (uint);
+ 
+  function unlockTokens() external returns (bool);
+ 
+  function lockTokens() external returns (bool); 
+ 
+  function transfer(address _to, uint _amount) external returns (bool);
+ 
+  function transferFrom(address _from, address _to, uint _amount) external returns (bool);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/PullPayment.sol.html b/coverage/lcov-report/interfaces/PullPayment.sol.html new file mode 100644 index 00000000..fb41a14a --- /dev/null +++ b/coverage/lcov-report/interfaces/PullPayment.sol.html @@ -0,0 +1,89 @@ + + + + Code coverage report for interfaces/PullPayment.sol + + + + + + + +
+
+

+ all files / interfaces/ PullPayment.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+// @notice allows contract to call a basic withdraw() function taking no parameters on another contract
+interface PullPayment {
+ 
+	function withdraw()	external returns(bool);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/TokenFactoryInterface.sol.html b/coverage/lcov-report/interfaces/TokenFactoryInterface.sol.html new file mode 100644 index 00000000..62976f10 --- /dev/null +++ b/coverage/lcov-report/interfaces/TokenFactoryInterface.sol.html @@ -0,0 +1,92 @@ + + + + Code coverage report for interfaces/TokenFactoryInterface.sol + + + + + + + +
+
+

+ all files / interfaces/ TokenFactoryInterface.sol +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+interface TokenFactoryInterface{
+ 
+  function createEtherDividend(string _tokenURI) external returns (address);
+ 
+  function createERC20Dividend(string _tokenURI, address _erc20Address) external returns (address);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/interfaces/index.html b/coverage/lcov-report/interfaces/index.html new file mode 100644 index 00000000..ff0cb80d --- /dev/null +++ b/coverage/lcov-report/interfaces/index.html @@ -0,0 +1,223 @@ + + + + Code coverage report for interfaces/ + + + + + + + +
+
+

+ all files interfaces/ +

+
+
+ 100% + Statements + 0/0 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 0/0 +
+
+ 100% + Lines + 0/0 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ApproveAndCallFallback.sol
100%0/0100%0/0100%0/0100%0/0
BurnERC20.sol
100%0/0100%0/0100%0/0100%0/0
BurnableERC20.sol
100%0/0100%0/0100%0/0100%0/0
DBInterface.sol
100%0/0100%0/0100%0/0100%0/0
DivToken.sol
100%0/0100%0/0100%0/0100%0/0
ERC20.sol
100%0/0100%0/0100%0/0100%0/0
ERC20DividendInterface.sol
100%0/0100%0/0100%0/0100%0/0
EtherDividendInterface.sol
100%0/0100%0/0100%0/0100%0/0
GovToken.sol
100%0/0100%0/0100%0/0100%0/0
PullPayment.sol
100%0/0100%0/0100%0/0100%0/0
TokenFactoryInterface.sol
100%0/0100%0/0100%0/0100%0/0
+
+
+ + + + + + + diff --git a/coverage/lcov-report/math/SafeMath.sol.html b/coverage/lcov-report/math/SafeMath.sol.html new file mode 100644 index 00000000..c6656850 --- /dev/null +++ b/coverage/lcov-report/math/SafeMath.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for math/SafeMath.sol + + + + + + + +
+
+

+ all files / math/ SafeMath.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 12/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +149× +27× +  +122× +122× +121× +  +  +  +  +  +  +  +109× +  +  +  +  +497× +493× +  +  +  +  +474× +474× +473× +  +  +  +  +  +  +  +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
+ 
+// @title SafeMath: overflow/underflow checks
+// @notice Math operations with safety checks that throw on error
+library SafeMath {
+ 
+  // @notice Multiplies two numbers, throws on overflow.
+  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+    if (a == 0) {
+      return 0;
+    }
+    uint256 c = a * b;
+    assert(c / a == b);
+    return c;
+  }
+ 
+  // @notice Integer division of two numbers, truncating the quotient.
+  function div(uint256 a, uint256 b) internal pure returns (uint256) {
+    // assert(b > 0); // Solidity automatically throws when dividing by 0
+    // uint256 c = a / b;
+    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+    return a / b;
+  }
+ 
+  // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
+  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+    assert(b <= a);
+    return a - b;
+  }
+ 
+  // @notice Adds two numbers, throws on overflow.
+  function add(uint256 a, uint256 b) internal pure returns (uint256) {
+    uint256 c = a + b;
+    assert(c >= a);
+    return c;
+  }
+ 
+  // @notice Returns fractional amount
+  function getFractionalAmount(uint256 _amount, uint256 _percentage)
+  internal
+  pure
+  returns (uint256) {
+    return div(mul(_amount, _percentage), 100);
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/math/index.html b/coverage/lcov-report/math/index.html new file mode 100644 index 00000000..dd68e5a4 --- /dev/null +++ b/coverage/lcov-report/math/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for math/ + + + + + + + +
+
+

+ all files math/ +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 12/12 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
SafeMath.sol
100%12/12100%8/8100%5/5100%12/12
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/AssetGovernance.sol.html b/coverage/lcov-report/ownership/AssetGovernance.sol.html new file mode 100644 index 00000000..fa4aa063 --- /dev/null +++ b/coverage/lcov-report/ownership/AssetGovernance.sol.html @@ -0,0 +1,422 @@ + + + + Code coverage report for ownership/AssetGovernance.sol + + + + + + + +
+
+

+ all files / ownership/ AssetGovernance.sol +

+
+
+ 72% + Statements + 18/25 +
+
+ 62.5% + Branches + 5/8 +
+
+ 83.33% + Functions + 5/6 +
+
+ 70.97% + Lines + 22/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +4× +4× +4× +4× +4× +4× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+interface Burner { function burnEscrow(bytes32 _assetID) external returns (bool); }
+interface Escrow { function unlockEscrow(bytes32 _assetID) external returns (bool); }
+interface DB {
+  function addressStorage(bytes32 _key) external  view returns (address);
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function setUint(bytes32 _key, uint _value) external;
+}
+interface TokenView {
+  function totalSupply() external view returns (uint);
+  function balanceOf(address _tokenHolder) external view returns (uint);
+}
+ 
+// @title A contract to manage the governance of assets on the platform
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice All token holders of an asset can vote here
+contract AssetGovernance {
+  using SafeMath for uint256;
+ 
+  DB public database;
+ 
+ 
+  constructor(address _database)
+  public {
+    database = DB(_database);
+  }
+ 
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...
+  // @dev ie sha3(_assetID) or sha3(_assetID, someAddress)
+  function voteForExecution(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash, uint _amountToLock)
+  external
+  validAsset(_assetID)
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", executionID));
+    bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID, msg.sender));
+    uint256 numVotes = database.uintStorage(numVotesID);
+    uint256 investorVotes = database.uintStorage(investorVotesID);
+    require(lockTokens(_assetID, msg.sender, _amountToLock));
+    database.setUint(numVotesID, numVotes.add(_amountToLock));
+    database.setUint(investorVotesID, investorVotes.add(_amountToLock));
+    return true;
+  }
+ 
+ 
+  // @notice unlock tokens, removing them from the vote
+  // @dev _executionID should be looked up in event logs. it is equal to sha3(_assetID, _methodID, _parameterHash)
+  function unlockToken(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash, uint _amountToUnlock)
+  external
+  validAsset(_assetID)
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 voteTotalID = keccak256(abi.encodePacked("voteTotal", executionID));
+    bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID));
+    uint investorVotes = database.uintStorage(investorVotesID);
+    uint totalVotes = database.uintStorage(voteTotalID);
+    require(investorVotes <= _amountToUnlock);   // 1 vote = 1 token
+    database.setUint(voteTotalID, totalVotes.sub(_amountToUnlock));
+    database.setUint(investorVotesID, investorVotes.sub(_amountToUnlock));
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Public Functions
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice  Checks that 1/3 or more of token holders agreed on function call
+  function isConsensusReached(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    TokenView assetToken = TokenView(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", executionID));
+    uint256 numTokens = assetToken.totalSupply();
+    return database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Internal Functions
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice lock asset tokens to be able to vote
+  // @dev keeps track of how many assetTokens this investor has locked (for GovernedToken checks)
+  function lockTokens(bytes32 _assetID, address _investor, uint _amount)
+  internal
+  returns (bool) {
+    TokenView assetToken = TokenView(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    uint numTokensLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)));
+    require(_amount <= assetToken.balanceOf(_investor).sub(numTokensLocked));
+    database.setUint(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)), numTokensLocked.add(_amount));
+    return true;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  /*
+  modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) {
+    require(isConsensusReached(address(this), _assetID, _methodID, _parameterHash));   // owners must have agreed on function + parameters
+    _;
+  }
+  */
+ 
+  // @notice reverts if the asset does not have a token address set in the database
+  modifier validAsset(bytes32 _assetID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+    _;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/CollectiveOwned.sol.html b/coverage/lcov-report/ownership/CollectiveOwned.sol.html new file mode 100644 index 00000000..5d75cd5c --- /dev/null +++ b/coverage/lcov-report/ownership/CollectiveOwned.sol.html @@ -0,0 +1,401 @@ + + + + Code coverage report for ownership/CollectiveOwned.sol + + + + + + + +
+
+

+ all files / ownership/ CollectiveOwned.sol +

+
+
+ 0% + Statements + 0/17 +
+
+ 0% + Branches + 0/4 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/26 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/ERC20.sol';
+ 
+ 
+// @title A contract which allows for platform owners to come to consensus on important functionality
+// @notice Can hold any number of owners. Each getting 1 vote.
+// @dev An owner has already been initialized when database is deployed
+// @author Kyle Dewhurst, MyBit Foundation
+contract CollectiveOwned {
+  using SafeMath for uint256;
+ 
+  Database public database;
+ 
+  // @param (address) _database = the address of the platform database
+  // @param (uint) _baseQuorum = the percentage of owners needed to approve a function call
+  constructor(address _database, uint256 _baseQuorum)
+  public {
+    database = Database(_database);
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("setQuorumLevel(address, bytes4, uint256)")));
+    bytes32 functionID = keccak256(abi.encodePacked(address(this), methodID));
+    database.setUint(functionID, _baseQuorum);   // the initial quorum level to set further quorum levels
+  }
+ 
+  // @notice any owner on the platform can call this function to add a new user if it has receieve quorum level of signatures
+  // @notice must
+  // @param (address) _newOwner the address of the new owner
+  function addOwner(address _newOwner)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_newOwner)))
+  onlyOwner {
+    uint numOwners = database.uintStorage(keccak256(abi.encodePacked("numberOfOwners")));
+    database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
+    database.setUint(keccak256(abi.encodePacked("numberOfOwners")), numOwners.add(1));
+  }
+ 
+  // @notice any owner can call this function to remove an owner if the the function receives quorum level of signatures
+  // @param (address) _owner = the owner to be removed from the group of owners
+  function removeOwner(address _owner)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_owner)))
+  onlyOwner {
+    database.deleteBool(keccak256(abi.encodePacked("owner", _owner)));
+  }
+ 
+  // @notice restricts a function, forcing it to require _quorumLevel of votes to be executed
+  function setQuorumLevel(address _contractAddress, bytes4 _methodID, uint256 _quorumLevel)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_contractAddress, _methodID, _quorumLevel)))
+  returns (bool) {
+    bytes32 functionID = keccak256(abi.encodePacked(_contractAddress, _methodID));
+    database.setUint(functionID, _quorumLevel);
+    return true;
+  }
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...ie sha3(true, 55)
+  function voteForExecution(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  external
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfSignatures", executionID));
+    uint256 numSignatures = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numSignatures.add(1));
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                View Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function isQuorumReached(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    uint256 quorumLevel = database.uintStorage(keccak256(abi.encodePacked(_contractAddress, _methodID)));
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    uint256 numOwners = database.uintStorage(keccak256(abi.encodePacked("numberOfOwners")));
+    // check that number of signatures are greater than required quorum
+    return database.uintStorage(numVotesID).mul(100).div(numOwners) >= quorumLevel;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+    require(isQuorumReached(address(this), _methodID, _parameterHash));  // owners must have agreed on function + parameters
+    _;
+    database.deleteBool(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                              Events
+  //------------------------------------------------------------------------------------------------------------------
+  event LogOwnerChanged(address indexed _previousOwner, address indexed _newOwner);
+  event LogFunctionAuthorized(address indexed _owner, string indexed _functionName, bytes32 indexed _beneficiary, bytes32 _authHash);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/Pausible.sol.html b/coverage/lcov-report/ownership/Pausible.sol.html new file mode 100644 index 00000000..eeaaf6ef --- /dev/null +++ b/coverage/lcov-report/ownership/Pausible.sol.html @@ -0,0 +1,203 @@ + + + + Code coverage report for ownership/Pausible.sol + + + + + + + +
+
+

+ all files / ownership/ Pausible.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +7× +6× +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+import '../database/Database.sol';
+ 
+// @title A contract which allows for the freezing of functionality within the platform. 
+// @dev only valid with a single owned ownership model
+// @author Kyle Dewhurst, MyBit Foundation
+contract Pausible {
+ 
+  Database public database;
+ 
+  // @notice constructor: initialize database instance
+  constructor(address _database)
+  public {
+    database = Database(_database);
+  }
+ 
+  // @notice This will pause all critical activity for the supplied address
+  // @param: The address of the contract which is to be paused\
+  function pause(address _contract)
+  onlyOwner
+  public {
+    database.setBool(keccak256(abi.encodePacked("paused", _contract)), true);
+    emit LogPaused(_contract, msg.sender);
+  }
+ 
+  // @notice This will unpause all critical activity for the supplied address
+  // @param: The address of the contract which is to be unpaused
+  function unpause(address _contract)
+  onlyOwner
+  public {
+    database.deleteBool(keccak256(abi.encodePacked("paused", _contract)));
+    emit LogUnpaused(_contract, msg.sender);
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner() {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  event LogPaused(address indexed _contract, address _owner);
+  event LogUnpaused(address indexed _contract, address _owner);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/SingleOwned.sol.html b/coverage/lcov-report/ownership/SingleOwned.sol.html new file mode 100644 index 00000000..36d0813a --- /dev/null +++ b/coverage/lcov-report/ownership/SingleOwned.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for ownership/SingleOwned.sol + + + + + + + +
+
+

+ all files / ownership/ SingleOwned.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +  +2× +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +2× +1× +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+// @title A contract for managing a single platform owner
+// @dev Single owned platforms store owner as an address
+// @author Kyle Dewhurst, MyBit Foundation
+contract SingleOwned {
+ 
+  Database public database;
+ 
+  // @notice constructor: initiate database instance
+  constructor(address _database) public {
+    database = Database(_database);
+  }
+ 
+  // @notice Transfer ownership to to a new owner
+  function changeOwner(address _newOwner)
+  public
+  onlyOwner {
+    database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
+    database.setBool(keccak256(abi.encodePacked("owner", msg.sender)), false);
+    emit OwnershipTransferred(msg.sender, _newOwner);
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner() {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+  event OwnershipTransferred(address indexed owner, address indexed pendingOwner);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/TokenGovernance.sol.html b/coverage/lcov-report/ownership/TokenGovernance.sol.html new file mode 100644 index 00000000..7027abb6 --- /dev/null +++ b/coverage/lcov-report/ownership/TokenGovernance.sol.html @@ -0,0 +1,458 @@ + + + + Code coverage report for ownership/TokenGovernance.sol + + + + + + + +
+
+

+ all files / ownership/ TokenGovernance.sol +

+
+
+ 0% + Statements + 0/28 +
+
+ 0% + Branches + 0/8 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/ERC20.sol';
+ 
+ 
+// @title A contract which allows for token holders to authorize particular functions to be called
+// @notice Token holders must lock their tokens against a particular function
+// @notice Token holders can unlock their tokens, removing their vote
+// @dev An owner has already been initialized when database is deployed
+// @author Kyle Dewhurst, MyBit Foundation
+contract TokenGovernance {
+  using SafeMath for uint256;
+ 
+  Database public database;
+ 
+  ERC20 public governanceToken;
+ 
+ 
+ 
+  // @dev methodID = bytes4(sha3("functionName(parameterType, parameterType)")
+  // @dev functionID = sha3(contractAddress, methodID)
+  // @dev numVotes is sha3(contractAddress, methodID, sha3(parameter, parameter)))
+  // @dev quorumLevel = percentage of tokens required to be locked for the execution of a function
+ 
+ 
+  // @notice initiator of the platform sets the initial functions quorum level
+  // @notice quorum level dictates the number of votes required for that function to be executed
+  constructor(address _database, uint256 _baseQuorum)
+  public  {
+    governanceToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+    database = Database(_database);
+    governanceToken = ERC20(governanceToken);
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("setQuorumLevel(address, bytes4, uint256)")));
+    bytes32 functionID = keccak256(abi.encodePacked(address(this), methodID));
+    database.setUint(functionID, _baseQuorum);   // the initial quorum level to set further quorum levels
+  }
+ 
+  // @notice If restricted it will have to be called from address(this) using a voting proccess on signForFunctionCall
+  function setQuorumLevel(address _contractAddress, bytes4 _methodID, uint256 _quorumLevel)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_contractAddress, _methodID, _quorumLevel)))
+  returns (bool) {
+    bytes32 functionID = keccak256(abi.encodePacked(_contractAddress, _methodID));
+    database.setUint(functionID, _quorumLevel);
+    return true;
+  }
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...ie sha3(true, 55)
+  function voteForExecution(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash, uint256 _voteAmount)
+  external
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    require(lockTokens(_voteAmount, executionID));
+    uint256 numVotes = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numVotes.add(_voteAmount));
+    return true;
+  }
+ 
+ 
+  function unlockTokens(bytes32 _executionID)
+  external
+  returns (bool) {
+    bytes32 voteID = keccak256(abi.encodePacked("tokenVotesLocked", _executionID, msg.sender));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", _executionID));
+    uint256 amountLocked = database.uintStorage(voteID);
+    uint256 numVotes = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numVotes.sub(amountLocked));
+    governanceToken.transfer(msg.sender, amountLocked);
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Internal Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function lockTokens(uint _amountToLock, bytes32 _executionID)
+  internal
+  returns (bool) {
+    bytes32 voteID = keccak256(abi.encodePacked("tokenVotesLocked", _executionID, msg.sender));
+    require(governanceToken.transferFrom(msg.sender, address(this), _amountToLock));
+    uint256 amountLocked = database.uintStorage(voteID);
+    database.setUint(voteID, amountLocked.add(_amountToLock));
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                View Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function isQuorumReached(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    uint256 quorumLevel = database.uintStorage(keccak256(abi.encodePacked(_contractAddress, _methodID)));
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    uint256 numTokens = governanceToken.totalSupply();
+    // check that number of signatures are greater than required quorum
+    return database.uintStorage(numVotesID).mul(100).div(numTokens) >= quorumLevel;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+    require(isQuorumReached(address(this), _methodID, _parameterHash));   // owners must have agreed on function + parameters
+    _;
+    // remove votes from function call
+    database.deleteUint(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                              Events
+  //------------------------------------------------------------------------------------------------------------------
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/ownership/index.html b/coverage/lcov-report/ownership/index.html new file mode 100644 index 00000000..f23e6db1 --- /dev/null +++ b/coverage/lcov-report/ownership/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for ownership/ + + + + + + + +
+
+

+ all files ownership/ +

+
+
+ 32.47% + Statements + 25/77 +
+
+ 37.5% + Branches + 9/24 +
+
+ 41.38% + Functions + 12/29 +
+
+ 32.71% + Lines + 35/107 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetGovernance.sol
72%18/2562.5%5/883.33%5/670.97%22/31
CollectiveOwned.sol
0%0/170%0/40%0/80%0/26
Pausible.sol
100%4/4100%2/2100%4/4100%7/7
SingleOwned.sol
100%3/3100%2/2100%3/3100%6/6
TokenGovernance.sol
0%0/280%0/80%0/80%0/37
+
+
+ + + + + + + diff --git a/coverage/lcov-report/prettify.css b/coverage/lcov-report/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/coverage/lcov-report/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/lcov-report/prettify.js b/coverage/lcov-report/prettify.js new file mode 100644 index 00000000..ef51e038 --- /dev/null +++ b/coverage/lcov-report/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/lcov-report/roles/AssetManagerEscrow.sol.html b/coverage/lcov-report/roles/AssetManagerEscrow.sol.html new file mode 100644 index 00000000..d4e4cd94 --- /dev/null +++ b/coverage/lcov-report/roles/AssetManagerEscrow.sol.html @@ -0,0 +1,437 @@ + + + + Code coverage report for roles/AssetManagerEscrow.sol + + + + + + + +
+
+

+ all files / roles/ AssetManagerEscrow.sol +

+
+
+ 71.79% + Statements + 28/39 +
+
+ 50% + Branches + 16/32 +
+
+ 83.33% + Functions + 5/6 +
+
+ 77.27% + Lines + 34/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +4× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +10× +9× +8× +8× +8× +8× +8× +  +1× +  +  +  +7× +7× +7× +7× +7× +  +5× +5× +2× +  +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +  +  +  +  +  +  +  +  + 
  pragma solidity 0.4.24;
+ 
+  import "../math/SafeMath.sol";
+  import "../interfaces/DBInterface.sol";
+  import "../interfaces/DivToken.sol";
+  import "../interfaces/BurnableERC20.sol";
+ 
+  interface Governance { function isConsensusReached(address _thisContract, bytes4 _methodID, bytes32 _parameterHash) external view returns (bool); }
+ 
+  // @title A contract to hold escrow as collateral against assets
+  // @author Kyle Dewhurst, MyBit Foundation
+  // @notice AssetManager can lock his escrow in this contract and retrieve it if asset funding fails or successfully returns ROI
+  contract AssetManagerEscrow {
+    using SafeMath for uint256;
+ 
+    DBInterface public database;
+ 
+    // @notice constructor: initializes database
+    // @param: the address for the database contract used by this platform
+    constructor(address _database)
+    public {
+      database = DBInterface(_database);
+    }
+ 
+    // @dev assetID can be computed beforehand with sha3(msg.sender, _amountToRaise, _operatorID, _assetURI))
+    // @dev anybody can make the assetManager escrow if he leaves this contract with approval to transfer
+    function lockEscrow(bytes32 _assetID, uint _amount)
+    public
+    returns (bool) {
+      require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == address(0));
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, msg.sender));
+      address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken")));
+      Erequire(BurnableERC20(tokenAddress).transferFrom(msg.sender, address(this), _amount));
+      database.setUint(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID)), _amount);
+      database.setAddress(keccak256(abi.encodePacked("assetManager", _assetID)), msg.sender);
+      emit LogEscrowLocked(_assetID, assetManagerEscrowID, msg.sender, _amount);
+      return true;
+    }
+ 
+ 
+    // @notice assetManager can unlock his escrow here once funding fails or asset returns sufficient ROI
+    // @dev asset must have fundingDeadline = 0 or have ROI > 25%
+    // @dev returns escrow according to ROI. 25% ROI returns 25% of escrow, 50% ROI returns 50% of escrow etc...
+    function unlockEscrow(bytes32 _assetID)
+    public
+    returns (bool) {
+      require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == msg.sender);
+      require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) < now);
+      BurnableERC20 burnToken = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, msg.sender));
+      uint escrowRedeemed = database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID)));
+      uint unlockAmount = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).sub(escrowRedeemed);
+      if(!database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)))){
+        //If we're past deadline but crowdsale did NOT finalize, release all escrow
+        Erequire(removeAssetManager(_assetID, assetManagerEscrowID));
+      }
+      else {
+        //Past the deadline with a successful funding. Only pay back based on ROI
+        DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+        uint roi = assetToken.assetIncome().mul(100).div(assetToken.totalSupply());   // Scaled up by 10^2  (approaches 100 as asset income increases)
+        uint roiCheckpoints = roi.div(25);       // How many quarterly increments have been reached?
+        uint quarterEscrow = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).div(4);
+        require(roiCheckpoints <= 4 && roiCheckpoints > 0);    // Can't unlock escrow past 100% ROI
+        //  multiply the number of quarterly increments by a quarter of the escrow and subtract the escrow already redeemed.
+        unlockAmount = roiCheckpoints.mul(quarterEscrow).sub(escrowRedeemed);
+        require(unlockAmount > 0);
+        database.setUint(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID)), escrowRedeemed.add(unlockAmount));
+      }
+      Erequire(burnToken.transfer(msg.sender, unlockAmount));
+      return true;
+    }
+ 
+ 
+    // @notice investors can vote to call this function for the new assetManager to then call
+    // @dev new assetManager must approve this contract to transfer in and lock _ amount of platform tokens
+    function becomeAssetManager(bytes32 _assetID, address _oldAssetManager, uint256 _amount, bool _burn)
+    external
+    hasConsensus(_assetID, msg.sig, keccak256(abi.encodePacked(_assetID, _oldAssetManager, msg.sender, _amount, _burn)))
+    returns (bool) {
+      address currentAssetManager = database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID)));
+      require(currentAssetManager != msg.sender && currentAssetManager == _oldAssetManager);
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, _oldAssetManager));
+      uint oldEscrowRemaining = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).sub(database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID))));
+      BurnableERC20 token = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      require(removeAssetManager(_assetID, assetManagerEscrowID));
+      if (_burn) { require(token.burn(oldEscrowRemaining)); }
+      else { require(token.transfer(_oldAssetManager, oldEscrowRemaining));  }
+      require(lockEscrow(_assetID, _amount));
+      return true;
+    }
+ 
+    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //                                            Internal Functions
+    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+    function removeAssetManager(bytes32 _assetID, bytes32 _assetManagerEscrowID)
+    internal
+    returns (bool) {
+        database.deleteAddress(keccak256(abi.encodePacked("assetManager", _assetID)));
+        database.deleteUint(keccak256(abi.encodePacked("assetManagerEscrow", _assetManagerEscrowID)));
+        database.deleteUint(keccak256(abi.encodePacked("escrowRedeemed", _assetManagerEscrowID)));
+        return true;
+    }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+    // @notice add this modifer to functions that you want multi-sig requirements for
+    // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+    modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) {
+      bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", keccak256(abi.encodePacked(address(this), _assetID, _methodID, _parameterHash))));
+      uint256 numTokens = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)))).totalSupply();
+      Irequire(database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33, 'Consensus not reached');
+      _;
+    }
+ 
+ 
+    event LogEscrowBurned(bytes32 indexed _assetID, address indexed _assetManager, uint _amountBurnt);
+    event LogEscrowLocked(bytes32 indexed _assetID, bytes32 indexed _assetManagerEscrowID, address indexed _assetManager, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/roles/AssetManagerFunds.sol.html b/coverage/lcov-report/roles/AssetManagerFunds.sol.html new file mode 100644 index 00000000..70cfc56f --- /dev/null +++ b/coverage/lcov-report/roles/AssetManagerFunds.sol.html @@ -0,0 +1,488 @@ + + + + Code coverage report for roles/AssetManagerFunds.sol + + + + + + + +
+
+

+ all files / roles/ AssetManagerFunds.sol +

+
+
+ 68.42% + Statements + 39/57 +
+
+ 31.25% + Branches + 15/48 +
+
+ 85.71% + Functions + 6/7 +
+
+ 68.75% + Lines + 44/64 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +1× +1× +1× +  +1× +1× +  +  +1× +1× +  +1× +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +1× +1× +  +  +  +  +  +  +  +1× +1× +  +1× +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../math/SafeMath.sol";
+ 
+interface DToken {
+  function withdraw() external returns (bool);
+  function getAmountOwed(address _user) external view returns (uint);
+  function balanceOf(address _tokenHolder) external view returns (uint);
+  function transfer(address _to, uint _amount) external returns (bool success);
+  function getERC20() external  view returns (address);
+}
+ 
+// @title A dividend-token holding contract that locks tokens and retrieves dividends for assetManagers
+// @notice This contract receives newly minted tokens and retrieves Ether or ERC20 tokens received from the asset
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+contract AssetManagerFunds {
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+ 
+  uint256 private transactionNumber;
+ 
+  // @notice constructor: initializes database
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+  }
+ 
+  // @notice asset manager can withdraw his dividend fee from assets here
+  // @param : bytes32 _assetID = the ID of this asset on the platform 
+  function withdraw(bytes32 _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    require(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))));
+    DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    require(address(token) != address(0));
+    uint amountOwed;
+    uint balanceBefore;
+    if (token.getERC20() == address(0)){
+      balanceBefore = address(this).balance;
+      amountOwed = token.getAmountOwed(address(this));
+      require(amountOwed > 0);
+      uint balanceAfter = balanceBefore.add(amountOwed);
+      require(token.withdraw());
+      require(address(this).balance == balanceAfter);
+      msg.sender.transfer(amountOwed);
+    }
+    else {
+      amountOwed = token.getAmountOwed(address(this));
+      require(amountOwed > 0);
+      balanceBefore = token.balanceOf(address(this));
+      require(token.withdraw());
+      require(token.balanceOf(address(this)).sub(amountOwed) == balanceBefore);
+      token.transfer(msg.sender, amountOwed);
+    }
+    return true;
+  }
+ 
+  function retrieveAssetManagerTokens(bytes32[] _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    Erequire(_assetID.length <= 42);
+    uint[] memory payoutAmounts = new uint[](_assetID.length);
+    address[] memory tokenAddresses = new address[](_assetID.length);
+    uint8 numEntries;
+    for(uint8 i = 0; i < _assetID.length; i++){
+      Erequire(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID[i]))) );
+      DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID[i]))));
+      Erequire(address(token) != address(0));
+      uint tokensOwed = token.getAmountOwed(address(this));
+      Erequire(tokensOwed > 0);
+      DToken fundingToken = DToken(token.getERC20());
+      uint balanceBefore = fundingToken.balanceOf(address(this));
+      uint8 tokenIndex = containsAddress(tokenAddresses, address(token));
+      Iif (tokenIndex < _assetID.length) {  payoutAmounts[tokenIndex] = payoutAmounts[tokenIndex].add(tokensOwed); }
+      else {
+        tokenAddresses[numEntries] = address(fundingToken);
+        payoutAmounts[numEntries] = tokensOwed;
+        numEntries++;
+      }
+      Erequire(token.withdraw());
+      Erequire(fundingToken.balanceOf(address(this)).sub(tokensOwed) == balanceBefore);
+    }
+ 
+    for(i = 0; i < numEntries; i++){
+      Erequire(ERC20(tokenAddresses[i]).transfer(msg.sender, payoutAmounts[i]));
+    }
+    return true;
+  }
+ 
+ 
+  function retrieveAssetManagerETH(bytes32[] _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    Erequire(_assetID.length <= 93);
+    uint weiOwed;
+    for(uint8 i = 0; i < _assetID.length; i++){
+      Erequire(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID[i]))));
+      DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID[i]))));
+      uint balanceBefore = address(this).balance;
+      uint amountOwed = token.getAmountOwed(address(this));
+      Erequire(amountOwed > 0);
+      uint balanceAfter = balanceBefore.add(amountOwed);
+      Erequire(token.withdraw());
+      Erequire(address(this).balance == balanceAfter);
+      weiOwed = weiOwed.add(amountOwed);
+    }
+    msg.sender.transfer(weiOwed);
+    return true;
+  }
+ 
+  // @notice returns the index if the address is in the list, otherwise returns list length + 1
+  function containsAddress(address[] _addressList, address _addr)
+  internal
+  pure
+  returns (uint8) {
+    for (uint8 i = 0; i < _addressList.length; i++){
+      Iif (_addressList[i] == _addr) return i;
+    }
+    return uint8(_addressList.length + 1);
+  }
+ 
+ 
+  // @notice prevents calls from re-entering contract
+  modifier nonReentrant() {
+    transactionNumber += 1;
+    uint256 localCounter = transactionNumber;
+    _;
+    Erequire(localCounter == transactionNumber);
+  }
+ 
+  function ()
+  payable
+  public {}
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/roles/Operators.sol.html b/coverage/lcov-report/roles/Operators.sol.html new file mode 100644 index 00000000..d517df61 --- /dev/null +++ b/coverage/lcov-report/roles/Operators.sol.html @@ -0,0 +1,344 @@ + + + + Code coverage report for roles/Operators.sol + + + + + + + +
+
+

+ all files / roles/ Operators.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 23/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +10× +10× +10× +9× +9× +9× +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +3× +3× +2× +1× +1× +1× +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +  +  +14× +13× +  +  +  +  +5× +5× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+ 
+contract Operators {
+ 
+  Database private database;
+ 
+  constructor(address _database) public {
+    database = Database(_database);
+  }
+ 
+  // @notice allows the platform owners to onboard a new operator.
+  // @notice operators will receive crowdfunding payments and are liable for producing/installing assets.
+  function registerOperator(address _operatorAddress, string _operatorURI)
+  external
+  onlyOwner {
+    Erequire(_operatorAddress != address(0));
+    bytes32 operatorID = keccak256(abi.encodePacked(_operatorURI));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", operatorID))) == address(0));
+    database.setAddress(keccak256(abi.encodePacked("operator", operatorID)), _operatorAddress);
+    database.setBytes32(keccak256(abi.encodePacked("operator", _operatorAddress)), operatorID);
+    emit LogOperatorRegistered(operatorID, _operatorURI);
+  }
+ 
+  // @notice owners can remove operators from the platform here
+  function removeOperator(bytes32 _operatorID)
+  external
+  onlyOwner {
+    database.deleteAddress(keccak256(abi.encodePacked("operator", _operatorID)));
+    emit LogOperatorRemoved(_operatorID, msg.sender);
+  }
+ 
+ 
+  // @notice operator or owner can change the withdraw address of a registered operator
+  function changeOperatorAddress(bytes32 _operatorID, address _newAddress)
+  external {
+    address oldAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID)));
+    require(oldAddress != address(0));
+    require(msg.sender == oldAddress || database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    database.deleteAddress(keccak256(abi.encodePacked("operator", _operatorID)));
+    database.setAddress(keccak256(abi.encodePacked("operator", _operatorID)), _newAddress);
+    emit LogOperatorAddressChanged(_operatorID, msg.sender, _newAddress);
+  }
+ 
+  // @notice operator can choose which ERC20 tokens he's willing to accept as payment
+  function acceptERC20Token(bytes32 _operatorID, address _tokenAddress, bool _accept)
+  external
+  onlyOperator(_operatorID)
+  returns (bool) {
+    database.setBool(keccak256(abi.encodePacked("acceptsToken", _operatorID, _tokenAddress)), _accept);
+    return true;
+  }
+ 
+  // @notice operator can choose whether or not to accept Ether
+  function acceptEther(bytes32 _operatorID, bool _accept)
+  external
+  onlyOperator(_operatorID)
+  returns (bool) {
+    database.setBool(keccak256(abi.encodePacked("acceptsEther", _operatorID)), _accept);
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Modifiers                                                                     //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice Sender must be the operator address for this operatorID
+  modifier onlyOperator(bytes32 _operatorID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) == msg.sender);
+    _;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Events                                                                        //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+ 
+  event LogOperatorRegistered(bytes32 indexed _operatorID, string _operatorURI);
+  event LogOperatorRemoved(bytes32 indexed _operatorID, address _owner);
+  event LogOperatorAddressChanged(bytes32 indexed _operatorID, address _oldAddress, address _newAddress);
+  event LogOperatorAcceptsToken(bytes32 indexed _operatorID, address _tokenAddress);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/roles/index.html b/coverage/lcov-report/roles/index.html new file mode 100644 index 00000000..6962d53d --- /dev/null +++ b/coverage/lcov-report/roles/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for roles/ + + + + + + + +
+
+

+ all files roles/ +

+
+
+ 73.64% + Statements + 81/110 +
+
+ 44.57% + Branches + 41/92 +
+
+ 90.48% + Functions + 19/21 +
+
+ 77.1% + Lines + 101/131 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetManagerEscrow.sol
71.79%28/3950%16/3283.33%5/677.27%34/44
AssetManagerFunds.sol
68.42%39/5731.25%15/4885.71%6/768.75%44/64
Operators.sol
100%14/1483.33%10/12100%8/8100%23/23
+
+
+ + + + + + + diff --git a/coverage/lcov-report/sort-arrow-sprite.png b/coverage/lcov-report/sort-arrow-sprite.png new file mode 100644 index 00000000..03f704a6 Binary files /dev/null and b/coverage/lcov-report/sort-arrow-sprite.png differ diff --git a/coverage/lcov-report/sorter.js b/coverage/lcov-report/sorter.js new file mode 100644 index 00000000..6c5034e4 --- /dev/null +++ b/coverage/lcov-report/sorter.js @@ -0,0 +1,158 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/lcov-report/test/ApproveAndCallTest.sol.html b/coverage/lcov-report/test/ApproveAndCallTest.sol.html new file mode 100644 index 00000000..ba059cb7 --- /dev/null +++ b/coverage/lcov-report/test/ApproveAndCallTest.sol.html @@ -0,0 +1,95 @@ + + + + Code coverage report for test/ApproveAndCallTest.sol + + + + + + + +
+
+

+ all files / test/ ApproveAndCallTest.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11  +  +  +  +  +2× +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+contract ApproveAndCallTest{
+  function receiveApproval(address from, uint tokens, address token, bytes data)
+  public {
+    emit LogApproval(from, tokens, token, data);
+  }
+ 
+  event LogApproval(address _from, uint _tokens, address _token, bytes _data);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test/HashFunctions.sol.html b/coverage/lcov-report/test/HashFunctions.sol.html new file mode 100644 index 00000000..5c49e4b5 --- /dev/null +++ b/coverage/lcov-report/test/HashFunctions.sol.html @@ -0,0 +1,587 @@ + + + + Code coverage report for test/HashFunctions.sol + + + + + + + +
+
+

+ all files / test/ HashFunctions.sol +

+
+
+ 21.74% + Statements + 5/23 +
+
+ 100% + Branches + 0/0 +
+
+ 21.74% + Functions + 5/23 +
+
+ 20.83% + Lines + 5/24 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+contract HashFunctions {
+ 
+  function toBytes(uint x)
+  external
+  pure
+  returns (bytes b) {
+    b = new bytes(32);
+    assembly { mstore(add(b, 32), x) }
+  }
+ 
+ 
+ 
+  function getMethodID(string _functionString)
+  public
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked(_functionString)));
+  }
+ 
+  function getAssetID(string _assetURI, uint _amountToRaise, bytes32 _operatorID)
+  public
+  view
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+  }
+ 
+  function getOrderID(bytes _assetID, address _user, uint _amount, uint _price, bool _buyOrder)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_assetID, _user, _amount, _price, _buyOrder));
+  }
+ 
+  function getFunctionInitiatorHash(address _param1, address _param2, bytes32 _param3)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_param1, _param2, "destroy", _param3));
+  }
+ 
+  function uintHash(uint _param)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param));
+  }
+ 
+  function getStakingID(address _staker, uint256 _blockNumber, uint256 _amount)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_staker, _blockNumber, _amount));
+  }
+ 
+  function stringHash(string _name)
+  external
+  pure
+  returns (bytes32){
+    return keccak256(abi.encodePacked(_name));
+  }
+ 
+  function addressHash(address _param)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param));
+  }
+ 
+ 
+  function contractHash(string _name)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked("contract", _name));
+  }
+ 
+  function stringAddress(string _param, address _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringString(string _param, string _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return (keccak256(abi.encodePacked(_param, _paramTwo)));
+  }
+ 
+  function stringBytes(string _param, bytes32 _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringUint(string _param, uint _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringBytesAddress(string _param, bytes32 _paramTwo, address _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo, _paramThree));
+  }
+ 
+  function addressUintUint(address _param, uint _paramTwo, uint _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo, _paramThree));
+  }
+ 
+ 
+  function getAuthorizeHash(address _contractAddress, address _owner, string _fnName, bytes32 _recipient)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_contractAddress, _owner, _fnName, _recipient));
+  }
+ 
+  function uintUint(uint _paramOne, uint _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_paramOne, _paramTwo));
+  }
+ 
+ 
+  function uintUintUint(uint _paramOne, uint _paramTwo, uint _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_paramOne, _paramTwo, _paramThree));
+  }
+ 
+  function currentTime()
+  external
+  view
+  returns (uint) {
+    return now;
+  }
+ 
+  function nullBytes()
+  external
+  pure
+  returns (bytes32) {
+    return bytes32(0);
+  }
+ 
+  function nullAddress()
+  external
+  pure
+  returns (address) {
+    return address(0);
+  }
+ 
+function ()
+public {
+  revert();
+}
+ 
+ 
+ 
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test/SafeMathWrapper.sol.html b/coverage/lcov-report/test/SafeMathWrapper.sol.html new file mode 100644 index 00000000..b246239f --- /dev/null +++ b/coverage/lcov-report/test/SafeMathWrapper.sol.html @@ -0,0 +1,149 @@ + + + + Code coverage report for test/SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / test/ SafeMathWrapper.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29  +  +  +  +  +  +  +  +  +3× +  +  +  +1× +  +  +  +2× +  +  +  +2× +  +  +  +1× +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+ 
+contract SafeMathWrapper {
+  using SafeMath for uint;
+  using SafeMath for bytes;
+ 
+  function multiply(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.mul(b);
+  }
+ 
+  function divide(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.div(b);
+  }
+ 
+  function subtract(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.sub(b);
+  }
+ 
+  function addto(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.add(b);
+  }
+ 
+  function fraction(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.getFractionalAmount(b);
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test/TestBurner.sol.html b/coverage/lcov-report/test/TestBurner.sol.html new file mode 100644 index 00000000..f57693bf --- /dev/null +++ b/coverage/lcov-report/test/TestBurner.sol.html @@ -0,0 +1,185 @@ + + + + Code coverage report for test/TestBurner.sol + + + + + + + +
+
+

+ all files / test/ TestBurner.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +4× +  +  +  +  +  +2× +2× +2× +1× +  +  +  +  +  +  +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../access/ERC20Burner.sol'; 
+import '../database/Database.sol';
+ 
+contract TestBurner {
+ 
+  ERC20Burner public burner;
+  Database public database;
+ 
+  uint public amountBurnt;
+ 
+  constructor(address _database, address _burner)
+  public {
+    burner = ERC20Burner(_burner);
+    database = Database(_database);
+  }
+ 
+  function burnTokensManualFee(uint _amount)
+  external {
+    require(burner.burn(msg.sender, _amount));
+  }
+ 
+  // Must set fee in ERC20Burner first
+  function burnTokens()
+  external {
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("burnTokens()")));
+    uint amountToBurn = database.uintStorage(keccak256(abi.encodePacked(methodID, address(this))));
+    require(burner.burn(msg.sender, amountToBurn));
+    amountBurnt += amountToBurn;
+  }
+ 
+  function getMethodID()
+  external
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked("burnTokens()")));
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test/WithdrawTest.sol.html b/coverage/lcov-report/test/WithdrawTest.sol.html new file mode 100644 index 00000000..2a5fe716 --- /dev/null +++ b/coverage/lcov-report/test/WithdrawTest.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for test/WithdrawTest.sol + + + + + + + +
+
+

+ all files / test/ WithdrawTest.sol +

+
+
+ 33.33% + Statements + 2/6 +
+
+ 100% + Branches + 0/0 +
+
+ 50% + Functions + 1/2 +
+
+ 28.57% + Lines + 2/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+contract WithdrawTest{
+ 
+  mapping(address => uint) public balances;
+ 
+  function withdraw()
+  external
+  returns (bool){
+    emit LogWithdraw(msg.sender, balances[msg.sender]);
+    uint amount = balances[msg.sender];
+    balances[msg.sender] = 0;
+    msg.sender.transfer(amount);
+    return true;
+  }
+ 
+  function deposit(address _receiver)
+  payable
+  external{
+    emit LogDeposit(_receiver, msg.value);
+    balances[_receiver] += msg.value;
+  }
+ 
+  event LogDeposit(address _receiver, uint _amount);
+  event LogWithdraw(address _receiver, uint _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/test/index.html b/coverage/lcov-report/test/index.html new file mode 100644 index 00000000..082a1d3f --- /dev/null +++ b/coverage/lcov-report/test/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for test/ + + + + + + + +
+
+

+ all files test/ +

+
+
+ 48.84% + Statements + 21/43 +
+
+ 100% + Branches + 4/4 +
+
+ 45.71% + Functions + 16/35 +
+
+ 46.67% + Lines + 21/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ApproveAndCallTest.sol
100%1/1100%0/0100%1/1100%1/1
HashFunctions.sol
21.74%5/23100%0/021.74%5/2320.83%5/24
SafeMathWrapper.sol
100%5/5100%0/0100%5/5100%5/5
TestBurner.sol
100%8/8100%4/4100%4/4100%8/8
WithdrawTest.sol
33.33%2/6100%0/050%1/228.57%2/7
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/distribution/EqualDistribution.sol.html b/coverage/lcov-report/tokens/distribution/EqualDistribution.sol.html new file mode 100644 index 00000000..c334cc22 --- /dev/null +++ b/coverage/lcov-report/tokens/distribution/EqualDistribution.sol.html @@ -0,0 +1,305 @@ + + + + Code coverage report for tokens/distribution/EqualDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ EqualDistribution.sol +

+
+
+ 42.86% + Statements + 6/14 +
+
+ 75% + Branches + 3/4 +
+
+ 40% + Functions + 2/5 +
+
+ 35.71% + Lines + 5/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +5× +  +1× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import '../../interfaces/PullPayment.sol';
+ 
+// @title A contract made to equally distribute payments amongs a list of beneficiaries
+// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+// @notice This contract allows someone to leave ETH for a beneficiary
+// @dev assumes each beneficiary receives equal amount
+contract EqualDistribution {
+  using SafeMath for uint;
+ 
+  address[] public beneficiaries;             // List of chosen beneficiaries
+ 
+  uint public totalReleased;               // Total WEI so far released to beneficiaries
+ 
+  mapping (address => uint) public amountRedeemed;    // Amount of WEI this address has already withdrawn from contract
+ 
+ 
+  // @notice constructor. Sets the beneficiaries and where the income to be distributed is coming from
+  // @param (address) _beneficiary = The ETH address of who is to receive the income. Could be a distribution contract.
+  constructor(address[] _beneficiaries)
+  public{
+    Erequire(_beneficiaries.length < 200); 
+    beneficiaries = _beneficiaries;
+  }
+ 
+  // @notice allows beneficiaries to withdraw from contracts at different locations to be re-distributed here
+  // @dev can call withdraw() on any address if there are no parameters required. Fallback function will be triggered
+  // @param (address) _contractAddress = The address to call withdraw() on.
+  function getFunds(address _contractAddress)
+  external
+  returns (bool) {
+    PullPayment(_contractAddress).withdraw();
+    return true;
+  }
+ 
+  // @notice beneficiaries can withdraw their share of the income here
+  function withdraw()
+  external
+  returns (bool) {
+    uint amount = ((address(this).balance.add(totalReleased)).div(beneficiaries.length)).sub(amountRedeemed[msg.sender]);
+    amountRedeemed[msg.sender] = amountRedeemed[msg.sender].add(amount);
+    totalReleased = totalReleased.add(amount);
+    msg.sender.transfer(amount);
+    emit LogWithdraw(msg.sender, amount);
+    return true;
+  }
+ 
+  // @notice fallback function. Accepts Ether and updates income balance
+  function ()
+  public
+  payable {
+    emit LogPayment(msg.sender, msg.value);
+  }
+ 
+ 
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  // Constants
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice check if the address is one of the beneficiaries
+  function isBeneficiary(address _beneficiary)
+  public
+  view
+  returns (bool) {
+    for (uint i = 0; i < beneficiaries.length; i++){
+      if (beneficiaries[i] == _beneficiary) { return true; }
+    }
+    return false;
+  }
+ 
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  // Events
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogPayment(address _sender, uint _amount);
+  event LogWithdraw(address _beneficiary, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/distribution/FixedDistribution.sol.html b/coverage/lcov-report/tokens/distribution/FixedDistribution.sol.html new file mode 100644 index 00000000..db4303e1 --- /dev/null +++ b/coverage/lcov-report/tokens/distribution/FixedDistribution.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for tokens/distribution/FixedDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ FixedDistribution.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +6× +6× +  +2× +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import './StandardDistribution.sol';
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract FixedDistribution is StandardDistribution {
+  using SafeMath for uint;
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  public {
+    Erequire(_tokenHolders.length < 200 && _tokenHolders.length == _amount.length);
+    uint _totalSupply;
+    tokenURI = _tokenURI;
+    for (uint8 i = 0; i < _tokenHolders.length; i++) {
+      _totalSupply = _totalSupply.add(_amount[i]);
+      balances[_tokenHolders[i]] = balances[_tokenHolders[i]].add(_amount[i]);
+    }
+    supply = _totalSupply;
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/distribution/MintableDistribution.sol.html b/coverage/lcov-report/tokens/distribution/MintableDistribution.sol.html new file mode 100644 index 00000000..6967e8bf --- /dev/null +++ b/coverage/lcov-report/tokens/distribution/MintableDistribution.sol.html @@ -0,0 +1,269 @@ + + + + Code coverage report for tokens/distribution/MintableDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ MintableDistribution.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 11/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +  +  +  +4× +3× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import './StandardDistribution.sol';
+ 
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBitFoundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract MintableDistribution is StandardDistribution{
+  using SafeMath for uint;
+ 
+  bool public mintingFinished = false;
+  address public minter;
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address _minter)
+  public {
+      tokenURI = _tokenURI;                         // Set the id for reference
+      minter = _minter;
+  }
+ 
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount)
+  public
+  canMint
+  returns (bool) {
+    supply = supply.add(_amount);
+    balances[_to] = balances[_to].add(_amount);
+    emit Mint(_to, _amount);
+    return true;
+  }
+ 
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting()
+  public
+  canMint
+  returns (bool) {
+    mintingFinished = true;
+    emit MintFinished();
+    return true;
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice modifier: Requires that minting hasn't finished
+  modifier canMint() {
+    require(!mintingFinished && msg.sender == minter);
+    _;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                     Events
+  // ------------------------------------------------------------------------------------------------
+ 
+  event Mint(address indexed to, uint256 amount);
+  event MintFinished();
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/distribution/StandardDistribution.sol.html b/coverage/lcov-report/tokens/distribution/StandardDistribution.sol.html new file mode 100644 index 00000000..de122f98 --- /dev/null +++ b/coverage/lcov-report/tokens/distribution/StandardDistribution.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for tokens/distribution/StandardDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ StandardDistribution.sol +

+
+
+ 100% + Statements + 15/15 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 18/18 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +5× +5× +  +  +  +  +  +  +  +1× +  +  +  +1× +  +  +  +7× +  +  +  +  +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import '../../interfaces/PullPayment.sol';
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBitFoundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract StandardDistribution{
+  using SafeMath for uint;
+ 
+ 
+  uint public supply;
+  mapping (address => uint) internal balances;
+ 
+  string public tokenURI;                 // A reference to a URI containing further token information
+ 
+ 
+  // @notice Token Income Information
+  uint constant scalingFactor = 1e32;
+  uint public assetIncome;
+  uint public valuePerToken;
+ 
+  mapping (address => uint) public claimableIncome;
+  mapping (address => uint) public previousValuePerToken;
+ 
+ 
+  // @notice Updates claimableIncome, sends all wei to the token holder
+  function withdraw()
+  public
+  updateclaimableIncome(msg.sender)
+  returns (uint _amount) {
+      _amount = claimableIncome[msg.sender].div(scalingFactor);
+      delete claimableIncome[msg.sender];
+      msg.sender.transfer(_amount);
+      emit LogIncomeCollected(now, msg.sender, _amount);
+  }
+/*
+  // @notice allows beneficiaries to withdraw from contracts at different locations to be re-distributed here
+  // @dev can call withdraw() on any address if there are no parameters required. Fallback function will be triggered
+  // @param (address) _contractAddress = The address to call withdraw() on.
+  function getFunds(address _contractAddress)
+  external
+  returns (bool) {
+    PullPayment(_contractAddress).withdraw();
+    return true;
+  }
+ 
+*/
+  function issueDividends()
+  payable
+  public {
+      valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+      assetIncome = assetIncome.add(msg.value);
+      emit LogIncomeReceived(msg.sender, msg.value);
+  }
+ 
+    // Fallback function: Accepts Ether and updates ledger (issues dividends)
+  function ()
+    payable
+    public {
+      valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+      assetIncome = assetIncome.add(msg.value);
+      emit LogIncomeReceived(msg.sender, msg.value);
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   View Functions
+  // ------------------------------------------------------------------------------------------------
+ 
+  // @notice Calculates how much value _user holds
+  function getTokenValue(address _user)
+  public
+  view
+  returns (uint) {
+      uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_user]);
+      return valuePerTokenDifference.mul(balances[_user]);
+  }
+ 
+  // @notice Calculates how much wei user is owed. (new income + claimableIncome) / 10**32
+  function getUnclaimedAmount(address _user)
+  public
+  view
+  returns (uint) {
+      return (getTokenValue(_user).add(claimableIncome[_user]).div(scalingFactor));
+  }
+ 
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+  // Updates the amount owed to user while holding tokenSupply
+  // @dev must be called before transfering tokens
+  modifier updateclaimableIncome(address _user) {
+      claimableIncome[_user] = claimableIncome[_user].add(getTokenValue(_user));
+      previousValuePerToken[_user] = valuePerToken;
+      _;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                     Events
+  // ------------------------------------------------------------------------------------------------
+ 
+  event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+  event LogIncomeCollected(uint _block, address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/distribution/index.html b/coverage/lcov-report/tokens/distribution/index.html new file mode 100644 index 00000000..82c6ff0f --- /dev/null +++ b/coverage/lcov-report/tokens/distribution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for tokens/distribution/ + + + + + + + +
+
+

+ all files tokens/distribution/ +

+
+
+ 82.22% + Statements + 37/45 +
+
+ 75% + Branches + 6/8 +
+
+ 83.33% + Functions + 15/18 +
+
+ 82% + Lines + 41/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
EqualDistribution.sol
42.86%6/1475%3/440%2/535.71%5/14
FixedDistribution.sol
100%6/650%1/2100%1/1100%7/7
MintableDistribution.sol
100%10/10100%2/2100%4/4100%11/11
StandardDistribution.sol
100%15/15100%0/0100%8/8100%18/18
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/BurnableToken.sol.html b/coverage/lcov-report/tokens/erc20/BurnableToken.sol.html new file mode 100644 index 00000000..ddb98d74 --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/BurnableToken.sol.html @@ -0,0 +1,626 @@ + + + + Code coverage report for tokens/erc20/BurnableToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ BurnableToken.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 42/42 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  +204× +203× +201× +201× +201× +201× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× +156× +156× +  +  +  +  +  +  +  +  +  +  +  +17× +16× +15× +15× +14× +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +  +  +1× +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +40× +40× +39× +39× +39× +39× +  +  +  +  +  +  +  +  +2× +  +  +  +  +  +  +  +  +199× +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./StandardToken.sol";
+import "../../interfaces/BurnableERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+// @title ERC20 token contract with burning capabilities
+// @notice Standard ERC20 contract with a deflationary supply.
+contract BurnableToken is BurnableERC20 {
+  using SafeMath for uint256;
+ 
+  string public tokenURI;
+ 
+  mapping(address => uint256) internal balances;
+ 
+  mapping (address => mapping (address => uint256)) internal allowed;
+ 
+  uint256 internal supply;
+ 
+ 
+    // @notice constructor: initialized
+    // @param (string) _tokenURI = The URI where information about this token can be found
+    // @param (uint) _totalSupply = The initial supply of the token
+    constructor(string _tokenURI, uint _totalSupply)
+    public {
+        supply = _totalSupply;                        // Update total supply
+        tokenURI = _tokenURI;                         // Set the id for reference
+        balances[msg.sender] = _totalSupply;
+        emit Transfer(address(0), msg.sender, _totalSupply);    // Transfer event indicating token creation
+    }
+ 
+ 
+  /**
+  * @dev Transfer token for a specified address
+  * @param _to The address to transfer to.
+  * @param _value The amount to be transferred.
+  */
+  function transfer(address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_value <= balances[msg.sender]);
+    require(_to != address(0));
+    balances[msg.sender] = balances[msg.sender].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    emit Transfer(msg.sender, _to, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
+  * Beware that changing an allowance with this method brings the risk that someone may use both the old
+  * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+  * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+  * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+  * @param _spender The address which will spend the funds.
+  * @param _value The amount of tokens to be spent.
+  */
+  function approve(address _spender, uint256 _value)
+  public
+  returns (bool) {
+    allowed[msg.sender][_spender] = _value;
+    emit Approval(msg.sender, _spender, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Transfer tokens from one address to another
+  * @param _from address The address which you want to send tokens from
+  * @param _to address The address which you want to transfer to
+  * @param _value uint256 the amount of tokens to be transferred
+  */
+  function transferFrom(address _from, address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_to != address(0));     // use burn instead
+    balances[_from] = balances[_from].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
+    emit Transfer(_from, _to, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Increase the amount of tokens that an owner allowed to a spender.
+  * approve should be called when allowed[_spender] == 0. To increment
+  * allowed value is better to use this function to avoid 2 calls (and wait until
+  * the first transaction is mined)
+  * From MonolithDAO Token.sol
+  * @param _spender The address which will spend the funds.
+  * @param _addedValue The amount of tokens to increase the allowance by.
+  */
+  function increaseApproval(address _spender, uint256 _addedValue)
+  public
+  returns (bool) {
+    allowed[msg.sender][_spender] = (
+    allowed[msg.sender][_spender].add(_addedValue));
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+  /**
+  * @dev Decrease the amount of tokens that an owner allowed to a spender.
+  * approve should be called when allowed[_spender] == 0. To decrement
+  * allowed value is better to use this function to avoid 2 calls (and wait until
+  * the first transaction is mined)
+  * From MonolithDAO Token.sol
+  * @param _spender The address which will spend the funds.
+  * @param _subtractedValue The amount of tokens to decrease the allowance by.
+  */
+  function decreaseApproval(address _spender, uint256 _subtractedValue)
+  public
+  returns (bool) {
+    uint256 oldValue = allowed[msg.sender][_spender];
+    if (_subtractedValue >= oldValue) {
+      allowed[msg.sender][_spender] = 0;
+    }
+    else {
+      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
+    }
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+ 
+ 
+  // ------------------------------------------------------------------------
+  // Removes senders tokens from supply.
+  // Lowers investor balance and totalSupply by _amount
+  // ------------------------------------------------------------------------
+  function burn(uint _amount)
+  public
+  returns (bool success) {
+    balances[msg.sender] = balances[msg.sender].sub(_amount);
+    supply = supply.sub(_amount);
+    emit LogBurn(msg.sender, _amount);
+    emit Transfer(msg.sender, address(0), _amount);
+    return true;
+  }
+ 
+  // ------------------------------------------------------------------------
+  // An approved sender can burn _amount tokens of investor _from
+  // Lowers investor balance and supply by _amount
+  // ------------------------------------------------------------------------
+  function burnFrom(address _from, uint _amount)
+  public
+  returns (bool success) {
+    balances[_from] = balances[_from].sub(_amount);                         // Subtract from the targeted balance
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);             // Subtract from the sender's allowance
+    supply = supply.sub(_amount);                              // Update supply
+    emit LogBurn(_from, _amount);
+    emit Transfer(_from, address(0), _amount);
+    return true;
+  }
+ 
+ 
+ 
+  /**
+  * @dev Total number of tokens in existence
+  */
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  /**
+  * @dev Gets the balance of the specified address.
+  * @param _owner The address to query the the balance of.
+  * @return An uint256 representing the amount owned by the passed address.
+  */
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+ 
+    /**
+   * @dev Function to check the amount of tokens that an owner allowed to a spender.
+   * @param _owner address The address which owns the funds.
+   * @param _spender address The address which will spend the funds.
+   * @return A uint256 specifying the amount of tokens still available for the spender.
+   */
+  function allowance(address _owner, address _spender)
+  public
+  view
+  returns (uint256) {
+    return allowed[_owner][_spender];
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/DividendToken.sol.html b/coverage/lcov-report/tokens/erc20/DividendToken.sol.html new file mode 100644 index 00000000..8f4ebabd --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/DividendToken.sol.html @@ -0,0 +1,524 @@ + + + + Code coverage report for tokens/erc20/DividendToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ DividendToken.sol +

+
+
+ 95.83% + Statements + 23/24 +
+
+ 100% + Branches + 4/4 +
+
+ 90.91% + Functions + 10/11 +
+
+ 96.55% + Lines + 28/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +3× +1× +  +  +  +  +  +  +  +  +  +  +  +  +6× +5× +3× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +7× +7× +7× +7× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +  +  +32× +32× +32× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './MintableToken.sol';
+import '../../math/SafeMath.sol';
+import '../../interfaces/ApproveAndCallFallback.sol';
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners receive their share when transferring tokens.
+// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract DividendToken is MintableToken {
+    using SafeMath for uint;
+ 
+    // @notice Token Income Information
+    uint constant scalingFactor = 1e32;
+    uint public valuePerToken;
+    uint public assetIncome;
+ 
+    mapping (address => uint) public incomeOwed;
+    mapping (address => uint) public previousValuePerToken;
+ 
+ 
+    // @notice constructor: initialized
+    constructor(string _tokenURI, address _owner)
+    public
+    MintableToken(_tokenURI, _owner){}
+ 
+    // @notice Transfer _amount tokens to address _to.
+    // @dev Sender must have enough tokens. Cannot send to 0x0.
+    // @param (address) _to = The address which will receive the tokens
+    // @param (uint) _amount = The amount of tokens to send
+    function transfer(address _to, uint _amount)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transfer(_to, _amount);
+        return true;
+    }
+ 
+    // @notice A 3rd party can transfer tokens if investor approves them to do so
+    // @dev Transfer _amount of tokens if _from has allowed msg.sender to do so.
+    // @param (address) _from = The address who approved msg.sender to spend tokens
+    // @param (address) _to = The address who will receive the tokens
+    // @param (uint) _amount = The number of tokens to send
+    function transferFrom(address _from, address _to, uint _amount)
+    public
+    updateIncomeClaimed(_from)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transferFrom(_from, _to, _amount);
+        return true;
+    }
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_spender)
+    returns (bool success) {
+        allowed[msg.sender][_spender] = _amount;
+        emit Approval(msg.sender, _spender, _amount);
+        ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _data);
+        return true;
+    }
+ 
+    // @notice token holders can withdraw income here
+    function withdraw()
+    public
+    updateIncomeClaimed(msg.sender)
+    returns (bool) {
+        uint amount = incomeOwed[msg.sender].div(scalingFactor);
+        delete incomeOwed[msg.sender];
+        emit LogIncomeCollected(msg.sender, amount);
+        msg.sender.transfer(amount);
+        return true;
+    }
+ 
+    // @notice assets can send their income here to be collected by investors
+    function issueDividends()
+    payable
+    public
+    returns (bool) {
+        assetIncome = assetIncome.add(msg.value);
+        valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+        emit LogIncomeReceived(msg.sender, msg.value);
+        return true;
+    }
+ 
+    // @notice returns null address to specify this token accepts only Ether payments
+    function getERC20()
+    external
+    pure
+    returns(address){
+      return address(0);
+    }
+ 
+    // Fallback function: receives Ether and updates income ledger
+    function ()
+    payable
+    public {
+        assetIncome = assetIncome.add(msg.value);
+        valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+        emit LogIncomeReceived(msg.sender, msg.value);
+    }
+ 
+ 
+    // ------------------------------------------------------------------------
+    //                           View functions
+    // ------------------------------------------------------------------------
+ 
+    // @notice Calculates how much more income is owed to investor since last calculation
+    function collectLatestPayments(address _investor)
+    private
+    view
+    returns (uint) {
+        uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_investor]);
+        return valuePerTokenDifference.mul(balances[_investor]);
+    }
+ 
+    // @notice Calculates how much wei investor is owed. (points + incomeOwed) / 10**32
+    function getAmountOwed(address _investor)
+    public
+    view
+    returns (uint) {
+        return (collectLatestPayments(_investor).add(incomeOwed[_investor]).div(scalingFactor));
+    }
+ 
+    // ------------------------------------------------------------------------
+    //                            Modifiers
+    // ------------------------------------------------------------------------
+ 
+    // Updates the amount owed to investor while holding tokenSupply
+    // @dev must be called before transfering tokens
+    modifier updateIncomeClaimed(address _investor) {
+        incomeOwed[_investor] = incomeOwed[_investor].add(collectLatestPayments(_investor));
+        previousValuePerToken[_investor] = valuePerToken;
+        _;
+    }
+ 
+ 
+ 
+ 
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogIncomeCollected(address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/DividendTokenERC20.sol.html b/coverage/lcov-report/tokens/erc20/DividendTokenERC20.sol.html new file mode 100644 index 00000000..1f7073b6 --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/DividendTokenERC20.sol.html @@ -0,0 +1,572 @@ + + + + Code coverage report for tokens/erc20/DividendTokenERC20.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ DividendTokenERC20.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 37/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +  +  +  +  +  +  +  +  +3× +2× +1× +  +  +  +  +  +  +  +  +3× +2× +1× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +6× +5× +5× +5× +5× +5× +  +  +  +  +  +  +  +10× +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +2× +2× +2× +2× +  +1× +1× +  +2× +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +2× +  +  +  +  +  +  +  +  +  +24× +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+import './MintableToken.sol';
+import '../../math/SafeMath.sol';
+import '../../interfaces/ERC20.sol';
+import '../../interfaces/ApproveAndCallFallback.sol';
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive ERC20 tokens as payments and token owners receive their share when transferring tokens.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract DividendTokenERC20 is MintableToken {
+    using SafeMath for uint;
+ 
+    ERC20 public erc20;
+ 
+    // @notice Token Income Information
+    uint constant scalingFactor = 1e32;
+ 
+    uint public assetIncome;
+    uint public assetIncomeIssued;
+    uint public valuePerToken;
+ 
+ 
+    mapping (address => uint) public incomeClaimed;
+    mapping (address => uint) public previousValuePerToken;
+ 
+ 
+    // @notice constructor: initialized
+    constructor(string _tokenURI, address _owner, address _erc20Address)
+    public  MintableToken(_tokenURI, _owner){
+        erc20 = ERC20(_erc20Address); //Set the address of the ERC20 token that will be issued as dividends
+    }
+ 
+ 
+    function transfer(address _to, uint _amount)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transfer(_to, _amount);
+        return true;
+    }
+ 
+ 
+    function transferFrom(address _from, address _to, uint _amount)
+    public
+    updateIncomeClaimed(_from)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transferFrom(_from, _to, _amount);
+        return true;
+    }
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_spender)
+    returns (bool success) {
+        allowed[msg.sender][_spender] = _amount;
+        emit Approval(msg.sender, _spender, _amount);
+        ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _data);
+        return true;
+    }
+ 
+    function issueDividends(uint _amount)
+    public
+    returns (bool){
+        require(_amount > 0);
+        Erequire(erc20.transferFrom(msg.sender, address(this), _amount));
+        valuePerToken = valuePerToken.add(_amount.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(_amount);
+        emit LogIncomeReceived(msg.sender, _amount);
+        return true;
+    }
+ 
+    // @notice Updates incomeClaimed, sends all wei to the token holder
+    function withdraw()
+    public
+    updateIncomeClaimed(msg.sender)
+    returns (bool) {
+        uint amount = incomeClaimed[msg.sender].div(scalingFactor);
+        delete incomeClaimed[msg.sender];
+        assetIncomeIssued = assetIncomeIssued.add(amount);
+        Erequire(erc20.transfer(msg.sender, amount));
+        emit LogIncomeCollected(msg.sender, amount);
+        return true;
+    }
+ 
+    //In case a investor transferred a token directly to this contract
+    //anyone can run this function to clean up the balances
+    //and distribute the difference to token holders
+    function checkForTransfers()
+    external {
+      uint bookBalance = assetIncome.sub(assetIncomeIssued);
+      uint actualBalance = erc20.balanceOf(address(this));
+      uint diffBalance = actualBalance.sub(bookBalance);
+      if(diffBalance > 0){
+        //Update value per token
+        valuePerToken = valuePerToken.add(diffBalance.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(diffBalance);
+      }
+      emit LogCheckBalance(diffBalance);
+    }
+ 
+ 
+    // ------------------------------------------------------------------------
+    //                           View functions
+    // ------------------------------------------------------------------------
+ 
+    // @notice Calculates how much value _investor holds
+    function collectLatestPayments(address _investor)
+    public
+    view
+    returns (uint) {
+        uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_investor]);
+        return valuePerTokenDifference.mul(balances[_investor]);
+    }
+ 
+    // @notice Calculates how much wei investor is owed. (points + incomeClaimed) / 10**32
+    function getAmountOwed(address _investor)
+    public
+    view
+    returns (uint) {
+        return (collectLatestPayments(_investor).add(incomeClaimed[_investor]).div(scalingFactor));
+    }
+ 
+    function getERC20()
+    external
+    view
+    returns(address){
+      return address(erc20);
+    }
+ 
+    // ------------------------------------------------------------------------
+    //                            Modifiers
+    // ------------------------------------------------------------------------
+ 
+    // Updates the amount owed to investor while holding tokenSupply
+    // @dev must be called before transfering tokens
+    modifier updateIncomeClaimed(address _investor) {
+        incomeClaimed[_investor] = incomeClaimed[_investor].add(collectLatestPayments(_investor));
+        previousValuePerToken[_investor] = valuePerToken;
+        _;
+    }
+ 
+    // Fallback function:
+    // Only works with ERC223
+    // Can't currently detect which token
+    /*
+    function tokenFallback(address _from, uint _value, bytes _data)
+      public {
+        valuePerToken = valuePerToken.add(_value.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(_value);
+        emit LogIncomeReceived(_from, _value);
+    }
+    */
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogCheckBalance(uint _difference);
+    event LogIncomeCollected(address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/GovernedToken.sol.html b/coverage/lcov-report/tokens/erc20/GovernedToken.sol.html new file mode 100644 index 00000000..409729a6 --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/GovernedToken.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for tokens/erc20/GovernedToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ GovernedToken.sol +

+
+
+ 70% + Statements + 7/10 +
+
+ 25% + Branches + 1/4 +
+
+ 75% + Functions + 3/4 +
+
+ 58.33% + Lines + 7/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./DividendToken.sol";
+import "../../math/SafeMath.sol";
+ 
+ 
+// @notice give GovernedToken access to view uint and bytes32 storage
+interface DBAccess {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+}
+ 
+// @title A Dividend token that has governance features .
+// @notice This token contract can receive ERC20 tokens as payments and token owners can lock tokens while submitting votes
+// @dev Dividend tokens aren't actually locked, but restricted from transferring to avoid locking contravt having to distribute dividends.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+contract GovernedToken is DividendToken {
+  using SafeMath for uint;
+ 
+  DBAccess public database;
+ 
+ 
+  // @notice constructor: initialized
+  constructor(address _database, string _tokenURI, address _owner)
+  public
+  DividendToken(_tokenURI, _owner){
+    database = DBAccess(_database);
+  }
+ 
+  // @notice Standard DividendToke transfer function, which checks for locked tokens before sending
+  function transfer(address _to, uint _amount)
+  public
+  returns (bool success) {
+      Irequire(_amount <= getAmountAvailable(msg.sender));
+      super.transfer(_to, _amount);
+      return true;
+  }
+ 
+  // @notice Standard DividendToke transferFrom function, which checks for locked tokens before sending
+  function transferFrom(address _from, address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(_from));
+      super.transferFrom(_from, _to, _amount);
+      return true;
+  }
+ 
+  // @notice returns the amount of tokens _investor has locked for this asset
+  function getAmountAvailable(address _investor)
+  public
+  view
+  returns (uint) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", address(this))));
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", assetID, _investor)));
+    uint balance = balances[_investor];
+    uint available = balance.sub(amountLocked);
+    return available;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/GovernedTokenERC20.sol.html b/coverage/lcov-report/tokens/erc20/GovernedTokenERC20.sol.html new file mode 100644 index 00000000..1f513f40 --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/GovernedTokenERC20.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for tokens/erc20/GovernedTokenERC20.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ GovernedTokenERC20.sol +

+
+
+ 0% + Statements + 0/10 +
+
+ 0% + Branches + 0/4 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./DividendTokenERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+// @notice give GovernedToken access to view uint and bytes32 storage
+interface DBAccess {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+}
+ 
+// @title A Dividend token that has governance features and receives ERC20 tokens as payment
+// @notice This token contract can receive ERC20 tokens as payments and token owners can lock tokens while submitting votes
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @dev Dividend tokens aren't actually locked, but restricted from transferring to avoid locking contravt having to distribute dividends.
+contract GovernedTokenERC20 is DividendTokenERC20{
+  DBAccess public database;
+ 
+ 
+  // @notice constructor: initializes database and DividendTokenERC20
+  // @param (address) _database = the address of the platform database
+  // @param (string) _tokenURI = The URI where details of the token (asse) can be found
+  // @param (address) _owner = The minting authority for this token
+  // @param (address) _erc20Address = The address of the erc20 token to be sent for dividends
+  constructor(address _database, string _tokenURI, address _owner, address _erc20Address)
+  public
+  DividendTokenERC20(_tokenURI, _owner, _erc20Address){
+    database = DBAccess(_database);
+  }
+ 
+  // @notice Standard DividendToke transfer function, which checks for locked tokens before sending
+  function transfer(address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(msg.sender));
+      super.transfer(_to, _amount);
+      return true;
+  }
+ 
+  // @notice Standard DividendToke transferFrom function, which checks for locked tokens before sending
+  function transferFrom(address _from, address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(_from));
+      super.transferFrom(_from, _to, _amount);
+      return true;
+  }
+ 
+  // @notice returns the amount of tokens _investor has locked for this asset
+  function getAmountAvailable(address _investor)
+  public
+  view
+  returns (uint) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", address(this))));
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", assetID, _investor)));
+    uint balance = balances[_investor];
+    uint available = balance.sub(amountLocked);
+    return available;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/MintableToken.sol.html b/coverage/lcov-report/tokens/erc20/MintableToken.sol.html new file mode 100644 index 00000000..509664d0 --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/MintableToken.sol.html @@ -0,0 +1,263 @@ + + + + Code coverage report for tokens/erc20/MintableToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ MintableToken.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +17× +  +  +  +  +  +  +  +  +  +  +43× +43× +43× +43× +43× +  +  +  +  +  +  +  +7× +7× +7× +  +  +  +  +  +  +2× +  +  +  +  +51× +50× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./StandardToken.sol";
+ 
+ 
+/**
+ * @title Mintable token
+ * @dev Simple ERC20 Token example, with mintable token creation
+ * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
+ */
+contract MintableToken is StandardToken {
+ 
+  bool public mintingFinished;
+  address internal minter;
+  string internal tokenURI;                 // A reference to a URI containing further token information
+ 
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address _minter)
+  public {
+      tokenURI = _tokenURI;                         // Set the id for reference
+      minter = _minter;
+      supply = 0;
+  }
+ 
+ 
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount)
+  public
+  canMint
+  returns (bool) {
+    supply = supply.add(_amount);
+    balances[_to] = balances[_to].add(_amount);
+    emit Mint(_to, _amount);
+    emit Transfer(address(0), _to, _amount);
+    return true;
+  }
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting()
+  public
+  canMint
+  returns (bool) {
+    mintingFinished = true;
+    emit MintFinished();
+    return true;
+  }
+ 
+  function getTokenURI()
+  external
+  view
+  returns (string) {
+      return tokenURI;
+  }
+ 
+  // @notice modifier: Requires that minting hasn't finished
+  modifier canMint() {
+    require(!mintingFinished && msg.sender == minter);
+    _;
+  }
+ 
+  event Mint(address indexed to, uint256 amount);
+  event MintFinished();
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/StandardToken.sol.html b/coverage/lcov-report/tokens/erc20/StandardToken.sol.html new file mode 100644 index 00000000..a55554cf --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/StandardToken.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for tokens/erc20/StandardToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ StandardToken.sol +

+
+
+ 100% + Statements + 29/29 +
+
+ 100% + Branches + 12/12 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 29/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +  +  +  +  +  +  +  +  +5× +3× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +7× +6× +5× +4× +4× +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +  +  +1× +  +2× +2× +  +  +  +  +  +  +  +36× +  +  +  +  +  +  +  +  +55× +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../../interfaces/ERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+ 
+/**
+ * @title Standard ERC20 token
+ *
+ * @dev Implementation of the basic standard token.
+ * https://github.com/ethereum/EIPs/issues/20
+ * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
+ */
+contract StandardToken is ERC20 {
+  using SafeMath for uint256;
+ 
+  mapping(address => uint256) internal balances;
+ 
+  mapping (address => mapping (address => uint256)) internal allowed;
+ 
+  uint256 internal supply;
+ 
+ 
+  /**
+   * @dev Function to check the amount of tokens that an owner allowed to a spender.
+   * @param _owner address The address which owns the funds.
+   * @param _spender address The address which will spend the funds.
+   * @return A uint256 specifying the amount of tokens still available for the spender.
+   */
+  function allowance(address _owner, address _spender)
+  public
+  view
+  returns (uint256) {
+    return allowed[_owner][_spender];
+  }
+ 
+  /**
+  * @dev Transfer token for a specified address
+  * @param _to The address to transfer to.
+  * @param _value The amount to be transferred.
+  */
+  function transfer(address _to, uint256 _value) public returns (bool) {
+    require(_value <= balances[msg.sender]);
+    require(_to != address(0));
+    balances[msg.sender] = balances[msg.sender].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    emit Transfer(msg.sender, _to, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
+   * Beware that changing an allowance with this method brings the risk that someone may use both the old
+   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+   * @param _spender The address which will spend the funds.
+   * @param _value The amount of tokens to be spent.
+   */
+  function approve(address _spender, uint256 _value) public returns (bool) {
+    allowed[msg.sender][_spender] = _value;
+    emit Approval(msg.sender, _spender, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Transfer tokens from one address to another
+   * @param _from address The address which you want to send tokens from
+   * @param _to address The address which you want to transfer to
+   * @param _value uint256 the amount of tokens to be transferred
+   */
+  function transferFrom(address _from, address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_value <= balances[_from]);
+    require(_value <= allowed[_from][msg.sender]);
+    require(_to != address(0));
+    balances[_from] = balances[_from].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
+    emit Transfer(_from, _to, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Increase the amount of tokens that an owner allowed to a spender.
+   * approve should be called when allowed[_spender] == 0. To increment
+   * allowed value is better to use this function to avoid 2 calls (and wait until
+   * the first transaction is mined)
+   * From MonolithDAO Token.sol
+   * @param _spender The address which will spend the funds.
+   * @param _addedValue The amount of tokens to increase the allowance by.
+   */
+  function increaseApproval(
+    address _spender,
+    uint256 _addedValue
+  )
+    public
+    returns (bool)
+  {
+    allowed[msg.sender][_spender] = (
+      allowed[msg.sender][_spender].add(_addedValue));
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+  /**
+   * @dev Decrease the amount of tokens that an owner allowed to a spender.
+   * approve should be called when allowed[_spender] == 0. To decrement
+   * allowed value is better to use this function to avoid 2 calls (and wait until
+   * the first transaction is mined)
+   * From MonolithDAO Token.sol
+   * @param _spender The address which will spend the funds.
+   * @param _subtractedValue The amount of tokens to decrease the allowance by.
+   */
+  function decreaseApproval(address _spender, uint256 _subtractedValue)
+  public
+  returns (bool) {
+    uint256 oldValue = allowed[msg.sender][_spender];
+    if (_subtractedValue >= oldValue) {
+      allowed[msg.sender][_spender] = 0;
+    }
+    else {
+      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
+    }
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+ 
+  /**
+  * @dev Total number of tokens in existence
+  */
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  /**
+  * @dev Gets the balance of the specified address.
+  * @param _owner The address to query the the balance of.
+  * @return An uint256 representing the amount owned by the passed address.
+  */
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/lcov-report/tokens/erc20/index.html b/coverage/lcov-report/tokens/erc20/index.html new file mode 100644 index 00000000..1dbfba6a --- /dev/null +++ b/coverage/lcov-report/tokens/erc20/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for tokens/erc20/ + + + + + + + +
+
+

+ all files tokens/erc20/ +

+
+
+ 91.3% + Statements + 147/161 +
+
+ 80.43% + Branches + 37/46 +
+
+ 88.89% + Functions + 48/54 +
+
+ 89.71% + Lines + 157/175 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
BurnableToken.sol
100%42/42100%8/8100%11/11100%42/42
DividendToken.sol
95.83%23/24100%4/490.91%10/1196.55%28/29
DividendTokenERC20.sol
100%33/3383.33%10/12100%11/11100%37/37
GovernedToken.sol
70%7/1025%1/475%3/458.33%7/12
GovernedTokenERC20.sol
0%0/100%0/40%0/40%0/12
MintableToken.sol
100%13/13100%2/2100%5/5100%14/14
StandardToken.sol
100%29/29100%12/12100%8/8100%29/29
+
+
+ + + + + + + diff --git a/coverage/lcov.info b/coverage/lcov.info new file mode 100644 index 00000000..3ab99d7b --- /dev/null +++ b/coverage/lcov.info @@ -0,0 +1,2479 @@ +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/access/AccessHierarchy.sol +FN:14, +FN:22,approveUser +FN:35,removeUser +FN:47,setUpperAccessLevel +FN:55,noEmptyAddress +FN:61,onlyOwner +FN:67,onlyPlatform +FNF:7 +FNH:7 +FNDA:4, +FNDA:3,approveUser +FNDA:2,removeUser +FNDA:3,setUpperAccessLevel +FNDA:5,noEmptyAddress +FNDA:13,onlyOwner +FNDA:5,onlyPlatform +DA:16,4 +DA:27,3 +DA:28,2 +DA:29,2 +DA:30,2 +DA:39,2 +DA:40,2 +DA:41,2 +DA:42,2 +DA:50,3 +DA:51,2 +DA:56,5 +DA:57,4 +DA:62,13 +DA:63,10 +DA:68,5 +DA:69,4 +LF:17 +LH:17 +BRDA:27,1,0,2 +BRDA:27,1,1,1 +BRDA:50,2,0,2 +BRDA:50,2,1,1 +BRDA:56,3,0,4 +BRDA:56,3,1,1 +BRDA:62,4,0,10 +BRDA:62,4,1,3 +BRDA:68,5,0,4 +BRDA:68,5,1,1 +BRF:10 +BRH:10 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/access/ERC20Burner.sol +FN:18, +FN:28,burn +FN:42,setFee +FN:54, +FN:65,onlyOwner +FN:71,onlyPlatformContracts +FN:77,acceptedState +FNF:7 +FNH:7 +FNDA:6, +FNDA:40,burn +FNDA:15,setFee +FNDA:1, +FNDA:15,onlyOwner +FNDA:45,onlyPlatformContracts +FNDA:43,acceptedState +DA:20,6 +DA:21,6 +DA:22,6 +DA:33,40 +DA:34,39 +DA:35,39 +DA:47,15 +DA:48,15 +DA:49,15 +DA:57,1 +DA:66,15 +DA:67,15 +DA:72,45 +DA:73,43 +DA:78,43 +DA:79,43 +DA:80,40 +LF:17 +LH:17 +BRDA:22,1,0,6 +BRDA:22,1,1,0 +BRDA:33,2,0,39 +BRDA:33,2,1,1 +BRDA:66,3,0,15 +BRDA:66,3,1,0 +BRDA:72,4,0,43 +BRDA:72,4,1,2 +BRDA:79,5,0,40 +BRDA:79,5,1,3 +BRF:10 +BRH:8 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/access/Expirable.sol +FN:14, +FN:22,approveTemporaryUser +FN:36,removeTemporaryUser +FN:48,changeExpirationLength +FNF:4 +FNH:4 +FNDA:1, +FNDA:1,approveTemporaryUser +FNDA:1,removeTemporaryUser +FNDA:1,changeExpirationLength +DA:27,1 +DA:28,1 +DA:29,1 +DA:30,1 +DA:40,1 +DA:41,1 +DA:42,1 +DA:51,1 +DA:52,1 +DA:53,1 +LF:10 +LH:10 +BRDA:27,1,0,1 +BRDA:27,1,1,0 +BRDA:40,2,0,1 +BRDA:40,2,1,0 +BRF:4 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/access/KYC.sol +FN:11, +FN:14,approveKYC +FN:22,revokeKYC +FNF:3 +FNH:3 +FNDA:1, +FNDA:1,approveKYC +FNDA:1,revokeKYC +DA:17,1 +DA:18,1 +DA:25,1 +LF:3 +LH:3 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleERC20.sol +FN:21, +FN:32,buyAssetOrderERC20 +FN:62,refund +FN:86,payoutERC20 +FN:103,recoverTokens +FN:112,destroy +FN:126,finalizeCrowdsale +FN:141,onlyOwner +FN:147,whenNotPaused +FN:153,burnRequired +FN:159,validAsset +FN:165,beforeDeadline +FN:171,afterDeadline +FN:177,notFinalized +FNF:14 +FNH:11 +FNDA:2, +FNDA:5,buyAssetOrderERC20 +FNDA:1,refund +FNDA:3,payoutERC20 +FNDA:0,recoverTokens +FNDA:0,destroy +FNDA:3,finalizeCrowdsale +FNDA:0,onlyOwner +FNDA:9,whenNotPaused +FNDA:5,burnRequired +FNDA:9,validAsset +FNDA:7,beforeDeadline +FNDA:2,afterDeadline +FNDA:7,notFinalized +DA:23,2 +DA:24,2 +DA:39,5 +DA:40,5 +DA:41,5 +DA:42,5 +DA:43,5 +DA:44,3 +DA:45,3 +DA:46,3 +DA:47,3 +DA:48,3 +DA:49,3 +DA:52,2 +DA:53,2 +DA:55,4 +DA:56,4 +DA:69,1 +DA:70,1 +DA:71,1 +DA:72,1 +DA:73,1 +DA:74,1 +DA:75,1 +DA:76,1 +DA:77,1 +DA:90,3 +DA:91,3 +DA:92,3 +DA:93,3 +DA:94,2 +DA:95,2 +DA:96,2 +DA:97,2 +DA:98,2 +DA:99,2 +DA:106,0 +DA:107,0 +DA:108,0 +DA:115,0 +DA:116,0 +DA:130,3 +DA:131,3 +DA:132,3 +DA:133,3 +DA:142,0 +DA:143,0 +DA:148,9 +DA:149,8 +DA:154,5 +DA:155,5 +DA:160,9 +DA:161,9 +DA:166,7 +DA:167,6 +DA:172,2 +DA:173,1 +DA:178,7 +DA:179,6 +LF:59 +LH:52 +BRDA:43,1,0,3 +BRDA:43,1,1,2 +BRDA:44,2,0,3 +BRDA:44,2,1,0 +BRDA:45,3,0,3 +BRDA:45,3,1,0 +BRDA:46,4,0,3 +BRDA:46,4,1,0 +BRDA:47,5,0,3 +BRDA:47,5,1,0 +BRDA:48,6,0,3 +BRDA:48,6,1,0 +BRDA:49,7,0,2 +BRDA:49,7,1,1 +BRDA:52,8,0,2 +BRDA:52,8,1,0 +BRDA:53,9,0,2 +BRDA:53,9,1,0 +BRDA:69,10,0,1 +BRDA:69,10,1,0 +BRDA:93,11,0,2 +BRDA:93,11,1,1 +BRDA:142,12,0,0 +BRDA:142,12,1,0 +BRDA:148,13,0,8 +BRDA:148,13,1,1 +BRDA:154,14,0,5 +BRDA:154,14,1,0 +BRDA:160,15,0,9 +BRDA:160,15,1,0 +BRDA:166,16,0,6 +BRDA:166,16,1,1 +BRDA:172,17,0,1 +BRDA:172,17,1,1 +BRDA:178,18,0,6 +BRDA:178,18,1,1 +BRF:36 +BRH:24 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleETH.sol +FN:21, +FN:30,buyAssetOrderETH +FN:61,refund +FN:78,recoverTokens +FN:87,destroy +FN:95, +FN:109,payoutETH +FN:125,finalizeCrowdsale +FN:141,requiresEther +FN:147,onlyOwner +FN:153,burnRequired +FN:159,whenNotPaused +FN:165,validAsset +FN:171,beforeDeadline +FN:177,afterDeadline +FN:183,notFinalized +FNF:16 +FNH:15 +FNDA:2, +FNDA:5,buyAssetOrderETH +FNDA:2,refund +FNDA:0,recoverTokens +FNDA:1,destroy +FNDA:1, +FNDA:3,payoutETH +FNDA:3,finalizeCrowdsale +FNDA:8,requiresEther +FNDA:2,onlyOwner +FNDA:5,burnRequired +FNDA:3,whenNotPaused +FNDA:10,validAsset +FNDA:8,beforeDeadline +FNDA:2,afterDeadline +FNDA:7,notFinalized +DA:23,2 +DA:24,2 +DA:39,5 +DA:40,5 +DA:41,5 +DA:42,5 +DA:44,3 +DA:45,3 +DA:46,3 +DA:47,3 +DA:48,3 +DA:49,3 +DA:52,2 +DA:54,5 +DA:55,5 +DA:68,2 +DA:69,2 +DA:70,2 +DA:71,2 +DA:72,2 +DA:73,2 +DA:74,2 +DA:81,0 +DA:82,0 +DA:83,0 +DA:90,1 +DA:91,1 +DA:98,1 +DA:112,3 +DA:113,3 +DA:114,3 +DA:115,3 +DA:116,3 +DA:117,3 +DA:118,3 +DA:119,3 +DA:120,3 +DA:128,3 +DA:129,3 +DA:130,3 +DA:131,3 +DA:142,8 +DA:143,8 +DA:148,2 +DA:149,1 +DA:154,5 +DA:155,5 +DA:160,3 +DA:161,2 +DA:166,10 +DA:167,10 +DA:172,8 +DA:173,5 +DA:178,2 +DA:179,2 +DA:184,7 +DA:185,7 +LF:57 +LH:54 +BRDA:42,1,0,3 +BRDA:42,1,1,2 +BRDA:44,2,0,3 +BRDA:44,2,1,0 +BRDA:45,3,0,3 +BRDA:45,3,1,0 +BRDA:46,4,0,3 +BRDA:46,4,1,0 +BRDA:47,5,0,3 +BRDA:47,5,1,0 +BRDA:48,6,0,3 +BRDA:48,6,1,0 +BRDA:52,7,0,2 +BRDA:52,7,1,0 +BRDA:68,8,0,2 +BRDA:68,8,1,0 +BRDA:114,9,0,3 +BRDA:114,9,1,0 +BRDA:142,10,0,8 +BRDA:142,10,1,0 +BRDA:148,11,0,1 +BRDA:148,11,1,1 +BRDA:154,12,0,5 +BRDA:154,12,1,0 +BRDA:160,13,0,2 +BRDA:160,13,1,1 +BRDA:166,14,0,10 +BRDA:166,14,1,0 +BRDA:172,15,0,5 +BRDA:172,15,1,3 +BRDA:178,16,0,2 +BRDA:178,16,1,0 +BRDA:184,17,0,7 +BRDA:184,17,1,0 +BRF:34 +BRH:21 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleGeneratorERC20.sol +FN:21, +FN:35,createAssetOrderERC20 +FN:63,burnRequired +FNF:3 +FNH:3 +FNDA:2, +FNDA:6,createAssetOrderERC20 +FNDA:6,burnRequired +DA:23,2 +DA:24,2 +DA:38,6 +DA:39,5 +DA:40,5 +DA:41,5 +DA:42,4 +DA:43,4 +DA:44,3 +DA:45,3 +DA:46,3 +DA:47,3 +DA:48,3 +DA:49,3 +DA:50,3 +DA:51,3 +DA:52,3 +DA:53,3 +DA:54,3 +DA:65,6 +DA:66,6 +LF:21 +LH:21 +BRDA:38,1,0,5 +BRDA:38,1,1,1 +BRDA:39,2,0,5 +BRDA:39,2,1,0 +BRDA:40,3,0,5 +BRDA:40,3,1,0 +BRDA:41,4,0,4 +BRDA:41,4,1,1 +BRDA:43,5,0,3 +BRDA:43,5,1,1 +BRDA:65,6,0,6 +BRDA:65,6,1,0 +BRF:12 +BRH:9 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/crowdsale/CrowdsaleGeneratorETH.sol +FN:21, +FN:34,createAssetOrderETH +FN:63,burnRequired +FNF:3 +FNH:3 +FNDA:2, +FNDA:9,createAssetOrderETH +FNDA:9,burnRequired +DA:23,2 +DA:24,2 +DA:38,9 +DA:39,8 +DA:40,7 +DA:41,7 +DA:42,6 +DA:43,6 +DA:44,5 +DA:45,5 +DA:46,5 +DA:47,5 +DA:48,5 +DA:49,5 +DA:50,5 +DA:51,5 +DA:52,5 +DA:53,5 +DA:54,5 +DA:65,9 +DA:66,9 +LF:21 +LH:21 +BRDA:38,1,0,8 +BRDA:38,1,1,1 +BRDA:39,2,0,7 +BRDA:39,2,1,1 +BRDA:40,3,0,7 +BRDA:40,3,1,0 +BRDA:41,4,0,6 +BRDA:41,4,1,1 +BRDA:43,5,0,5 +BRDA:43,5,1,1 +BRDA:65,6,0,9 +BRDA:65,6,1,0 +BRF:12 +BRH:10 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/database/API.sol +FN:31, +FN:43,getNumTokensAvailable +FN:53,getInvestorVotes +FN:60,getTotalVotes +FN:67,getCurrentConsensus +FN:75,getAssetManagerParameterHash +FN:82,getExecutionID +FN:89,getMethodID +FN:96,getAssetID +FN:103,getOrderID +FN:114,generateAssetID +FN:122,getAssetID +FN:130,getAssetAddress +FN:138,getAssetFundingToken +FN:156,getAssetROI +FN:164,getAssetFundingGoal +FN:172,getAssetFundingDeadline +FN:180,crowdsaleFinalized +FN:193,getAssetManager +FN:201,getAssetManagerFee +FN:209,getAssetManagerEscrowID +FN:217,getAssetManagerEscrow +FN:224,getAssetManagerEscrowRemaining +FN:233,getAssetManagerEscrowRedeemed +FN:241,getAssetOperator +FN:249,generateOperatorID +FN:257,getOperatorID +FN:265,getOperatorAddress +FN:277,generateOrderID +FN:290,getPlatformToken +FN:298,getPlatformWallet +FN:306,getContractAddress +FN:314,getCurrentState +FN:322,getUserPermission +FN:330,getFunctionCost +FN:338,contractPaused +FN:350,contractOwner +FNF:37 +FNH:14 +FNDA:6, +FNDA:1,getNumTokensAvailable +FNDA:0,getInvestorVotes +FNDA:1,getTotalVotes +FNDA:1,getCurrentConsensus +FNDA:3,getAssetManagerParameterHash +FNDA:1,getExecutionID +FNDA:3,getMethodID +FNDA:0,getAssetID +FNDA:0,getOrderID +FNDA:0,generateAssetID +FNDA:0,getAssetID +FNDA:2,getAssetAddress +FNDA:0,getAssetFundingToken +FNDA:1,getAssetROI +FNDA:0,getAssetFundingGoal +FNDA:0,getAssetFundingDeadline +FNDA:4,crowdsaleFinalized +FNDA:0,getAssetManager +FNDA:0,getAssetManagerFee +FNDA:2,getAssetManagerEscrowID +FNDA:1,getAssetManagerEscrow +FNDA:1,getAssetManagerEscrowRemaining +FNDA:1,getAssetManagerEscrowRedeemed +FNDA:0,getAssetOperator +FNDA:0,generateOperatorID +FNDA:0,getOperatorID +FNDA:0,getOperatorAddress +FNDA:0,generateOrderID +FNDA:0,getPlatformToken +FNDA:0,getPlatformWallet +FNDA:0,getContractAddress +FNDA:0,getCurrentState +FNDA:0,getUserPermission +FNDA:0,getFunctionCost +FNDA:0,contractPaused +FNDA:0,contractOwner +DA:33,6 +DA:47,1 +DA:48,1 +DA:49,1 +DA:50,1 +DA:57,0 +DA:64,1 +DA:71,1 +DA:72,1 +DA:79,3 +DA:86,1 +DA:93,3 +DA:100,0 +DA:107,0 +DA:118,0 +DA:119,0 +DA:126,0 +DA:127,0 +DA:134,2 +DA:135,2 +DA:142,0 +DA:143,0 +DA:160,1 +DA:161,1 +DA:168,0 +DA:169,0 +DA:176,0 +DA:177,0 +DA:184,4 +DA:185,4 +DA:197,0 +DA:198,0 +DA:205,0 +DA:206,0 +DA:213,2 +DA:214,2 +DA:221,1 +DA:228,1 +DA:229,1 +DA:230,1 +DA:237,1 +DA:238,1 +DA:245,0 +DA:246,0 +DA:253,0 +DA:254,0 +DA:261,0 +DA:262,0 +DA:269,0 +DA:270,0 +DA:281,0 +DA:282,0 +DA:294,0 +DA:295,0 +DA:302,0 +DA:303,0 +DA:310,0 +DA:311,0 +DA:318,0 +DA:319,0 +DA:326,0 +DA:327,0 +DA:334,0 +DA:335,0 +DA:342,0 +DA:343,0 +DA:354,0 +DA:355,0 +LF:68 +LH:25 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/database/ContractManager.sol +FN:13, +FN:21,addContract +FN:39,removeContract +FN:53,updateContract +FN:73,setContractStatePreferences +FN:89,anyOwner +FN:96,isRestricted +FN:102,contractExists +FN:107,isTrue +FNF:9 +FNH:8 +FNDA:16, +FNDA:69,addContract +FNDA:1,removeContract +FNDA:1,updateContract +FNDA:177,setContractStatePreferences +FNDA:72,anyOwner +FNDA:0,isRestricted +FNDA:4,contractExists +FNDA:147,isTrue +DA:15,16 +DA:26,69 +DA:27,68 +DA:28,67 +DA:29,67 +DA:30,67 +DA:31,67 +DA:32,67 +DA:33,67 +DA:44,1 +DA:45,1 +DA:46,1 +DA:47,1 +DA:58,1 +DA:59,1 +DA:60,1 +DA:61,1 +DA:62,1 +DA:63,1 +DA:64,1 +DA:65,1 +DA:66,1 +DA:76,177 +DA:77,177 +DA:78,177 +DA:79,177 +DA:80,177 +DA:90,72 +DA:91,71 +DA:97,0 +DA:98,0 +DA:99,0 +DA:103,4 +DA:104,2 +DA:108,147 +DA:109,145 +LF:36 +LH:33 +BRDA:26,1,0,68 +BRDA:26,1,1,1 +BRDA:27,2,0,67 +BRDA:27,2,1,1 +BRDA:90,3,0,71 +BRDA:90,3,1,1 +BRDA:97,4,0,0 +BRDA:97,4,1,0 +BRDA:103,5,0,2 +BRDA:103,5,1,2 +BRDA:108,6,0,145 +BRDA:108,6,1,2 +BRF:12 +BRH:10 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/database/Database.sol +FN:23, +FN:36,enableContractManagement +FN:47,setAddress +FN:53,setUint +FN:59,setString +FN:65,setBytes +FN:71,setBytes32 +FN:77,setBool +FN:83,setInt +FN:91,deleteAddress +FN:97,deleteUint +FN:103,deleteString +FN:109,deleteBytes +FN:115,deleteBytes32 +FN:121,deleteBool +FN:127,deleteInt +FN:139,onlyApprovedContract +FNF:17 +FNH:17 +FNDA:16, +FNDA:19,enableContractManagement +FNDA:142,setAddress +FNDA:67,setUint +FNDA:1,setString +FNDA:1,setBytes +FNDA:87,setBytes32 +FNDA:445,setBool +FNDA:1,setInt +FNDA:7,deleteAddress +FNDA:23,deleteUint +FNDA:1,deleteString +FNDA:1,deleteBytes +FNDA:1,deleteBytes32 +FNDA:7,deleteBool +FNDA:1,deleteInt +FNDA:786,onlyApprovedContract +DA:24,16 +DA:25,17 +DA:26,17 +DA:28,16 +DA:29,15 +DA:38,19 +DA:39,18 +DA:40,17 +DA:41,16 +DA:42,15 +DA:43,15 +DA:50,142 +DA:56,67 +DA:62,1 +DA:68,1 +DA:74,87 +DA:80,445 +DA:86,1 +DA:94,7 +DA:100,23 +DA:106,1 +DA:112,1 +DA:118,1 +DA:124,7 +DA:130,1 +DA:140,786 +DA:141,785 +LF:27 +LH:27 +BRDA:28,1,0,15 +BRDA:28,1,1,1 +BRDA:38,2,0,18 +BRDA:38,2,1,1 +BRDA:39,3,0,17 +BRDA:39,3,1,1 +BRDA:40,4,0,16 +BRDA:40,4,1,1 +BRDA:41,5,0,15 +BRDA:41,5,1,1 +BRDA:140,6,0,785 +BRDA:140,6,1,1 +BRF:12 +BRH:12 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/database/Events.sol +FN:8,numberStored +FN:20,onlyApprovedContract +FNF:2 +FNH:0 +FNDA:0,numberStored +FNDA:0,onlyApprovedContract +DA:11,0 +DA:21,0 +DA:22,0 +LF:3 +LH:0 +BRDA:21,1,0,0 +BRDA:21,1,1,0 +BRF:2 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/database/HashEncode.sol +FN:4,encode +FN:7,encode +FN:10,encode +FN:13,encode +FN:16,encode +FN:19,encode +FNF:6 +FNH:0 +FNDA:0,encode +FNDA:0,encode +FNDA:0,encode +FNDA:0,encode +FNDA:0,encode +FNDA:0,encode +DA:5,0 +DA:8,0 +DA:11,0 +DA:14,0 +DA:17,0 +DA:20,0 +LF:6 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/AssetExchange.sol +FN:27, +FN:39,buyAsset +FN:62,sellAsset +FN:83,createBuyOrder +FN:105,createSellOrder +FN:126,deleteOrder +FN:142,withdraw +FN:156,destroy +FN:174,validAsset +FN:183,isAllowed +FN:191,aboveZero +FN:197,burnRequired +FN:206,whenNotPaused +FN:214,requiresEther +FN:222,anyOwner +FNF:15 +FNH:15 +FNDA:2, +FNDA:4,buyAsset +FNDA:2,sellAsset +FNDA:4,createBuyOrder +FNDA:3,createSellOrder +FNDA:3,deleteOrder +FNDA:1,withdraw +FNDA:3,destroy +FNDA:10,validAsset +FNDA:10,isAllowed +FNDA:11,aboveZero +FNDA:8,burnRequired +FNDA:8,whenNotPaused +FNDA:7,requiresEther +FNDA:4,anyOwner +DA:29,2 +DA:30,2 +DA:46,4 +DA:47,4 +DA:48,3 +DA:49,1 +DA:50,1 +DA:51,1 +DA:52,1 +DA:53,1 +DA:54,1 +DA:67,2 +DA:68,2 +DA:69,1 +DA:70,1 +DA:71,1 +DA:72,1 +DA:73,1 +DA:74,1 +DA:75,1 +DA:76,1 +DA:91,4 +DA:92,3 +DA:93,3 +DA:94,2 +DA:95,2 +DA:96,2 +DA:97,2 +DA:98,2 +DA:111,3 +DA:112,3 +DA:113,2 +DA:114,2 +DA:115,2 +DA:116,2 +DA:129,3 +DA:130,3 +DA:131,2 +DA:132,1 +DA:133,1 +DA:134,1 +DA:136,2 +DA:137,2 +DA:146,1 +DA:147,1 +DA:148,1 +DA:149,1 +DA:159,3 +DA:160,2 +DA:161,1 +DA:162,1 +DA:175,10 +DA:176,9 +DA:177,8 +DA:184,10 +DA:185,9 +DA:192,11 +DA:193,10 +DA:199,8 +DA:200,8 +DA:207,8 +DA:208,7 +DA:215,7 +DA:216,6 +DA:223,4 +DA:224,3 +LF:66 +LH:66 +BRDA:47,1,0,3 +BRDA:47,1,1,1 +BRDA:48,2,0,1 +BRDA:48,2,1,2 +BRDA:50,3,0,1 +BRDA:50,3,1,0 +BRDA:68,4,0,1 +BRDA:68,4,1,1 +BRDA:71,5,0,1 +BRDA:71,5,1,0 +BRDA:91,6,0,3 +BRDA:91,6,1,1 +BRDA:93,7,0,2 +BRDA:93,7,1,1 +BRDA:112,8,0,2 +BRDA:112,8,1,1 +BRDA:130,9,0,2 +BRDA:130,9,1,1 +BRDA:131,10,0,1 +BRDA:131,10,1,1 +BRDA:159,11,0,2 +BRDA:159,11,1,1 +BRDA:160,12,0,1 +BRDA:160,12,1,1 +BRDA:175,13,0,9 +BRDA:175,13,1,1 +BRDA:176,14,0,8 +BRDA:176,14,1,1 +BRDA:184,15,0,9 +BRDA:184,15,1,1 +BRDA:192,16,0,10 +BRDA:192,16,1,1 +BRDA:199,17,0,8 +BRDA:199,17,1,0 +BRDA:207,18,0,7 +BRDA:207,18,1,1 +BRDA:215,19,0,6 +BRDA:215,19,1,1 +BRDA:223,20,0,3 +BRDA:223,20,1,1 +BRF:40 +BRH:37 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/AssetGenerator.sol +FN:19, +FN:27,createAsset +FN:43,createTradeableAsset +FN:64,burnRequired +FNF:4 +FNH:4 +FNDA:1, +FNDA:2,createAsset +FNDA:2,createTradeableAsset +FNDA:4,burnRequired +DA:21,1 +DA:31,2 +DA:32,1 +DA:33,1 +DA:34,1 +DA:35,1 +DA:36,1 +DA:37,1 +DA:38,1 +DA:47,2 +DA:48,1 +DA:49,1 +DA:50,1 +DA:51,1 +DA:52,1 +DA:53,4 +DA:55,1 +DA:56,1 +DA:57,1 +DA:58,1 +DA:59,1 +DA:65,4 +DA:66,4 +DA:67,4 +LF:24 +LH:24 +BRDA:31,1,0,1 +BRDA:31,1,1,1 +BRDA:33,2,0,1 +BRDA:33,2,1,0 +BRDA:47,3,0,1 +BRDA:47,3,1,1 +BRDA:50,4,0,1 +BRDA:50,4,1,0 +BRDA:66,5,0,4 +BRDA:66,5,1,0 +BRF:10 +BRH:7 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/PlatformFunds.sol +FN:10, +FN:17,setPlatformWallet +FN:25,setPlatformToken +FN:37,onlyOwner +FNF:4 +FNH:4 +FNDA:9, +FNDA:7,setPlatformWallet +FNDA:9,setPlatformToken +FNDA:18,onlyOwner +DA:12,9 +DA:20,7 +DA:21,7 +DA:28,9 +DA:29,9 +DA:38,18 +DA:39,16 +LF:7 +LH:7 +BRDA:38,1,0,16 +BRDA:38,1,1,2 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ecosystem/Staking.sol +FN:18, +FN:24,requestStaking +FN:35,purchaseStake +FN:58,noEmptyBytes +FNF:4 +FNH:0 +FNDA:0, +FNDA:0,requestStaking +FNDA:0,purchaseStake +FNDA:0,noEmptyBytes +DA:20,0 +DA:27,0 +DA:28,0 +DA:29,0 +DA:30,0 +DA:31,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:59,0 +DA:60,0 +LF:18 +LH:0 +BRDA:39,1,0,0 +BRDA:39,1,1,0 +BRDA:44,2,0,0 +BRDA:44,2,1,0 +BRDA:45,3,0,0 +BRDA:45,3,1,0 +BRDA:46,4,0,0 +BRDA:46,4,1,0 +BRDA:59,5,0,0 +BRDA:59,5,1,0 +BRF:10 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ApproveAndCallFallback.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/BurnableERC20.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/BurnERC20.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/DBInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/DivToken.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ERC20.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/ERC20DividendInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/EtherDividendInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/GovToken.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/PullPayment.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/interfaces/TokenFactoryInterface.sol +FNF:0 +FNH:0 +LF:0 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/math/SafeMath.sol +FN:10,mul +FN:20,div +FN:28,sub +FN:34,add +FN:41,getFractionalAmount +FNF:5 +FNH:5 +FNDA:149,mul +FNDA:109,div +FNDA:497,sub +FNDA:474,add +FNDA:1,getFractionalAmount +DA:11,149 +DA:12,27 +DA:14,122 +DA:15,122 +DA:16,121 +DA:24,109 +DA:29,497 +DA:30,493 +DA:35,474 +DA:36,474 +DA:37,473 +DA:45,1 +LF:12 +LH:12 +BRDA:11,1,0,27 +BRDA:11,1,1,122 +BRDA:15,2,0,121 +BRDA:15,2,1,1 +BRDA:29,3,0,493 +BRDA:29,3,1,4 +BRDA:36,4,0,473 +BRDA:36,4,1,1 +BRF:8 +BRH:8 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ownership/AssetGovernance.sol +FN:25, +FN:33,voteForExecution +FN:51,unlockToken +FN:71,isConsensusReached +FN:89,lockTokens +FN:114,validAsset +FNF:6 +FNH:5 +FNDA:1, +FNDA:4,voteForExecution +FNDA:0,unlockToken +FNDA:1,isConsensusReached +FNDA:4,lockTokens +FNDA:4,validAsset +DA:27,1 +DA:37,4 +DA:38,4 +DA:39,4 +DA:40,4 +DA:41,4 +DA:42,4 +DA:43,3 +DA:44,3 +DA:45,3 +DA:55,0 +DA:56,0 +DA:57,0 +DA:58,0 +DA:59,0 +DA:60,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:75,1 +DA:76,1 +DA:77,1 +DA:78,1 +DA:79,1 +DA:92,4 +DA:93,4 +DA:94,4 +DA:95,3 +DA:96,3 +DA:115,4 +DA:116,4 +LF:31 +LH:22 +BRDA:42,1,0,3 +BRDA:42,1,1,1 +BRDA:60,2,0,0 +BRDA:60,2,1,0 +BRDA:94,3,0,3 +BRDA:94,3,1,1 +BRDA:115,4,0,4 +BRDA:115,4,1,0 +BRF:8 +BRH:5 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ownership/CollectiveOwned.sol +FN:19, +FN:30,addOwner +FN:41,removeOwner +FN:49,setQuorumLevel +FN:59,voteForExecution +FN:74,isQuorumReached +FN:93,onlyOwner +FN:100,isRestricted +FNF:8 +FNH:0 +FNDA:0, +FNDA:0,addOwner +FNDA:0,removeOwner +FNDA:0,setQuorumLevel +FNDA:0,voteForExecution +FNDA:0,isQuorumReached +FNDA:0,onlyOwner +FNDA:0,isRestricted +DA:21,0 +DA:22,0 +DA:23,0 +DA:24,0 +DA:34,0 +DA:35,0 +DA:36,0 +DA:45,0 +DA:53,0 +DA:54,0 +DA:55,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:65,0 +DA:66,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:81,0 +DA:83,0 +DA:94,0 +DA:95,0 +DA:101,0 +DA:102,0 +DA:103,0 +LF:26 +LH:0 +BRDA:94,1,0,0 +BRDA:94,1,1,0 +BRDA:101,2,0,0 +BRDA:101,2,1,0 +BRF:4 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ownership/Pausible.sol +FN:14, +FN:21,pause +FN:30,unpause +FN:38,onlyOwner +FNF:4 +FNH:4 +FNDA:4, +FNDA:3,pause +FNDA:3,unpause +FNDA:7,onlyOwner +DA:16,4 +DA:24,3 +DA:25,3 +DA:33,3 +DA:34,3 +DA:39,7 +DA:40,6 +LF:7 +LH:7 +BRDA:39,1,0,6 +BRDA:39,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ownership/SingleOwned.sol +FN:13, +FN:18,changeOwner +FN:27,onlyOwner +FNF:3 +FNH:3 +FNDA:2, +FNDA:1,changeOwner +FNDA:2,onlyOwner +DA:14,2 +DA:21,1 +DA:22,1 +DA:23,1 +DA:28,2 +DA:29,1 +LF:6 +LH:6 +BRDA:28,1,0,1 +BRDA:28,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/ownership/TokenGovernance.sol +FN:30, +FN:41,setQuorumLevel +FN:51,voteForExecution +FN:63,unlockTokens +FN:80,lockTokens +FN:95,isQuorumReached +FN:114,isRestricted +FN:122,onlyOwner +FNF:8 +FNH:0 +FNDA:0, +FNDA:0,setQuorumLevel +FNDA:0,voteForExecution +FNDA:0,unlockTokens +FNDA:0,lockTokens +FNDA:0,isQuorumReached +FNDA:0,isRestricted +FNDA:0,onlyOwner +DA:32,0 +DA:33,0 +DA:34,0 +DA:35,0 +DA:36,0 +DA:37,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:54,0 +DA:55,0 +DA:56,0 +DA:57,0 +DA:58,0 +DA:59,0 +DA:66,0 +DA:67,0 +DA:68,0 +DA:69,0 +DA:70,0 +DA:71,0 +DA:72,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 +DA:99,0 +DA:100,0 +DA:101,0 +DA:102,0 +DA:104,0 +DA:115,0 +DA:116,0 +DA:118,0 +DA:123,0 +DA:124,0 +LF:37 +LH:0 +BRDA:56,1,0,0 +BRDA:56,1,1,0 +BRDA:84,2,0,0 +BRDA:84,2,1,0 +BRDA:115,3,0,0 +BRDA:115,3,1,0 +BRDA:123,4,0,0 +BRDA:123,4,1,0 +BRF:8 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/roles/AssetManagerEscrow.sol +FN:20, +FN:27,lockEscrow +FN:44,unlockEscrow +FN:76,becomeAssetManager +FN:97,removeAssetManager +FN:113,hasConsensus +FNF:6 +FNH:5 +FNDA:3, +FNDA:4,lockEscrow +FNDA:10,unlockEscrow +FNDA:0,becomeAssetManager +FNDA:1,removeAssetManager +FNDA:2,hasConsensus +DA:22,3 +DA:30,4 +DA:31,3 +DA:32,3 +DA:33,3 +DA:34,3 +DA:35,3 +DA:36,3 +DA:37,3 +DA:47,10 +DA:48,9 +DA:49,8 +DA:50,8 +DA:51,8 +DA:52,8 +DA:53,8 +DA:55,1 +DA:59,7 +DA:60,7 +DA:61,7 +DA:62,7 +DA:63,7 +DA:65,5 +DA:66,5 +DA:67,2 +DA:69,3 +DA:70,3 +DA:80,0 +DA:81,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:88,0 +DA:89,0 +DA:100,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:114,2 +DA:115,2 +DA:116,2 +DA:117,0 +LF:44 +LH:34 +BRDA:30,1,0,3 +BRDA:30,1,1,1 +BRDA:33,2,0,3 +BRDA:33,2,1,0 +BRDA:47,3,0,9 +BRDA:47,3,1,1 +BRDA:48,4,0,8 +BRDA:48,4,1,1 +BRDA:53,5,0,1 +BRDA:53,5,1,7 +BRDA:55,6,0,1 +BRDA:55,6,1,0 +BRDA:63,7,0,5 +BRDA:63,7,1,2 +BRDA:66,8,0,2 +BRDA:66,8,1,3 +BRDA:69,9,0,3 +BRDA:69,9,1,0 +BRDA:81,10,0,0 +BRDA:81,10,1,0 +BRDA:85,11,0,0 +BRDA:85,11,1,0 +BRDA:86,12,0,0 +BRDA:86,12,1,0 +BRDA:86,13,0,0 +BRDA:86,13,1,0 +BRDA:87,14,0,0 +BRDA:87,14,1,0 +BRDA:88,15,0,0 +BRDA:88,15,1,0 +BRDA:116,16,0,0 +BRDA:116,16,1,2 +BRF:32 +BRH:16 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/roles/AssetManagerFunds.sol +FN:26, +FN:33,withdraw +FN:62,retrieveAssetManagerTokens +FN:96,retrieveAssetManagerETH +FN:118,containsAddress +FN:130,nonReentrant +FN:137, +FNF:7 +FNH:6 +FNDA:3, +FNDA:0,withdraw +FNDA:1,retrieveAssetManagerTokens +FNDA:1,retrieveAssetManagerETH +FNDA:1,containsAddress +FNDA:2,nonReentrant +FNDA:1, +DA:28,3 +DA:37,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:49,0 +DA:52,0 +DA:53,0 +DA:54,0 +DA:55,0 +DA:56,0 +DA:57,0 +DA:59,0 +DA:66,1 +DA:67,1 +DA:68,1 +DA:69,1 +DA:70,1 +DA:71,1 +DA:72,1 +DA:73,1 +DA:74,1 +DA:75,1 +DA:76,1 +DA:77,1 +DA:78,1 +DA:79,1 +DA:81,1 +DA:82,1 +DA:83,1 +DA:85,1 +DA:86,1 +DA:89,1 +DA:90,1 +DA:92,1 +DA:100,1 +DA:101,1 +DA:102,1 +DA:103,1 +DA:104,1 +DA:105,1 +DA:106,1 +DA:107,1 +DA:108,1 +DA:109,1 +DA:110,1 +DA:111,1 +DA:113,1 +DA:114,1 +DA:122,1 +DA:123,1 +DA:125,1 +DA:131,2 +DA:132,2 +DA:133,2 +DA:134,2 +LF:64 +LH:44 +BRDA:37,1,0,0 +BRDA:37,1,1,0 +BRDA:39,2,0,0 +BRDA:39,2,1,0 +BRDA:42,3,0,0 +BRDA:42,3,1,0 +BRDA:45,4,0,0 +BRDA:45,4,1,0 +BRDA:47,5,0,0 +BRDA:47,5,1,0 +BRDA:48,6,0,0 +BRDA:48,6,1,0 +BRDA:53,7,0,0 +BRDA:53,7,1,0 +BRDA:55,8,0,0 +BRDA:55,8,1,0 +BRDA:56,9,0,0 +BRDA:56,9,1,0 +BRDA:66,10,0,1 +BRDA:66,10,1,0 +BRDA:71,11,0,1 +BRDA:71,11,1,0 +BRDA:73,12,0,1 +BRDA:73,12,1,0 +BRDA:75,13,0,1 +BRDA:75,13,1,0 +BRDA:79,14,0,0 +BRDA:79,14,1,1 +BRDA:85,15,0,1 +BRDA:85,15,1,0 +BRDA:86,16,0,1 +BRDA:86,16,1,0 +BRDA:90,17,0,1 +BRDA:90,17,1,0 +BRDA:100,18,0,1 +BRDA:100,18,1,0 +BRDA:103,19,0,1 +BRDA:103,19,1,0 +BRDA:107,20,0,1 +BRDA:107,20,1,0 +BRDA:109,21,0,1 +BRDA:109,21,1,0 +BRDA:110,22,0,1 +BRDA:110,22,1,0 +BRDA:123,23,0,0 +BRDA:123,23,1,1 +BRDA:134,24,0,2 +BRDA:134,24,1,0 +BRF:48 +BRH:15 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/roles/Operators.sol +FN:10, +FN:16,registerOperator +FN:28,removeOperator +FN:37,changeOperatorAddress +FN:48,acceptERC20Token +FN:57,acceptEther +FN:70,onlyOwner +FN:76,onlyOperator +FNF:8 +FNH:8 +FNDA:8, +FNDA:10,registerOperator +FNDA:3,removeOperator +FNDA:3,changeOperatorAddress +FNDA:2,acceptERC20Token +FNDA:3,acceptEther +FNDA:14,onlyOwner +FNDA:5,onlyOperator +DA:11,8 +DA:19,10 +DA:20,10 +DA:21,10 +DA:22,9 +DA:23,9 +DA:24,9 +DA:31,3 +DA:32,3 +DA:39,3 +DA:40,3 +DA:41,2 +DA:42,1 +DA:43,1 +DA:44,1 +DA:52,2 +DA:53,2 +DA:61,3 +DA:62,3 +DA:71,14 +DA:72,13 +DA:77,5 +DA:78,5 +LF:23 +LH:23 +BRDA:19,1,0,10 +BRDA:19,1,1,0 +BRDA:21,2,0,9 +BRDA:21,2,1,1 +BRDA:40,3,0,2 +BRDA:40,3,1,1 +BRDA:41,4,0,1 +BRDA:41,4,1,1 +BRDA:71,5,0,13 +BRDA:71,5,1,1 +BRDA:77,6,0,5 +BRDA:77,6,1,0 +BRF:12 +BRH:10 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/test/ApproveAndCallTest.sol +FN:4,receiveApproval +FNF:1 +FNH:1 +FNDA:2,receiveApproval +DA:6,2 +LF:1 +LH:1 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/test/HashFunctions.sol +FN:5,toBytes +FN:15,getMethodID +FN:22,getAssetID +FN:29,getOrderID +FN:36,getFunctionInitiatorHash +FN:43,uintHash +FN:50,getStakingID +FN:57,stringHash +FN:64,addressHash +FN:72,contractHash +FN:79,stringAddress +FN:86,stringString +FN:93,stringBytes +FN:100,stringUint +FN:107,stringBytesAddress +FN:114,addressUintUint +FN:122,getAuthorizeHash +FN:129,uintUint +FN:137,uintUintUint +FN:144,currentTime +FN:151,nullBytes +FN:158,nullAddress +FN:165, +FNF:23 +FNH:5 +FNDA:0,toBytes +FNDA:0,getMethodID +FNDA:8,getAssetID +FNDA:0,getOrderID +FNDA:1,getFunctionInitiatorHash +FNDA:0,uintHash +FNDA:0,getStakingID +FNDA:0,stringHash +FNDA:1,addressHash +FNDA:0,contractHash +FNDA:8,stringAddress +FNDA:0,stringString +FNDA:21,stringBytes +FNDA:0,stringUint +FNDA:0,stringBytesAddress +FNDA:0,addressUintUint +FNDA:0,getAuthorizeHash +FNDA:0,uintUint +FNDA:0,uintUintUint +FNDA:0,currentTime +FNDA:0,nullBytes +FNDA:0,nullAddress +FNDA:0, +DA:9,0 +DA:10,0 +DA:19,0 +DA:26,8 +DA:33,0 +DA:40,1 +DA:47,0 +DA:54,0 +DA:61,0 +DA:68,1 +DA:76,0 +DA:83,8 +DA:90,0 +DA:97,21 +DA:104,0 +DA:111,0 +DA:118,0 +DA:126,0 +DA:133,0 +DA:141,0 +DA:148,0 +DA:155,0 +DA:162,0 +DA:167,0 +LF:24 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/test/SafeMathWrapper.sol +FN:9,multiply +FN:13,divide +FN:17,subtract +FN:21,addto +FN:25,fraction +FNF:5 +FNH:5 +FNDA:3,multiply +FNDA:1,divide +FNDA:2,subtract +FNDA:2,addto +FNDA:1,fraction +DA:10,3 +DA:14,1 +DA:18,2 +DA:22,2 +DA:26,1 +LF:5 +LH:5 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/test/TestBurner.sol +FN:13, +FN:19,burnTokensManualFee +FN:25,burnTokens +FN:33,getMethodID +FNF:4 +FNH:4 +FNDA:1, +FNDA:4,burnTokensManualFee +FNDA:2,burnTokens +FNDA:1,getMethodID +DA:15,1 +DA:16,1 +DA:21,4 +DA:27,2 +DA:28,2 +DA:29,2 +DA:30,1 +DA:37,1 +LF:8 +LH:8 +BRDA:21,1,0,1 +BRDA:21,1,1,3 +BRDA:29,2,0,1 +BRDA:29,2,1,1 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/test/WithdrawTest.sol +FN:7,withdraw +FN:17,deposit +FNF:2 +FNH:1 +FNDA:0,withdraw +FNDA:1,deposit +DA:10,0 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:20,1 +DA:21,1 +LF:7 +LH:2 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/EqualDistribution.sol +FN:22, +FN:31,getFunds +FN:39,withdraw +FN:51, +FN:63,isBeneficiary +FNF:5 +FNH:2 +FNDA:1, +FNDA:0,getFunds +FNDA:0,withdraw +FNDA:0, +FNDA:2,isBeneficiary +DA:24,1 +DA:25,1 +DA:34,0 +DA:35,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:54,0 +DA:67,2 +DA:68,5 +DA:70,1 +LF:14 +LH:5 +BRDA:24,1,0,1 +BRDA:24,1,1,0 +BRDA:68,2,0,1 +BRDA:68,2,1,4 +BRF:4 +BRH:3 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/FixedDistribution.sol +FN:15, +FNF:1 +FNH:1 +FNDA:2, +DA:17,2 +DA:18,2 +DA:19,2 +DA:20,2 +DA:21,6 +DA:22,6 +DA:24,2 +LF:7 +LH:7 +BRDA:17,1,0,2 +BRDA:17,1,1,0 +BRF:2 +BRH:1 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/MintableDistribution.sol +FN:19, +FN:28,mint +FN:40,finishMinting +FN:55,canMint +FNF:4 +FNH:4 +FNDA:1, +FNDA:2,mint +FNDA:1,finishMinting +FNDA:4,canMint +DA:21,1 +DA:22,1 +DA:32,2 +DA:33,2 +DA:34,2 +DA:35,2 +DA:44,1 +DA:45,1 +DA:46,1 +DA:56,4 +DA:57,3 +LF:11 +LH:11 +BRDA:56,1,0,3 +BRDA:56,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/distribution/StandardDistribution.sol +FN:31,withdraw +FN:52,issueDividends +FN:61, +FN:74,getTokenValue +FN:83,getUnclaimedAmount +FN:90,totalSupply +FN:94,balanceOf +FN:104,updateclaimableIncome +FNF:8 +FNH:8 +FNDA:4,withdraw +FNDA:1,issueDividends +FNDA:2, +FNDA:5,getTokenValue +FNDA:1,getUnclaimedAmount +FNDA:1,totalSupply +FNDA:7,balanceOf +FNDA:4,updateclaimableIncome +DA:35,4 +DA:36,4 +DA:37,4 +DA:38,4 +DA:55,1 +DA:56,1 +DA:57,1 +DA:64,2 +DA:65,2 +DA:66,2 +DA:78,5 +DA:79,5 +DA:87,1 +DA:91,1 +DA:95,7 +DA:105,4 +DA:106,4 +DA:107,4 +LF:18 +LH:18 +BRF:0 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/BurnableToken.sol +FN:24, +FN:38,transfer +FN:58,approve +FN:72,transferFrom +FN:92,increaseApproval +FN:110,decreaseApproval +FN:130,burn +FN:144,burnFrom +FN:160,totalSupply +FN:169,balanceOf +FN:180,allowance +FNF:11 +FNH:11 +FNDA:12, +FNDA:204,transfer +FNDA:156,approve +FNDA:17,transferFrom +FNDA:1,increaseApproval +FNDA:2,decreaseApproval +FNDA:1,burn +FNDA:40,burnFrom +FNDA:2,totalSupply +FNDA:199,balanceOf +FNDA:5,allowance +DA:26,12 +DA:27,12 +DA:28,12 +DA:29,12 +DA:41,204 +DA:42,203 +DA:43,201 +DA:44,201 +DA:45,201 +DA:46,201 +DA:61,156 +DA:62,156 +DA:63,156 +DA:75,17 +DA:76,16 +DA:77,15 +DA:78,15 +DA:79,14 +DA:80,14 +DA:95,1 +DA:97,1 +DA:98,1 +DA:113,2 +DA:114,2 +DA:115,1 +DA:118,1 +DA:120,2 +DA:121,2 +DA:133,1 +DA:134,1 +DA:135,1 +DA:136,1 +DA:137,1 +DA:147,40 +DA:148,40 +DA:149,39 +DA:150,39 +DA:151,39 +DA:152,39 +DA:161,2 +DA:170,199 +DA:184,5 +LF:42 +LH:42 +BRDA:41,1,0,203 +BRDA:41,1,1,1 +BRDA:42,2,0,201 +BRDA:42,2,1,2 +BRDA:75,3,0,16 +BRDA:75,3,1,1 +BRDA:114,4,0,1 +BRDA:114,4,1,1 +BRF:8 +BRH:8 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/DividendToken.sol +FN:24, +FN:32,transfer +FN:47,transferFrom +FN:61,approveAndCall +FN:73,withdraw +FN:85,issueDividends +FN:96,getERC20 +FN:104, +FN:118,collectLatestPayments +FN:127,getAmountOwed +FN:140,updateIncomeClaimed +FNF:11 +FNH:10 +FNDA:12, +FNDA:4,transfer +FNDA:6,transferFrom +FNDA:1,approveAndCall +FNDA:10,withdraw +FNDA:7,issueDividends +FNDA:0,getERC20 +FNDA:4, +FNDA:36,collectLatestPayments +FNDA:4,getAmountOwed +FNDA:32,updateIncomeClaimed +DA:37,4 +DA:38,3 +DA:39,1 +DA:52,6 +DA:53,5 +DA:54,3 +DA:66,1 +DA:67,1 +DA:68,1 +DA:69,1 +DA:77,10 +DA:78,10 +DA:79,10 +DA:80,10 +DA:81,10 +DA:89,7 +DA:90,7 +DA:91,7 +DA:92,7 +DA:100,0 +DA:107,4 +DA:108,4 +DA:109,4 +DA:122,36 +DA:123,36 +DA:131,4 +DA:141,32 +DA:142,32 +DA:143,32 +LF:29 +LH:28 +BRDA:37,1,0,3 +BRDA:37,1,1,1 +BRDA:52,2,0,5 +BRDA:52,2,1,1 +BRF:4 +BRH:4 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/DividendTokenERC20.sol +FN:30, +FN:36,transfer +FN:47,transferFrom +FN:61,approveAndCall +FN:72,issueDividends +FN:84,withdraw +FN:99,checkForTransfers +FN:118,collectLatestPayments +FN:127,getAmountOwed +FN:134,getERC20 +FN:147,updateIncomeClaimed +FNF:11 +FNH:11 +FNDA:5, +FNDA:3,transfer +FNDA:3,transferFrom +FNDA:1,approveAndCall +FNDA:6,issueDividends +FNDA:10,withdraw +FNDA:2,checkForTransfers +FNDA:28,collectLatestPayments +FNDA:4,getAmountOwed +FNDA:2,getERC20 +FNDA:24,updateIncomeClaimed +DA:32,5 +DA:41,3 +DA:42,2 +DA:43,1 +DA:52,3 +DA:53,2 +DA:54,1 +DA:66,1 +DA:67,1 +DA:68,1 +DA:69,1 +DA:75,6 +DA:76,5 +DA:77,5 +DA:78,5 +DA:79,5 +DA:80,5 +DA:88,10 +DA:89,10 +DA:90,10 +DA:91,10 +DA:92,10 +DA:93,10 +DA:101,2 +DA:102,2 +DA:103,2 +DA:104,2 +DA:106,1 +DA:107,1 +DA:109,2 +DA:122,28 +DA:123,28 +DA:131,4 +DA:138,2 +DA:148,24 +DA:149,24 +DA:150,24 +LF:37 +LH:37 +BRDA:41,1,0,2 +BRDA:41,1,1,1 +BRDA:52,2,0,2 +BRDA:52,2,1,1 +BRDA:75,3,0,5 +BRDA:75,3,1,1 +BRDA:76,4,0,5 +BRDA:76,4,1,0 +BRDA:91,5,0,10 +BRDA:91,5,1,0 +BRDA:104,6,0,1 +BRDA:104,6,1,1 +BRF:12 +BRH:10 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/GovernedToken.sol +FN:24, +FN:31,transfer +FN:40,transferFrom +FN:49,getAmountAvailable +FNF:4 +FNH:3 +FNDA:1, +FNDA:1,transfer +FNDA:0,transferFrom +FNDA:1,getAmountAvailable +DA:27,1 +DA:34,1 +DA:35,0 +DA:36,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:53,1 +DA:54,1 +DA:55,1 +DA:56,1 +DA:57,1 +LF:12 +LH:7 +BRDA:34,1,0,0 +BRDA:34,1,1,1 +BRDA:43,2,0,0 +BRDA:43,2,1,0 +BRF:4 +BRH:1 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/GovernedTokenERC20.sol +FN:25, +FN:32,transfer +FN:41,transferFrom +FN:50,getAmountAvailable +FNF:4 +FNH:0 +FNDA:0, +FNDA:0,transfer +FNDA:0,transferFrom +FNDA:0,getAmountAvailable +DA:28,0 +DA:35,0 +DA:36,0 +DA:37,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:54,0 +DA:55,0 +DA:56,0 +DA:57,0 +DA:58,0 +LF:12 +LH:0 +BRDA:35,1,0,0 +BRDA:35,1,1,0 +BRDA:44,2,0,0 +BRDA:44,2,1,0 +BRF:4 +BRH:0 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/MintableToken.sol +FN:19, +FN:30,mint +FN:42,finishMinting +FN:51,getTokenURI +FN:59,canMint +FNF:5 +FNH:5 +FNDA:17, +FNDA:43,mint +FNDA:7,finishMinting +FNDA:2,getTokenURI +FNDA:51,canMint +DA:21,17 +DA:22,17 +DA:23,17 +DA:34,43 +DA:35,43 +DA:36,43 +DA:37,43 +DA:38,43 +DA:46,7 +DA:47,7 +DA:48,7 +DA:55,2 +DA:60,51 +DA:61,50 +LF:14 +LH:14 +BRDA:60,1,0,50 +BRDA:60,1,1,1 +BRF:2 +BRH:2 +end_of_record +TN: +SF:/home/peter/Documents/Work/MyBit/develop/contracts/tokens/erc20/StandardToken.sol +FN:30,allowance +FN:42,transfer +FN:60,approve +FN:72,transferFrom +FN:94,increaseApproval +FN:116,decreaseApproval +FN:134,totalSupply +FN:143,balanceOf +FNF:8 +FNH:8 +FNDA:17,allowance +FNDA:5,transfer +FNDA:11,approve +FNDA:7,transferFrom +FNDA:1,increaseApproval +FNDA:2,decreaseApproval +FNDA:36,totalSupply +FNDA:55,balanceOf +DA:34,17 +DA:43,5 +DA:44,3 +DA:45,2 +DA:46,2 +DA:47,2 +DA:48,2 +DA:61,11 +DA:62,11 +DA:63,11 +DA:75,7 +DA:76,6 +DA:77,5 +DA:78,4 +DA:79,4 +DA:80,4 +DA:81,4 +DA:82,4 +DA:101,1 +DA:103,1 +DA:104,1 +DA:119,2 +DA:120,2 +DA:121,1 +DA:124,1 +DA:126,2 +DA:127,2 +DA:135,36 +DA:144,55 +LF:29 +LH:29 +BRDA:43,1,0,3 +BRDA:43,1,1,2 +BRDA:44,2,0,2 +BRDA:44,2,1,1 +BRDA:75,3,0,6 +BRDA:75,3,1,1 +BRDA:76,4,0,5 +BRDA:76,4,1,1 +BRDA:77,5,0,4 +BRDA:77,5,1,1 +BRDA:120,6,0,1 +BRDA:120,6,1,1 +BRF:12 +BRH:12 +end_of_record diff --git a/coverage/math/SafeMath.sol.html b/coverage/math/SafeMath.sol.html new file mode 100644 index 00000000..c6656850 --- /dev/null +++ b/coverage/math/SafeMath.sol.html @@ -0,0 +1,209 @@ + + + + Code coverage report for math/SafeMath.sol + + + + + + + +
+
+

+ all files / math/ SafeMath.sol +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 12/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49  +  +  +  +  +  +  +  +  +  +149× +27× +  +122× +122× +121× +  +  +  +  +  +  +  +109× +  +  +  +  +497× +493× +  +  +  +  +474× +474× +473× +  +  +  +  +  +  +  +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
+ 
+// @title SafeMath: overflow/underflow checks
+// @notice Math operations with safety checks that throw on error
+library SafeMath {
+ 
+  // @notice Multiplies two numbers, throws on overflow.
+  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
+    if (a == 0) {
+      return 0;
+    }
+    uint256 c = a * b;
+    assert(c / a == b);
+    return c;
+  }
+ 
+  // @notice Integer division of two numbers, truncating the quotient.
+  function div(uint256 a, uint256 b) internal pure returns (uint256) {
+    // assert(b > 0); // Solidity automatically throws when dividing by 0
+    // uint256 c = a / b;
+    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
+    return a / b;
+  }
+ 
+  // @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
+  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
+    assert(b <= a);
+    return a - b;
+  }
+ 
+  // @notice Adds two numbers, throws on overflow.
+  function add(uint256 a, uint256 b) internal pure returns (uint256) {
+    uint256 c = a + b;
+    assert(c >= a);
+    return c;
+  }
+ 
+  // @notice Returns fractional amount
+  function getFractionalAmount(uint256 _amount, uint256 _percentage)
+  internal
+  pure
+  returns (uint256) {
+    return div(mul(_amount, _percentage), 100);
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/math/index.html b/coverage/math/index.html new file mode 100644 index 00000000..dd68e5a4 --- /dev/null +++ b/coverage/math/index.html @@ -0,0 +1,93 @@ + + + + Code coverage report for math/ + + + + + + + +
+
+

+ all files math/ +

+
+
+ 100% + Statements + 12/12 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 12/12 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
SafeMath.sol
100%12/12100%8/8100%5/5100%12/12
+
+
+ + + + + + + diff --git a/coverage/ownership/AssetGovernance.sol.html b/coverage/ownership/AssetGovernance.sol.html new file mode 100644 index 00000000..fa4aa063 --- /dev/null +++ b/coverage/ownership/AssetGovernance.sol.html @@ -0,0 +1,422 @@ + + + + Code coverage report for ownership/AssetGovernance.sol + + + + + + + +
+
+

+ all files / ownership/ AssetGovernance.sol +

+
+
+ 72% + Statements + 18/25 +
+
+ 62.5% + Branches + 5/8 +
+
+ 83.33% + Functions + 5/6 +
+
+ 70.97% + Lines + 22/31 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +4× +4× +4× +4× +4× +4× +3× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+interface Burner { function burnEscrow(bytes32 _assetID) external returns (bool); }
+interface Escrow { function unlockEscrow(bytes32 _assetID) external returns (bool); }
+interface DB {
+  function addressStorage(bytes32 _key) external  view returns (address);
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function setUint(bytes32 _key, uint _value) external;
+}
+interface TokenView {
+  function totalSupply() external view returns (uint);
+  function balanceOf(address _tokenHolder) external view returns (uint);
+}
+ 
+// @title A contract to manage the governance of assets on the platform
+// @author Kyle Dewhurst, MyBit Foundation
+// @notice All token holders of an asset can vote here
+contract AssetGovernance {
+  using SafeMath for uint256;
+ 
+  DB public database;
+ 
+ 
+  constructor(address _database)
+  public {
+    database = DB(_database);
+  }
+ 
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...
+  // @dev ie sha3(_assetID) or sha3(_assetID, someAddress)
+  function voteForExecution(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash, uint _amountToLock)
+  external
+  validAsset(_assetID)
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", executionID));
+    bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID, msg.sender));
+    uint256 numVotes = database.uintStorage(numVotesID);
+    uint256 investorVotes = database.uintStorage(investorVotesID);
+    require(lockTokens(_assetID, msg.sender, _amountToLock));
+    database.setUint(numVotesID, numVotes.add(_amountToLock));
+    database.setUint(investorVotesID, investorVotes.add(_amountToLock));
+    return true;
+  }
+ 
+ 
+  // @notice unlock tokens, removing them from the vote
+  // @dev _executionID should be looked up in event logs. it is equal to sha3(_assetID, _methodID, _parameterHash)
+  function unlockToken(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash, uint _amountToUnlock)
+  external
+  validAsset(_assetID)
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 voteTotalID = keccak256(abi.encodePacked("voteTotal", executionID));
+    bytes32 investorVotesID = keccak256(abi.encodePacked("investorVotes", executionID));
+    uint investorVotes = database.uintStorage(investorVotesID);
+    uint totalVotes = database.uintStorage(voteTotalID);
+    require(investorVotes <= _amountToUnlock);   // 1 vote = 1 token
+    database.setUint(voteTotalID, totalVotes.sub(_amountToUnlock));
+    database.setUint(investorVotesID, investorVotes.sub(_amountToUnlock));
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Public Functions
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice  Checks that 1/3 or more of token holders agreed on function call
+  function isConsensusReached(address _executingContract, bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    TokenView assetToken = TokenView(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    bytes32 executionID = keccak256(abi.encodePacked(_executingContract, _assetID, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", executionID));
+    uint256 numTokens = assetToken.totalSupply();
+    return database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Internal Functions
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice lock asset tokens to be able to vote
+  // @dev keeps track of how many assetTokens this investor has locked (for GovernedToken checks)
+  function lockTokens(bytes32 _assetID, address _investor, uint _amount)
+  internal
+  returns (bool) {
+    TokenView assetToken = TokenView(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    uint numTokensLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)));
+    require(_amount <= assetToken.balanceOf(_investor).sub(numTokensLocked));
+    database.setUint(keccak256(abi.encodePacked("tokensLocked", _assetID, _investor)), numTokensLocked.add(_amount));
+    return true;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  /*
+  modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) {
+    require(isConsensusReached(address(this), _assetID, _methodID, _parameterHash));   // owners must have agreed on function + parameters
+    _;
+  }
+  */
+ 
+  // @notice reverts if the asset does not have a token address set in the database
+  modifier validAsset(bytes32 _assetID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))) != address(0));
+    _;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ownership/CollectiveOwned.sol.html b/coverage/ownership/CollectiveOwned.sol.html new file mode 100644 index 00000000..5d75cd5c --- /dev/null +++ b/coverage/ownership/CollectiveOwned.sol.html @@ -0,0 +1,401 @@ + + + + Code coverage report for ownership/CollectiveOwned.sol + + + + + + + +
+
+

+ all files / ownership/ CollectiveOwned.sol +

+
+
+ 0% + Statements + 0/17 +
+
+ 0% + Branches + 0/4 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/26 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/ERC20.sol';
+ 
+ 
+// @title A contract which allows for platform owners to come to consensus on important functionality
+// @notice Can hold any number of owners. Each getting 1 vote.
+// @dev An owner has already been initialized when database is deployed
+// @author Kyle Dewhurst, MyBit Foundation
+contract CollectiveOwned {
+  using SafeMath for uint256;
+ 
+  Database public database;
+ 
+  // @param (address) _database = the address of the platform database
+  // @param (uint) _baseQuorum = the percentage of owners needed to approve a function call
+  constructor(address _database, uint256 _baseQuorum)
+  public {
+    database = Database(_database);
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("setQuorumLevel(address, bytes4, uint256)")));
+    bytes32 functionID = keccak256(abi.encodePacked(address(this), methodID));
+    database.setUint(functionID, _baseQuorum);   // the initial quorum level to set further quorum levels
+  }
+ 
+  // @notice any owner on the platform can call this function to add a new user if it has receieve quorum level of signatures
+  // @notice must
+  // @param (address) _newOwner the address of the new owner
+  function addOwner(address _newOwner)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_newOwner)))
+  onlyOwner {
+    uint numOwners = database.uintStorage(keccak256(abi.encodePacked("numberOfOwners")));
+    database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
+    database.setUint(keccak256(abi.encodePacked("numberOfOwners")), numOwners.add(1));
+  }
+ 
+  // @notice any owner can call this function to remove an owner if the the function receives quorum level of signatures
+  // @param (address) _owner = the owner to be removed from the group of owners
+  function removeOwner(address _owner)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_owner)))
+  onlyOwner {
+    database.deleteBool(keccak256(abi.encodePacked("owner", _owner)));
+  }
+ 
+  // @notice restricts a function, forcing it to require _quorumLevel of votes to be executed
+  function setQuorumLevel(address _contractAddress, bytes4 _methodID, uint256 _quorumLevel)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_contractAddress, _methodID, _quorumLevel)))
+  returns (bool) {
+    bytes32 functionID = keccak256(abi.encodePacked(_contractAddress, _methodID));
+    database.setUint(functionID, _quorumLevel);
+    return true;
+  }
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...ie sha3(true, 55)
+  function voteForExecution(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  external
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfSignatures", executionID));
+    uint256 numSignatures = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numSignatures.add(1));
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                View Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function isQuorumReached(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    uint256 quorumLevel = database.uintStorage(keccak256(abi.encodePacked(_contractAddress, _methodID)));
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    uint256 numOwners = database.uintStorage(keccak256(abi.encodePacked("numberOfOwners")));
+    // check that number of signatures are greater than required quorum
+    return database.uintStorage(numVotesID).mul(100).div(numOwners) >= quorumLevel;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+    require(isQuorumReached(address(this), _methodID, _parameterHash));  // owners must have agreed on function + parameters
+    _;
+    database.deleteBool(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                              Events
+  //------------------------------------------------------------------------------------------------------------------
+  event LogOwnerChanged(address indexed _previousOwner, address indexed _newOwner);
+  event LogFunctionAuthorized(address indexed _owner, string indexed _functionName, bytes32 indexed _beneficiary, bytes32 _authHash);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ownership/Pausible.sol.html b/coverage/ownership/Pausible.sol.html new file mode 100644 index 00000000..eeaaf6ef --- /dev/null +++ b/coverage/ownership/Pausible.sol.html @@ -0,0 +1,203 @@ + + + + Code coverage report for ownership/Pausible.sol + + + + + + + +
+
+

+ all files / ownership/ Pausible.sol +

+
+
+ 100% + Statements + 4/4 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +7× +6× +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+ 
+import '../database/Database.sol';
+ 
+// @title A contract which allows for the freezing of functionality within the platform. 
+// @dev only valid with a single owned ownership model
+// @author Kyle Dewhurst, MyBit Foundation
+contract Pausible {
+ 
+  Database public database;
+ 
+  // @notice constructor: initialize database instance
+  constructor(address _database)
+  public {
+    database = Database(_database);
+  }
+ 
+  // @notice This will pause all critical activity for the supplied address
+  // @param: The address of the contract which is to be paused\
+  function pause(address _contract)
+  onlyOwner
+  public {
+    database.setBool(keccak256(abi.encodePacked("paused", _contract)), true);
+    emit LogPaused(_contract, msg.sender);
+  }
+ 
+  // @notice This will unpause all critical activity for the supplied address
+  // @param: The address of the contract which is to be unpaused
+  function unpause(address _contract)
+  onlyOwner
+  public {
+    database.deleteBool(keccak256(abi.encodePacked("paused", _contract)));
+    emit LogUnpaused(_contract, msg.sender);
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner() {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  event LogPaused(address indexed _contract, address _owner);
+  event LogUnpaused(address indexed _contract, address _owner);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ownership/SingleOwned.sol.html b/coverage/ownership/SingleOwned.sol.html new file mode 100644 index 00000000..36d0813a --- /dev/null +++ b/coverage/ownership/SingleOwned.sol.html @@ -0,0 +1,164 @@ + + + + Code coverage report for ownership/SingleOwned.sol + + + + + + + +
+
+

+ all files / ownership/ SingleOwned.sol +

+
+
+ 100% + Statements + 3/3 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 3/3 +
+
+ 100% + Lines + 6/6 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34  +  +  +  +  +  +  +  +  +  +  +  +  +2× +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +2× +1× +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+ 
+// @title A contract for managing a single platform owner
+// @dev Single owned platforms store owner as an address
+// @author Kyle Dewhurst, MyBit Foundation
+contract SingleOwned {
+ 
+  Database public database;
+ 
+  // @notice constructor: initiate database instance
+  constructor(address _database) public {
+    database = Database(_database);
+  }
+ 
+  // @notice Transfer ownership to to a new owner
+  function changeOwner(address _newOwner)
+  public
+  onlyOwner {
+    database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
+    database.setBool(keccak256(abi.encodePacked("owner", msg.sender)), false);
+    emit OwnershipTransferred(msg.sender, _newOwner);
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner() {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+  event OwnershipTransferred(address indexed owner, address indexed pendingOwner);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ownership/TokenGovernance.sol.html b/coverage/ownership/TokenGovernance.sol.html new file mode 100644 index 00000000..7027abb6 --- /dev/null +++ b/coverage/ownership/TokenGovernance.sol.html @@ -0,0 +1,458 @@ + + + + Code coverage report for ownership/TokenGovernance.sol + + + + + + + +
+
+

+ all files / ownership/ TokenGovernance.sol +

+
+
+ 0% + Statements + 0/28 +
+
+ 0% + Branches + 0/8 +
+
+ 0% + Functions + 0/8 +
+
+ 0% + Lines + 0/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+import '../interfaces/ERC20.sol';
+ 
+ 
+// @title A contract which allows for token holders to authorize particular functions to be called
+// @notice Token holders must lock their tokens against a particular function
+// @notice Token holders can unlock their tokens, removing their vote
+// @dev An owner has already been initialized when database is deployed
+// @author Kyle Dewhurst, MyBit Foundation
+contract TokenGovernance {
+  using SafeMath for uint256;
+ 
+  Database public database;
+ 
+  ERC20 public governanceToken;
+ 
+ 
+ 
+  // @dev methodID = bytes4(sha3("functionName(parameterType, parameterType)")
+  // @dev functionID = sha3(contractAddress, methodID)
+  // @dev numVotes is sha3(contractAddress, methodID, sha3(parameter, parameter)))
+  // @dev quorumLevel = percentage of tokens required to be locked for the execution of a function
+ 
+ 
+  // @notice initiator of the platform sets the initial functions quorum level
+  // @notice quorum level dictates the number of votes required for that function to be executed
+  constructor(address _database, uint256 _baseQuorum)
+  public  {
+    governanceToken = ERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+    database = Database(_database);
+    governanceToken = ERC20(governanceToken);
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("setQuorumLevel(address, bytes4, uint256)")));
+    bytes32 functionID = keccak256(abi.encodePacked(address(this), methodID));
+    database.setUint(functionID, _baseQuorum);   // the initial quorum level to set further quorum levels
+  }
+ 
+  // @notice If restricted it will have to be called from address(this) using a voting proccess on signForFunctionCall
+  function setQuorumLevel(address _contractAddress, bytes4 _methodID, uint256 _quorumLevel)
+  external
+  isRestricted(msg.sig, keccak256(abi.encodePacked(_contractAddress, _methodID, _quorumLevel)))
+  returns (bool) {
+    bytes32 functionID = keccak256(abi.encodePacked(_contractAddress, _methodID));
+    database.setUint(functionID, _quorumLevel);
+    return true;
+  }
+ 
+  // @param (bytes32) _parameterHash = The hash of the exact parameter to be called for function...ie sha3(true, 55)
+  function voteForExecution(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash, uint256 _voteAmount)
+  external
+  returns (bool) {
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    require(lockTokens(_voteAmount, executionID));
+    uint256 numVotes = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numVotes.add(_voteAmount));
+    return true;
+  }
+ 
+ 
+  function unlockTokens(bytes32 _executionID)
+  external
+  returns (bool) {
+    bytes32 voteID = keccak256(abi.encodePacked("tokenVotesLocked", _executionID, msg.sender));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", _executionID));
+    uint256 amountLocked = database.uintStorage(voteID);
+    uint256 numVotes = database.uintStorage(numVotesID);
+    database.setUint(numVotesID, numVotes.sub(amountLocked));
+    governanceToken.transfer(msg.sender, amountLocked);
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Internal Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function lockTokens(uint _amountToLock, bytes32 _executionID)
+  internal
+  returns (bool) {
+    bytes32 voteID = keccak256(abi.encodePacked("tokenVotesLocked", _executionID, msg.sender));
+    require(governanceToken.transferFrom(msg.sender, address(this), _amountToLock));
+    uint256 amountLocked = database.uintStorage(voteID);
+    database.setUint(voteID, amountLocked.add(_amountToLock));
+    return true;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                View Functions
+  //------------------------------------------------------------------------------------------------------------------
+ 
+  function isQuorumReached(address _contractAddress, bytes4 _methodID, bytes32 _parameterHash)
+  public
+  view
+  returns (bool) {
+    uint256 quorumLevel = database.uintStorage(keccak256(abi.encodePacked(_contractAddress, _methodID)));
+    bytes32 executionID = keccak256(abi.encodePacked(_contractAddress, _methodID, _parameterHash));
+    bytes32 numVotesID = keccak256(abi.encodePacked("numberOfVotes", executionID));
+    uint256 numTokens = governanceToken.totalSupply();
+    // check that number of signatures are greater than required quorum
+    return database.uintStorage(numVotesID).mul(100).div(numTokens) >= quorumLevel;
+  }
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                                Modifiers
+  //------------------------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice add this modifer to functions that you want multi-sig requirements for
+  // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+  modifier isRestricted(bytes4 _methodID, bytes32 _parameterHash) {
+    require(isQuorumReached(address(this), _methodID, _parameterHash));   // owners must have agreed on function + parameters
+    _;
+    // remove votes from function call
+    database.deleteUint(keccak256(abi.encodePacked(address(this), _methodID, _parameterHash)));
+  }
+ 
+  // @notice reverts if caller is not the owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
+    _;
+  }
+ 
+ 
+  //------------------------------------------------------------------------------------------------------------------
+  //                                              Events
+  //------------------------------------------------------------------------------------------------------------------
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/ownership/index.html b/coverage/ownership/index.html new file mode 100644 index 00000000..f23e6db1 --- /dev/null +++ b/coverage/ownership/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for ownership/ + + + + + + + +
+
+

+ all files ownership/ +

+
+
+ 32.47% + Statements + 25/77 +
+
+ 37.5% + Branches + 9/24 +
+
+ 41.38% + Functions + 12/29 +
+
+ 32.71% + Lines + 35/107 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetGovernance.sol
72%18/2562.5%5/883.33%5/670.97%22/31
CollectiveOwned.sol
0%0/170%0/40%0/80%0/26
Pausible.sol
100%4/4100%2/2100%4/4100%7/7
SingleOwned.sol
100%3/3100%2/2100%3/3100%6/6
TokenGovernance.sol
0%0/280%0/80%0/80%0/37
+
+
+ + + + + + + diff --git a/coverage/prettify.css b/coverage/prettify.css new file mode 100644 index 00000000..b317a7cd --- /dev/null +++ b/coverage/prettify.css @@ -0,0 +1 @@ +.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js new file mode 100644 index 00000000..ef51e038 --- /dev/null +++ b/coverage/prettify.js @@ -0,0 +1 @@ +window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/roles/AssetManagerEscrow.sol.html b/coverage/roles/AssetManagerEscrow.sol.html new file mode 100644 index 00000000..d4e4cd94 --- /dev/null +++ b/coverage/roles/AssetManagerEscrow.sol.html @@ -0,0 +1,437 @@ + + + + Code coverage report for roles/AssetManagerEscrow.sol + + + + + + + +
+
+

+ all files / roles/ AssetManagerEscrow.sol +

+
+
+ 71.79% + Statements + 28/39 +
+
+ 50% + Branches + 16/32 +
+
+ 83.33% + Functions + 5/6 +
+
+ 77.27% + Lines + 34/44 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +4× +3× +3× +3× +3× +3× +3× +3× +  +  +  +  +  +  +  +  +  +10× +9× +8× +8× +8× +8× +8× +  +1× +  +  +  +7× +7× +7× +7× +7× +  +5× +5× +2× +  +3× +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +  +  +  +  +  +  +  +  + 
  pragma solidity 0.4.24;
+ 
+  import "../math/SafeMath.sol";
+  import "../interfaces/DBInterface.sol";
+  import "../interfaces/DivToken.sol";
+  import "../interfaces/BurnableERC20.sol";
+ 
+  interface Governance { function isConsensusReached(address _thisContract, bytes4 _methodID, bytes32 _parameterHash) external view returns (bool); }
+ 
+  // @title A contract to hold escrow as collateral against assets
+  // @author Kyle Dewhurst, MyBit Foundation
+  // @notice AssetManager can lock his escrow in this contract and retrieve it if asset funding fails or successfully returns ROI
+  contract AssetManagerEscrow {
+    using SafeMath for uint256;
+ 
+    DBInterface public database;
+ 
+    // @notice constructor: initializes database
+    // @param: the address for the database contract used by this platform
+    constructor(address _database)
+    public {
+      database = DBInterface(_database);
+    }
+ 
+    // @dev assetID can be computed beforehand with sha3(msg.sender, _amountToRaise, _operatorID, _assetURI))
+    // @dev anybody can make the assetManager escrow if he leaves this contract with approval to transfer
+    function lockEscrow(bytes32 _assetID, uint _amount)
+    public
+    returns (bool) {
+      require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == address(0));
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, msg.sender));
+      address tokenAddress = database.addressStorage(keccak256(abi.encodePacked("platformToken")));
+      Erequire(BurnableERC20(tokenAddress).transferFrom(msg.sender, address(this), _amount));
+      database.setUint(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID)), _amount);
+      database.setAddress(keccak256(abi.encodePacked("assetManager", _assetID)), msg.sender);
+      emit LogEscrowLocked(_assetID, assetManagerEscrowID, msg.sender, _amount);
+      return true;
+    }
+ 
+ 
+    // @notice assetManager can unlock his escrow here once funding fails or asset returns sufficient ROI
+    // @dev asset must have fundingDeadline = 0 or have ROI > 25%
+    // @dev returns escrow according to ROI. 25% ROI returns 25% of escrow, 50% ROI returns 50% of escrow etc...
+    function unlockEscrow(bytes32 _assetID)
+    public
+    returns (bool) {
+      require(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))) == msg.sender);
+      require(database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))) < now);
+      BurnableERC20 burnToken = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, msg.sender));
+      uint escrowRedeemed = database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID)));
+      uint unlockAmount = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).sub(escrowRedeemed);
+      if(!database.boolStorage(keccak256(abi.encodePacked("crowdsaleFinalized", _assetID)))){
+        //If we're past deadline but crowdsale did NOT finalize, release all escrow
+        Erequire(removeAssetManager(_assetID, assetManagerEscrowID));
+      }
+      else {
+        //Past the deadline with a successful funding. Only pay back based on ROI
+        DivToken assetToken = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+        uint roi = assetToken.assetIncome().mul(100).div(assetToken.totalSupply());   // Scaled up by 10^2  (approaches 100 as asset income increases)
+        uint roiCheckpoints = roi.div(25);       // How many quarterly increments have been reached?
+        uint quarterEscrow = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).div(4);
+        require(roiCheckpoints <= 4 && roiCheckpoints > 0);    // Can't unlock escrow past 100% ROI
+        //  multiply the number of quarterly increments by a quarter of the escrow and subtract the escrow already redeemed.
+        unlockAmount = roiCheckpoints.mul(quarterEscrow).sub(escrowRedeemed);
+        require(unlockAmount > 0);
+        database.setUint(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID)), escrowRedeemed.add(unlockAmount));
+      }
+      Erequire(burnToken.transfer(msg.sender, unlockAmount));
+      return true;
+    }
+ 
+ 
+    // @notice investors can vote to call this function for the new assetManager to then call
+    // @dev new assetManager must approve this contract to transfer in and lock _ amount of platform tokens
+    function becomeAssetManager(bytes32 _assetID, address _oldAssetManager, uint256 _amount, bool _burn)
+    external
+    hasConsensus(_assetID, msg.sig, keccak256(abi.encodePacked(_assetID, _oldAssetManager, msg.sender, _amount, _burn)))
+    returns (bool) {
+      address currentAssetManager = database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID)));
+      require(currentAssetManager != msg.sender && currentAssetManager == _oldAssetManager);
+      bytes32 assetManagerEscrowID = keccak256(abi.encodePacked(_assetID, _oldAssetManager));
+      uint oldEscrowRemaining = database.uintStorage(keccak256(abi.encodePacked("assetManagerEscrow", assetManagerEscrowID))).sub(database.uintStorage(keccak256(abi.encodePacked("escrowRedeemed", assetManagerEscrowID))));
+      BurnableERC20 token = BurnableERC20(database.addressStorage(keccak256(abi.encodePacked("platformToken"))));
+      require(removeAssetManager(_assetID, assetManagerEscrowID));
+      if (_burn) { require(token.burn(oldEscrowRemaining)); }
+      else { require(token.transfer(_oldAssetManager, oldEscrowRemaining));  }
+      require(lockEscrow(_assetID, _amount));
+      return true;
+    }
+ 
+    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    //                                            Internal Functions
+    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+    function removeAssetManager(bytes32 _assetID, bytes32 _assetManagerEscrowID)
+    internal
+    returns (bool) {
+        database.deleteAddress(keccak256(abi.encodePacked("assetManager", _assetID)));
+        database.deleteUint(keccak256(abi.encodePacked("assetManagerEscrow", _assetManagerEscrowID)));
+        database.deleteUint(keccak256(abi.encodePacked("escrowRedeemed", _assetManagerEscrowID)));
+        return true;
+    }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                            Modifiers
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+    // @notice add this modifer to functions that you want multi-sig requirements for
+    // @dev function can only be called after at least n >= quorumLevel owners have agreed to call it
+    modifier hasConsensus(bytes32 _assetID, bytes4 _methodID, bytes32 _parameterHash) {
+      bytes32 numVotesID = keccak256(abi.encodePacked("voteTotal", keccak256(abi.encodePacked(address(this), _assetID, _methodID, _parameterHash))));
+      uint256 numTokens = DivToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID)))).totalSupply();
+      Irequire(database.uintStorage(numVotesID).mul(100).div(numTokens) >= 33, 'Consensus not reached');
+      _;
+    }
+ 
+ 
+    event LogEscrowBurned(bytes32 indexed _assetID, address indexed _assetManager, uint _amountBurnt);
+    event LogEscrowLocked(bytes32 indexed _assetID, bytes32 indexed _assetManagerEscrowID, address indexed _assetManager, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/roles/AssetManagerFunds.sol.html b/coverage/roles/AssetManagerFunds.sol.html new file mode 100644 index 00000000..70cfc56f --- /dev/null +++ b/coverage/roles/AssetManagerFunds.sol.html @@ -0,0 +1,488 @@ + + + + Code coverage report for roles/AssetManagerFunds.sol + + + + + + + +
+
+

+ all files / roles/ AssetManagerFunds.sol +

+
+
+ 68.42% + Statements + 39/57 +
+
+ 31.25% + Branches + 15/48 +
+
+ 85.71% + Functions + 6/7 +
+
+ 68.75% + Lines + 44/64 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +3× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +1× +1× +1× +  +1× +1× +  +  +1× +1× +  +1× +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +1× +  +1× +1× +  +  +  +  +  +  +  +1× +1× +  +1× +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../interfaces/ERC20.sol";
+import "../interfaces/DBInterface.sol";
+import "../math/SafeMath.sol";
+ 
+interface DToken {
+  function withdraw() external returns (bool);
+  function getAmountOwed(address _user) external view returns (uint);
+  function balanceOf(address _tokenHolder) external view returns (uint);
+  function transfer(address _to, uint _amount) external returns (bool success);
+  function getERC20() external  view returns (address);
+}
+ 
+// @title A dividend-token holding contract that locks tokens and retrieves dividends for assetManagers
+// @notice This contract receives newly minted tokens and retrieves Ether or ERC20 tokens received from the asset
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+contract AssetManagerFunds {
+  using SafeMath for uint256;
+ 
+  DBInterface public database;
+ 
+  uint256 private transactionNumber;
+ 
+  // @notice constructor: initializes database
+  constructor(address _database)
+  public {
+    database = DBInterface(_database);
+  }
+ 
+  // @notice asset manager can withdraw his dividend fee from assets here
+  // @param : bytes32 _assetID = the ID of this asset on the platform 
+  function withdraw(bytes32 _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    require(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))));
+    DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID))));
+    require(address(token) != address(0));
+    uint amountOwed;
+    uint balanceBefore;
+    if (token.getERC20() == address(0)){
+      balanceBefore = address(this).balance;
+      amountOwed = token.getAmountOwed(address(this));
+      require(amountOwed > 0);
+      uint balanceAfter = balanceBefore.add(amountOwed);
+      require(token.withdraw());
+      require(address(this).balance == balanceAfter);
+      msg.sender.transfer(amountOwed);
+    }
+    else {
+      amountOwed = token.getAmountOwed(address(this));
+      require(amountOwed > 0);
+      balanceBefore = token.balanceOf(address(this));
+      require(token.withdraw());
+      require(token.balanceOf(address(this)).sub(amountOwed) == balanceBefore);
+      token.transfer(msg.sender, amountOwed);
+    }
+    return true;
+  }
+ 
+  function retrieveAssetManagerTokens(bytes32[] _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    Erequire(_assetID.length <= 42);
+    uint[] memory payoutAmounts = new uint[](_assetID.length);
+    address[] memory tokenAddresses = new address[](_assetID.length);
+    uint8 numEntries;
+    for(uint8 i = 0; i < _assetID.length; i++){
+      Erequire(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID[i]))) );
+      DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID[i]))));
+      Erequire(address(token) != address(0));
+      uint tokensOwed = token.getAmountOwed(address(this));
+      Erequire(tokensOwed > 0);
+      DToken fundingToken = DToken(token.getERC20());
+      uint balanceBefore = fundingToken.balanceOf(address(this));
+      uint8 tokenIndex = containsAddress(tokenAddresses, address(token));
+      Iif (tokenIndex < _assetID.length) {  payoutAmounts[tokenIndex] = payoutAmounts[tokenIndex].add(tokensOwed); }
+      else {
+        tokenAddresses[numEntries] = address(fundingToken);
+        payoutAmounts[numEntries] = tokensOwed;
+        numEntries++;
+      }
+      Erequire(token.withdraw());
+      Erequire(fundingToken.balanceOf(address(this)).sub(tokensOwed) == balanceBefore);
+    }
+ 
+    for(i = 0; i < numEntries; i++){
+      Erequire(ERC20(tokenAddresses[i]).transfer(msg.sender, payoutAmounts[i]));
+    }
+    return true;
+  }
+ 
+ 
+  function retrieveAssetManagerETH(bytes32[] _assetID)
+  external
+  nonReentrant
+  returns (bool) {
+    Erequire(_assetID.length <= 93);
+    uint weiOwed;
+    for(uint8 i = 0; i < _assetID.length; i++){
+      Erequire(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID[i]))));
+      DToken token = DToken(database.addressStorage(keccak256(abi.encodePacked("tokenAddress", _assetID[i]))));
+      uint balanceBefore = address(this).balance;
+      uint amountOwed = token.getAmountOwed(address(this));
+      Erequire(amountOwed > 0);
+      uint balanceAfter = balanceBefore.add(amountOwed);
+      Erequire(token.withdraw());
+      Erequire(address(this).balance == balanceAfter);
+      weiOwed = weiOwed.add(amountOwed);
+    }
+    msg.sender.transfer(weiOwed);
+    return true;
+  }
+ 
+  // @notice returns the index if the address is in the list, otherwise returns list length + 1
+  function containsAddress(address[] _addressList, address _addr)
+  internal
+  pure
+  returns (uint8) {
+    for (uint8 i = 0; i < _addressList.length; i++){
+      Iif (_addressList[i] == _addr) return i;
+    }
+    return uint8(_addressList.length + 1);
+  }
+ 
+ 
+  // @notice prevents calls from re-entering contract
+  modifier nonReentrant() {
+    transactionNumber += 1;
+    uint256 localCounter = transactionNumber;
+    _;
+    Erequire(localCounter == transactionNumber);
+  }
+ 
+  function ()
+  payable
+  public {}
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/roles/Operators.sol.html b/coverage/roles/Operators.sol.html new file mode 100644 index 00000000..d517df61 --- /dev/null +++ b/coverage/roles/Operators.sol.html @@ -0,0 +1,344 @@ + + + + Code coverage report for roles/Operators.sol + + + + + + + +
+
+

+ all files / roles/ Operators.sol +

+
+
+ 100% + Statements + 14/14 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 23/23 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +10× +10× +10× +9× +9× +9× +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +3× +3× +2× +1× +1× +1× +  +  +  +  +  +  +  +2× +2× +  +  +  +  +  +  +  +3× +3× +  +  +  +  +  +  +  +  +14× +13× +  +  +  +  +5× +5× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../database/Database.sol';
+import '../math/SafeMath.sol';
+ 
+contract Operators {
+ 
+  Database private database;
+ 
+  constructor(address _database) public {
+    database = Database(_database);
+  }
+ 
+  // @notice allows the platform owners to onboard a new operator.
+  // @notice operators will receive crowdfunding payments and are liable for producing/installing assets.
+  function registerOperator(address _operatorAddress, string _operatorURI)
+  external
+  onlyOwner {
+    Erequire(_operatorAddress != address(0));
+    bytes32 operatorID = keccak256(abi.encodePacked(_operatorURI));
+    require(database.addressStorage(keccak256(abi.encodePacked("operator", operatorID))) == address(0));
+    database.setAddress(keccak256(abi.encodePacked("operator", operatorID)), _operatorAddress);
+    database.setBytes32(keccak256(abi.encodePacked("operator", _operatorAddress)), operatorID);
+    emit LogOperatorRegistered(operatorID, _operatorURI);
+  }
+ 
+  // @notice owners can remove operators from the platform here
+  function removeOperator(bytes32 _operatorID)
+  external
+  onlyOwner {
+    database.deleteAddress(keccak256(abi.encodePacked("operator", _operatorID)));
+    emit LogOperatorRemoved(_operatorID, msg.sender);
+  }
+ 
+ 
+  // @notice operator or owner can change the withdraw address of a registered operator
+  function changeOperatorAddress(bytes32 _operatorID, address _newAddress)
+  external {
+    address oldAddress = database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID)));
+    require(oldAddress != address(0));
+    require(msg.sender == oldAddress || database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    database.deleteAddress(keccak256(abi.encodePacked("operator", _operatorID)));
+    database.setAddress(keccak256(abi.encodePacked("operator", _operatorID)), _newAddress);
+    emit LogOperatorAddressChanged(_operatorID, msg.sender, _newAddress);
+  }
+ 
+  // @notice operator can choose which ERC20 tokens he's willing to accept as payment
+  function acceptERC20Token(bytes32 _operatorID, address _tokenAddress, bool _accept)
+  external
+  onlyOperator(_operatorID)
+  returns (bool) {
+    database.setBool(keccak256(abi.encodePacked("acceptsToken", _operatorID, _tokenAddress)), _accept);
+    return true;
+  }
+ 
+  // @notice operator can choose whether or not to accept Ether
+  function acceptEther(bytes32 _operatorID, bool _accept)
+  external
+  onlyOperator(_operatorID)
+  returns (bool) {
+    database.setBool(keccak256(abi.encodePacked("acceptsEther", _operatorID)), _accept);
+    return true;
+  }
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Modifiers                                                                     //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice Sender must be a registered owner
+  modifier onlyOwner {
+    require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))));
+    _;
+  }
+ 
+  // @notice Sender must be the operator address for this operatorID
+  modifier onlyOperator(bytes32 _operatorID) {
+    Erequire(database.addressStorage(keccak256(abi.encodePacked("operator", _operatorID))) == msg.sender);
+    _;
+  }
+ 
+ 
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  //                                                Events                                                                        //
+  //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+ 
+ 
+  event LogOperatorRegistered(bytes32 indexed _operatorID, string _operatorURI);
+  event LogOperatorRemoved(bytes32 indexed _operatorID, address _owner);
+  event LogOperatorAddressChanged(bytes32 indexed _operatorID, address _oldAddress, address _newAddress);
+  event LogOperatorAcceptsToken(bytes32 indexed _operatorID, address _tokenAddress);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/roles/index.html b/coverage/roles/index.html new file mode 100644 index 00000000..6962d53d --- /dev/null +++ b/coverage/roles/index.html @@ -0,0 +1,119 @@ + + + + Code coverage report for roles/ + + + + + + + +
+
+

+ all files roles/ +

+
+
+ 73.64% + Statements + 81/110 +
+
+ 44.57% + Branches + 41/92 +
+
+ 90.48% + Functions + 19/21 +
+
+ 77.1% + Lines + 101/131 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
AssetManagerEscrow.sol
71.79%28/3950%16/3283.33%5/677.27%34/44
AssetManagerFunds.sol
68.42%39/5731.25%15/4885.71%6/768.75%44/64
Operators.sol
100%14/1483.33%10/12100%8/8100%23/23
+
+
+ + + + + + + diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png new file mode 100644 index 00000000..03f704a6 Binary files /dev/null and b/coverage/sort-arrow-sprite.png differ diff --git a/coverage/sorter.js b/coverage/sorter.js new file mode 100644 index 00000000..6c5034e4 --- /dev/null +++ b/coverage/sorter.js @@ -0,0 +1,158 @@ +var addSorting = (function () { + "use strict"; + var cols, + currentSort = { + index: 0, + desc: false + }; + + // returns the summary table element + function getTable() { return document.querySelector('.coverage-summary'); } + // returns the thead element of the summary table + function getTableHeader() { return getTable().querySelector('thead tr'); } + // returns the tbody element of the summary table + function getTableBody() { return getTable().querySelector('tbody'); } + // returns the th element for nth column + function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } + + // loads all columns + function loadColumns() { + var colNodes = getTableHeader().querySelectorAll('th'), + colNode, + cols = [], + col, + i; + + for (i = 0; i < colNodes.length; i += 1) { + colNode = colNodes[i]; + col = { + key: colNode.getAttribute('data-col'), + sortable: !colNode.getAttribute('data-nosort'), + type: colNode.getAttribute('data-type') || 'string' + }; + cols.push(col); + if (col.sortable) { + col.defaultDescSort = col.type === 'number'; + colNode.innerHTML = colNode.innerHTML + ''; + } + } + return cols; + } + // attaches a data attribute to every tr element with an object + // of data values keyed by column name + function loadRowData(tableRow) { + var tableCols = tableRow.querySelectorAll('td'), + colNode, + col, + data = {}, + i, + val; + for (i = 0; i < tableCols.length; i += 1) { + colNode = tableCols[i]; + col = cols[i]; + val = colNode.getAttribute('data-value'); + if (col.type === 'number') { + val = Number(val); + } + data[col.key] = val; + } + return data; + } + // loads all row data + function loadData() { + var rows = getTableBody().querySelectorAll('tr'), + i; + + for (i = 0; i < rows.length; i += 1) { + rows[i].data = loadRowData(rows[i]); + } + } + // sorts the table using the data for the ith column + function sortByIndex(index, desc) { + var key = cols[index].key, + sorter = function (a, b) { + a = a.data[key]; + b = b.data[key]; + return a < b ? -1 : a > b ? 1 : 0; + }, + finalSorter = sorter, + tableBody = document.querySelector('.coverage-summary tbody'), + rowNodes = tableBody.querySelectorAll('tr'), + rows = [], + i; + + if (desc) { + finalSorter = function (a, b) { + return -1 * sorter(a, b); + }; + } + + for (i = 0; i < rowNodes.length; i += 1) { + rows.push(rowNodes[i]); + tableBody.removeChild(rowNodes[i]); + } + + rows.sort(finalSorter); + + for (i = 0; i < rows.length; i += 1) { + tableBody.appendChild(rows[i]); + } + } + // removes sort indicators for current column being sorted + function removeSortIndicators() { + var col = getNthColumn(currentSort.index), + cls = col.className; + + cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); + col.className = cls; + } + // adds sort indicators for current column being sorted + function addSortIndicators() { + getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; + } + // adds event listeners for all sorter widgets + function enableUI() { + var i, + el, + ithSorter = function ithSorter(i) { + var col = cols[i]; + + return function () { + var desc = col.defaultDescSort; + + if (currentSort.index === i) { + desc = !currentSort.desc; + } + sortByIndex(i, desc); + removeSortIndicators(); + currentSort.index = i; + currentSort.desc = desc; + addSortIndicators(); + }; + }; + for (i =0 ; i < cols.length; i += 1) { + if (cols[i].sortable) { + // add the click event handler on the th so users + // dont have to click on those tiny arrows + el = getNthColumn(i).querySelector('.sorter').parentElement; + if (el.addEventListener) { + el.addEventListener('click', ithSorter(i)); + } else { + el.attachEvent('onclick', ithSorter(i)); + } + } + } + } + // adds sorting functionality to the UI + return function () { + if (!getTable()) { + return; + } + cols = loadColumns(); + loadData(cols); + addSortIndicators(); + enableUI(); + }; +})(); + +window.addEventListener('load', addSorting); diff --git a/coverage/test/ApproveAndCallTest.sol.html b/coverage/test/ApproveAndCallTest.sol.html new file mode 100644 index 00000000..ba059cb7 --- /dev/null +++ b/coverage/test/ApproveAndCallTest.sol.html @@ -0,0 +1,95 @@ + + + + Code coverage report for test/ApproveAndCallTest.sol + + + + + + + +
+
+

+ all files / test/ ApproveAndCallTest.sol +

+
+
+ 100% + Statements + 1/1 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 1/1 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11  +  +  +  +  +2× +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+contract ApproveAndCallTest{
+  function receiveApproval(address from, uint tokens, address token, bytes data)
+  public {
+    emit LogApproval(from, tokens, token, data);
+  }
+ 
+  event LogApproval(address _from, uint _tokens, address _token, bytes _data);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test/HashFunctions.sol.html b/coverage/test/HashFunctions.sol.html new file mode 100644 index 00000000..5c49e4b5 --- /dev/null +++ b/coverage/test/HashFunctions.sol.html @@ -0,0 +1,587 @@ + + + + Code coverage report for test/HashFunctions.sol + + + + + + + +
+
+

+ all files / test/ HashFunctions.sol +

+
+
+ 21.74% + Statements + 5/23 +
+
+ 100% + Branches + 0/0 +
+
+ 21.74% + Functions + 5/23 +
+
+ 20.83% + Lines + 5/24 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +8× +  +  +  +  +  +  +  +  +  +  +  +  +  +21× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+contract HashFunctions {
+ 
+  function toBytes(uint x)
+  external
+  pure
+  returns (bytes b) {
+    b = new bytes(32);
+    assembly { mstore(add(b, 32), x) }
+  }
+ 
+ 
+ 
+  function getMethodID(string _functionString)
+  public
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked(_functionString)));
+  }
+ 
+  function getAssetID(string _assetURI, uint _amountToRaise, bytes32 _operatorID)
+  public
+  view
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(msg.sender, _amountToRaise, _operatorID, _assetURI));
+  }
+ 
+  function getOrderID(bytes _assetID, address _user, uint _amount, uint _price, bool _buyOrder)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_assetID, _user, _amount, _price, _buyOrder));
+  }
+ 
+  function getFunctionInitiatorHash(address _param1, address _param2, bytes32 _param3)
+  external
+  pure
+  returns(bytes32) {
+    return keccak256(abi.encodePacked(_param1, _param2, "destroy", _param3));
+  }
+ 
+  function uintHash(uint _param)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param));
+  }
+ 
+  function getStakingID(address _staker, uint256 _blockNumber, uint256 _amount)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_staker, _blockNumber, _amount));
+  }
+ 
+  function stringHash(string _name)
+  external
+  pure
+  returns (bytes32){
+    return keccak256(abi.encodePacked(_name));
+  }
+ 
+  function addressHash(address _param)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param));
+  }
+ 
+ 
+  function contractHash(string _name)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked("contract", _name));
+  }
+ 
+  function stringAddress(string _param, address _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringString(string _param, string _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return (keccak256(abi.encodePacked(_param, _paramTwo)));
+  }
+ 
+  function stringBytes(string _param, bytes32 _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringUint(string _param, uint _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo));
+  }
+ 
+  function stringBytesAddress(string _param, bytes32 _paramTwo, address _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo, _paramThree));
+  }
+ 
+  function addressUintUint(address _param, uint _paramTwo, uint _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_param, _paramTwo, _paramThree));
+  }
+ 
+ 
+  function getAuthorizeHash(address _contractAddress, address _owner, string _fnName, bytes32 _recipient)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_contractAddress, _owner, _fnName, _recipient));
+  }
+ 
+  function uintUint(uint _paramOne, uint _paramTwo)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_paramOne, _paramTwo));
+  }
+ 
+ 
+  function uintUintUint(uint _paramOne, uint _paramTwo, uint _paramThree)
+  external
+  pure
+  returns (bytes32) {
+    return keccak256(abi.encodePacked(_paramOne, _paramTwo, _paramThree));
+  }
+ 
+  function currentTime()
+  external
+  view
+  returns (uint) {
+    return now;
+  }
+ 
+  function nullBytes()
+  external
+  pure
+  returns (bytes32) {
+    return bytes32(0);
+  }
+ 
+  function nullAddress()
+  external
+  pure
+  returns (address) {
+    return address(0);
+  }
+ 
+function ()
+public {
+  revert();
+}
+ 
+ 
+ 
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test/SafeMathWrapper.sol.html b/coverage/test/SafeMathWrapper.sol.html new file mode 100644 index 00000000..b246239f --- /dev/null +++ b/coverage/test/SafeMathWrapper.sol.html @@ -0,0 +1,149 @@ + + + + Code coverage report for test/SafeMathWrapper.sol + + + + + + + +
+
+

+ all files / test/ SafeMathWrapper.sol +

+
+
+ 100% + Statements + 5/5 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 5/5 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29  +  +  +  +  +  +  +  +  +3× +  +  +  +1× +  +  +  +2× +  +  +  +2× +  +  +  +1× +  +  + 
pragma solidity 0.4.24;
+ 
+import "../math/SafeMath.sol";
+ 
+contract SafeMathWrapper {
+  using SafeMath for uint;
+  using SafeMath for bytes;
+ 
+  function multiply(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.mul(b);
+  }
+ 
+  function divide(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.div(b);
+  }
+ 
+  function subtract(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.sub(b);
+  }
+ 
+  function addto(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.add(b);
+  }
+ 
+  function fraction(uint256 a, uint256 b) external pure returns (uint256) {
+    return a.getFractionalAmount(b);
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test/TestBurner.sol.html b/coverage/test/TestBurner.sol.html new file mode 100644 index 00000000..f57693bf --- /dev/null +++ b/coverage/test/TestBurner.sol.html @@ -0,0 +1,185 @@ + + + + Code coverage report for test/TestBurner.sol + + + + + + + +
+
+

+ all files / test/ TestBurner.sol +

+
+
+ 100% + Statements + 8/8 +
+
+ 100% + Branches + 4/4 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 8/8 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +4× +  +  +  +  +  +2× +2× +2× +1× +  +  +  +  +  +  +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../access/ERC20Burner.sol'; 
+import '../database/Database.sol';
+ 
+contract TestBurner {
+ 
+  ERC20Burner public burner;
+  Database public database;
+ 
+  uint public amountBurnt;
+ 
+  constructor(address _database, address _burner)
+  public {
+    burner = ERC20Burner(_burner);
+    database = Database(_database);
+  }
+ 
+  function burnTokensManualFee(uint _amount)
+  external {
+    require(burner.burn(msg.sender, _amount));
+  }
+ 
+  // Must set fee in ERC20Burner first
+  function burnTokens()
+  external {
+    bytes4 methodID = bytes4(keccak256(abi.encodePacked("burnTokens()")));
+    uint amountToBurn = database.uintStorage(keccak256(abi.encodePacked(methodID, address(this))));
+    require(burner.burn(msg.sender, amountToBurn));
+    amountBurnt += amountToBurn;
+  }
+ 
+  function getMethodID()
+  external
+  pure
+  returns (bytes4) {
+    return bytes4(keccak256(abi.encodePacked("burnTokens()")));
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test/WithdrawTest.sol.html b/coverage/test/WithdrawTest.sol.html new file mode 100644 index 00000000..2a5fe716 --- /dev/null +++ b/coverage/test/WithdrawTest.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for test/WithdrawTest.sol + + + + + + + +
+
+

+ all files / test/ WithdrawTest.sol +

+
+
+ 33.33% + Statements + 2/6 +
+
+ 100% + Branches + 0/0 +
+
+ 50% + Functions + 1/2 +
+
+ 28.57% + Lines + 2/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+contract WithdrawTest{
+ 
+  mapping(address => uint) public balances;
+ 
+  function withdraw()
+  external
+  returns (bool){
+    emit LogWithdraw(msg.sender, balances[msg.sender]);
+    uint amount = balances[msg.sender];
+    balances[msg.sender] = 0;
+    msg.sender.transfer(amount);
+    return true;
+  }
+ 
+  function deposit(address _receiver)
+  payable
+  external{
+    emit LogDeposit(_receiver, msg.value);
+    balances[_receiver] += msg.value;
+  }
+ 
+  event LogDeposit(address _receiver, uint _amount);
+  event LogWithdraw(address _receiver, uint _amount);
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/test/index.html b/coverage/test/index.html new file mode 100644 index 00000000..082a1d3f --- /dev/null +++ b/coverage/test/index.html @@ -0,0 +1,145 @@ + + + + Code coverage report for test/ + + + + + + + +
+
+

+ all files test/ +

+
+
+ 48.84% + Statements + 21/43 +
+
+ 100% + Branches + 4/4 +
+
+ 45.71% + Functions + 16/35 +
+
+ 46.67% + Lines + 21/45 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
ApproveAndCallTest.sol
100%1/1100%0/0100%1/1100%1/1
HashFunctions.sol
21.74%5/23100%0/021.74%5/2320.83%5/24
SafeMathWrapper.sol
100%5/5100%0/0100%5/5100%5/5
TestBurner.sol
100%8/8100%4/4100%4/4100%8/8
WithdrawTest.sol
33.33%2/6100%0/050%1/228.57%2/7
+
+
+ + + + + + + diff --git a/coverage/tokens/distribution/EqualDistribution.sol.html b/coverage/tokens/distribution/EqualDistribution.sol.html new file mode 100644 index 00000000..c334cc22 --- /dev/null +++ b/coverage/tokens/distribution/EqualDistribution.sol.html @@ -0,0 +1,305 @@ + + + + Code coverage report for tokens/distribution/EqualDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ EqualDistribution.sol +

+
+
+ 42.86% + Statements + 6/14 +
+
+ 75% + Branches + 3/4 +
+
+ 40% + Functions + 2/5 +
+
+ 35.71% + Lines + 5/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +5× +  +1× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import '../../interfaces/PullPayment.sol';
+ 
+// @title A contract made to equally distribute payments amongs a list of beneficiaries
+// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+// @notice This contract allows someone to leave ETH for a beneficiary
+// @dev assumes each beneficiary receives equal amount
+contract EqualDistribution {
+  using SafeMath for uint;
+ 
+  address[] public beneficiaries;             // List of chosen beneficiaries
+ 
+  uint public totalReleased;               // Total WEI so far released to beneficiaries
+ 
+  mapping (address => uint) public amountRedeemed;    // Amount of WEI this address has already withdrawn from contract
+ 
+ 
+  // @notice constructor. Sets the beneficiaries and where the income to be distributed is coming from
+  // @param (address) _beneficiary = The ETH address of who is to receive the income. Could be a distribution contract.
+  constructor(address[] _beneficiaries)
+  public{
+    Erequire(_beneficiaries.length < 200); 
+    beneficiaries = _beneficiaries;
+  }
+ 
+  // @notice allows beneficiaries to withdraw from contracts at different locations to be re-distributed here
+  // @dev can call withdraw() on any address if there are no parameters required. Fallback function will be triggered
+  // @param (address) _contractAddress = The address to call withdraw() on.
+  function getFunds(address _contractAddress)
+  external
+  returns (bool) {
+    PullPayment(_contractAddress).withdraw();
+    return true;
+  }
+ 
+  // @notice beneficiaries can withdraw their share of the income here
+  function withdraw()
+  external
+  returns (bool) {
+    uint amount = ((address(this).balance.add(totalReleased)).div(beneficiaries.length)).sub(amountRedeemed[msg.sender]);
+    amountRedeemed[msg.sender] = amountRedeemed[msg.sender].add(amount);
+    totalReleased = totalReleased.add(amount);
+    msg.sender.transfer(amount);
+    emit LogWithdraw(msg.sender, amount);
+    return true;
+  }
+ 
+  // @notice fallback function. Accepts Ether and updates income balance
+  function ()
+  public
+  payable {
+    emit LogPayment(msg.sender, msg.value);
+  }
+ 
+ 
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  // Constants
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  // @notice check if the address is one of the beneficiaries
+  function isBeneficiary(address _beneficiary)
+  public
+  view
+  returns (bool) {
+    for (uint i = 0; i < beneficiaries.length; i++){
+      if (beneficiaries[i] == _beneficiary) { return true; }
+    }
+    return false;
+  }
+ 
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+  // Events
+  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ 
+  event LogPayment(address _sender, uint _amount);
+  event LogWithdraw(address _beneficiary, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/distribution/FixedDistribution.sol.html b/coverage/tokens/distribution/FixedDistribution.sol.html new file mode 100644 index 00000000..db4303e1 --- /dev/null +++ b/coverage/tokens/distribution/FixedDistribution.sol.html @@ -0,0 +1,143 @@ + + + + Code coverage report for tokens/distribution/FixedDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ FixedDistribution.sol +

+
+
+ 100% + Statements + 6/6 +
+
+ 50% + Branches + 1/2 +
+
+ 100% + Functions + 1/1 +
+
+ 100% + Lines + 7/7 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +6× +6× +  +2× +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import './StandardDistribution.sol';
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract FixedDistribution is StandardDistribution {
+  using SafeMath for uint;
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address[] _tokenHolders, uint[] _amount)
+  public {
+    Erequire(_tokenHolders.length < 200 && _tokenHolders.length == _amount.length);
+    uint _totalSupply;
+    tokenURI = _tokenURI;
+    for (uint8 i = 0; i < _tokenHolders.length; i++) {
+      _totalSupply = _totalSupply.add(_amount[i]);
+      balances[_tokenHolders[i]] = balances[_tokenHolders[i]].add(_amount[i]);
+    }
+    supply = _totalSupply;
+  }
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/distribution/MintableDistribution.sol.html b/coverage/tokens/distribution/MintableDistribution.sol.html new file mode 100644 index 00000000..6967e8bf --- /dev/null +++ b/coverage/tokens/distribution/MintableDistribution.sol.html @@ -0,0 +1,269 @@ + + + + Code coverage report for tokens/distribution/MintableDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ MintableDistribution.sol +

+
+
+ 100% + Statements + 10/10 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 4/4 +
+
+ 100% + Lines + 11/11 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +  +  +  +  +  +  +  +  +  +2× +2× +2× +2× +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +  +  +  +4× +3× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import './StandardDistribution.sol';
+ 
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBitFoundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract MintableDistribution is StandardDistribution{
+  using SafeMath for uint;
+ 
+  bool public mintingFinished = false;
+  address public minter;
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address _minter)
+  public {
+      tokenURI = _tokenURI;                         // Set the id for reference
+      minter = _minter;
+  }
+ 
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount)
+  public
+  canMint
+  returns (bool) {
+    supply = supply.add(_amount);
+    balances[_to] = balances[_to].add(_amount);
+    emit Mint(_to, _amount);
+    return true;
+  }
+ 
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting()
+  public
+  canMint
+  returns (bool) {
+    mintingFinished = true;
+    emit MintFinished();
+    return true;
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+ 
+  // @notice modifier: Requires that minting hasn't finished
+  modifier canMint() {
+    require(!mintingFinished && msg.sender == minter);
+    _;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                     Events
+  // ------------------------------------------------------------------------------------------------
+ 
+  event Mint(address indexed to, uint256 amount);
+  event MintFinished();
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/distribution/StandardDistribution.sol.html b/coverage/tokens/distribution/StandardDistribution.sol.html new file mode 100644 index 00000000..de122f98 --- /dev/null +++ b/coverage/tokens/distribution/StandardDistribution.sol.html @@ -0,0 +1,419 @@ + + + + Code coverage report for tokens/distribution/StandardDistribution.sol + + + + + + + +
+
+

+ all files / tokens/distribution/ StandardDistribution.sol +

+
+
+ 100% + Statements + 15/15 +
+
+ 100% + Branches + 0/0 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 18/18 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +  +  +  +  +  +  +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +5× +5× +  +  +  +  +  +  +  +1× +  +  +  +1× +  +  +  +7× +  +  +  +  +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import '../../math/SafeMath.sol';
+import '../../interfaces/PullPayment.sol';
+ 
+ 
+// @title Non-Transferable ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners can withdraw their share
+// @author Kyle Dewhurst, MyBitFoundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract StandardDistribution{
+  using SafeMath for uint;
+ 
+ 
+  uint public supply;
+  mapping (address => uint) internal balances;
+ 
+  string public tokenURI;                 // A reference to a URI containing further token information
+ 
+ 
+  // @notice Token Income Information
+  uint constant scalingFactor = 1e32;
+  uint public assetIncome;
+  uint public valuePerToken;
+ 
+  mapping (address => uint) public claimableIncome;
+  mapping (address => uint) public previousValuePerToken;
+ 
+ 
+  // @notice Updates claimableIncome, sends all wei to the token holder
+  function withdraw()
+  public
+  updateclaimableIncome(msg.sender)
+  returns (uint _amount) {
+      _amount = claimableIncome[msg.sender].div(scalingFactor);
+      delete claimableIncome[msg.sender];
+      msg.sender.transfer(_amount);
+      emit LogIncomeCollected(now, msg.sender, _amount);
+  }
+/*
+  // @notice allows beneficiaries to withdraw from contracts at different locations to be re-distributed here
+  // @dev can call withdraw() on any address if there are no parameters required. Fallback function will be triggered
+  // @param (address) _contractAddress = The address to call withdraw() on.
+  function getFunds(address _contractAddress)
+  external
+  returns (bool) {
+    PullPayment(_contractAddress).withdraw();
+    return true;
+  }
+ 
+*/
+  function issueDividends()
+  payable
+  public {
+      valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+      assetIncome = assetIncome.add(msg.value);
+      emit LogIncomeReceived(msg.sender, msg.value);
+  }
+ 
+    // Fallback function: Accepts Ether and updates ledger (issues dividends)
+  function ()
+    payable
+    public {
+      valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+      assetIncome = assetIncome.add(msg.value);
+      emit LogIncomeReceived(msg.sender, msg.value);
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   View Functions
+  // ------------------------------------------------------------------------------------------------
+ 
+  // @notice Calculates how much value _user holds
+  function getTokenValue(address _user)
+  public
+  view
+  returns (uint) {
+      uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_user]);
+      return valuePerTokenDifference.mul(balances[_user]);
+  }
+ 
+  // @notice Calculates how much wei user is owed. (new income + claimableIncome) / 10**32
+  function getUnclaimedAmount(address _user)
+  public
+  view
+  returns (uint) {
+      return (getTokenValue(_user).add(claimableIncome[_user]).div(scalingFactor));
+  }
+ 
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                   Modifiers
+  // ------------------------------------------------------------------------------------------------
+ 
+  // Updates the amount owed to user while holding tokenSupply
+  // @dev must be called before transfering tokens
+  modifier updateclaimableIncome(address _user) {
+      claimableIncome[_user] = claimableIncome[_user].add(getTokenValue(_user));
+      previousValuePerToken[_user] = valuePerToken;
+      _;
+  }
+ 
+ 
+  // ------------------------------------------------------------------------------------------------
+  //                                     Events
+  // ------------------------------------------------------------------------------------------------
+ 
+  event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+  event LogIncomeCollected(uint _block, address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/distribution/index.html b/coverage/tokens/distribution/index.html new file mode 100644 index 00000000..82c6ff0f --- /dev/null +++ b/coverage/tokens/distribution/index.html @@ -0,0 +1,132 @@ + + + + Code coverage report for tokens/distribution/ + + + + + + + +
+
+

+ all files tokens/distribution/ +

+
+
+ 82.22% + Statements + 37/45 +
+
+ 75% + Branches + 6/8 +
+
+ 83.33% + Functions + 15/18 +
+
+ 82% + Lines + 41/50 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
EqualDistribution.sol
42.86%6/1475%3/440%2/535.71%5/14
FixedDistribution.sol
100%6/650%1/2100%1/1100%7/7
MintableDistribution.sol
100%10/10100%2/2100%4/4100%11/11
StandardDistribution.sol
100%15/15100%0/0100%8/8100%18/18
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/BurnableToken.sol.html b/coverage/tokens/erc20/BurnableToken.sol.html new file mode 100644 index 00000000..ddb98d74 --- /dev/null +++ b/coverage/tokens/erc20/BurnableToken.sol.html @@ -0,0 +1,626 @@ + + + + Code coverage report for tokens/erc20/BurnableToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ BurnableToken.sol +

+
+
+ 100% + Statements + 42/42 +
+
+ 100% + Branches + 8/8 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 42/42 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +12× +12× +12× +12× +  +  +  +  +  +  +  +  +  +  +  +204× +203× +201× +201× +201× +201× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +156× +156× +156× +  +  +  +  +  +  +  +  +  +  +  +17× +16× +15× +15× +14× +14× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +  +  +1× +  +2× +2× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  +  +  +  +  +  +  +40× +40× +39× +39× +39× +39× +  +  +  +  +  +  +  +  +2× +  +  +  +  +  +  +  +  +199× +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./StandardToken.sol";
+import "../../interfaces/BurnableERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+// @title ERC20 token contract with burning capabilities
+// @notice Standard ERC20 contract with a deflationary supply.
+contract BurnableToken is BurnableERC20 {
+  using SafeMath for uint256;
+ 
+  string public tokenURI;
+ 
+  mapping(address => uint256) internal balances;
+ 
+  mapping (address => mapping (address => uint256)) internal allowed;
+ 
+  uint256 internal supply;
+ 
+ 
+    // @notice constructor: initialized
+    // @param (string) _tokenURI = The URI where information about this token can be found
+    // @param (uint) _totalSupply = The initial supply of the token
+    constructor(string _tokenURI, uint _totalSupply)
+    public {
+        supply = _totalSupply;                        // Update total supply
+        tokenURI = _tokenURI;                         // Set the id for reference
+        balances[msg.sender] = _totalSupply;
+        emit Transfer(address(0), msg.sender, _totalSupply);    // Transfer event indicating token creation
+    }
+ 
+ 
+  /**
+  * @dev Transfer token for a specified address
+  * @param _to The address to transfer to.
+  * @param _value The amount to be transferred.
+  */
+  function transfer(address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_value <= balances[msg.sender]);
+    require(_to != address(0));
+    balances[msg.sender] = balances[msg.sender].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    emit Transfer(msg.sender, _to, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
+  * Beware that changing an allowance with this method brings the risk that someone may use both the old
+  * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+  * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+  * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+  * @param _spender The address which will spend the funds.
+  * @param _value The amount of tokens to be spent.
+  */
+  function approve(address _spender, uint256 _value)
+  public
+  returns (bool) {
+    allowed[msg.sender][_spender] = _value;
+    emit Approval(msg.sender, _spender, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Transfer tokens from one address to another
+  * @param _from address The address which you want to send tokens from
+  * @param _to address The address which you want to transfer to
+  * @param _value uint256 the amount of tokens to be transferred
+  */
+  function transferFrom(address _from, address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_to != address(0));     // use burn instead
+    balances[_from] = balances[_from].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
+    emit Transfer(_from, _to, _value);
+    return true;
+  }
+ 
+  /**
+  * @dev Increase the amount of tokens that an owner allowed to a spender.
+  * approve should be called when allowed[_spender] == 0. To increment
+  * allowed value is better to use this function to avoid 2 calls (and wait until
+  * the first transaction is mined)
+  * From MonolithDAO Token.sol
+  * @param _spender The address which will spend the funds.
+  * @param _addedValue The amount of tokens to increase the allowance by.
+  */
+  function increaseApproval(address _spender, uint256 _addedValue)
+  public
+  returns (bool) {
+    allowed[msg.sender][_spender] = (
+    allowed[msg.sender][_spender].add(_addedValue));
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+  /**
+  * @dev Decrease the amount of tokens that an owner allowed to a spender.
+  * approve should be called when allowed[_spender] == 0. To decrement
+  * allowed value is better to use this function to avoid 2 calls (and wait until
+  * the first transaction is mined)
+  * From MonolithDAO Token.sol
+  * @param _spender The address which will spend the funds.
+  * @param _subtractedValue The amount of tokens to decrease the allowance by.
+  */
+  function decreaseApproval(address _spender, uint256 _subtractedValue)
+  public
+  returns (bool) {
+    uint256 oldValue = allowed[msg.sender][_spender];
+    if (_subtractedValue >= oldValue) {
+      allowed[msg.sender][_spender] = 0;
+    }
+    else {
+      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
+    }
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+ 
+ 
+  // ------------------------------------------------------------------------
+  // Removes senders tokens from supply.
+  // Lowers investor balance and totalSupply by _amount
+  // ------------------------------------------------------------------------
+  function burn(uint _amount)
+  public
+  returns (bool success) {
+    balances[msg.sender] = balances[msg.sender].sub(_amount);
+    supply = supply.sub(_amount);
+    emit LogBurn(msg.sender, _amount);
+    emit Transfer(msg.sender, address(0), _amount);
+    return true;
+  }
+ 
+  // ------------------------------------------------------------------------
+  // An approved sender can burn _amount tokens of investor _from
+  // Lowers investor balance and supply by _amount
+  // ------------------------------------------------------------------------
+  function burnFrom(address _from, uint _amount)
+  public
+  returns (bool success) {
+    balances[_from] = balances[_from].sub(_amount);                         // Subtract from the targeted balance
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);             // Subtract from the sender's allowance
+    supply = supply.sub(_amount);                              // Update supply
+    emit LogBurn(_from, _amount);
+    emit Transfer(_from, address(0), _amount);
+    return true;
+  }
+ 
+ 
+ 
+  /**
+  * @dev Total number of tokens in existence
+  */
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  /**
+  * @dev Gets the balance of the specified address.
+  * @param _owner The address to query the the balance of.
+  * @return An uint256 representing the amount owned by the passed address.
+  */
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+ 
+    /**
+   * @dev Function to check the amount of tokens that an owner allowed to a spender.
+   * @param _owner address The address which owns the funds.
+   * @param _spender address The address which will spend the funds.
+   * @return A uint256 specifying the amount of tokens still available for the spender.
+   */
+  function allowance(address _owner, address _spender)
+  public
+  view
+  returns (uint256) {
+    return allowed[_owner][_spender];
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/DividendToken.sol.html b/coverage/tokens/erc20/DividendToken.sol.html new file mode 100644 index 00000000..8f4ebabd --- /dev/null +++ b/coverage/tokens/erc20/DividendToken.sol.html @@ -0,0 +1,524 @@ + + + + Code coverage report for tokens/erc20/DividendToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ DividendToken.sol +

+
+
+ 95.83% + Statements + 23/24 +
+
+ 100% + Branches + 4/4 +
+
+ 90.91% + Functions + 10/11 +
+
+ 96.55% + Lines + 28/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +3× +1× +  +  +  +  +  +  +  +  +  +  +  +  +6× +5× +3× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +  +  +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +7× +7× +7× +7× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +36× +36× +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +  +  +  +32× +32× +32× +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import './MintableToken.sol';
+import '../../math/SafeMath.sol';
+import '../../interfaces/ApproveAndCallFallback.sol';
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive payments in the fallback function and token owners receive their share when transferring tokens.
+// @author Kyle Dewhurst & Peter Phillips MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract DividendToken is MintableToken {
+    using SafeMath for uint;
+ 
+    // @notice Token Income Information
+    uint constant scalingFactor = 1e32;
+    uint public valuePerToken;
+    uint public assetIncome;
+ 
+    mapping (address => uint) public incomeOwed;
+    mapping (address => uint) public previousValuePerToken;
+ 
+ 
+    // @notice constructor: initialized
+    constructor(string _tokenURI, address _owner)
+    public
+    MintableToken(_tokenURI, _owner){}
+ 
+    // @notice Transfer _amount tokens to address _to.
+    // @dev Sender must have enough tokens. Cannot send to 0x0.
+    // @param (address) _to = The address which will receive the tokens
+    // @param (uint) _amount = The amount of tokens to send
+    function transfer(address _to, uint _amount)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transfer(_to, _amount);
+        return true;
+    }
+ 
+    // @notice A 3rd party can transfer tokens if investor approves them to do so
+    // @dev Transfer _amount of tokens if _from has allowed msg.sender to do so.
+    // @param (address) _from = The address who approved msg.sender to spend tokens
+    // @param (address) _to = The address who will receive the tokens
+    // @param (uint) _amount = The number of tokens to send
+    function transferFrom(address _from, address _to, uint _amount)
+    public
+    updateIncomeClaimed(_from)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transferFrom(_from, _to, _amount);
+        return true;
+    }
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_spender)
+    returns (bool success) {
+        allowed[msg.sender][_spender] = _amount;
+        emit Approval(msg.sender, _spender, _amount);
+        ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _data);
+        return true;
+    }
+ 
+    // @notice token holders can withdraw income here
+    function withdraw()
+    public
+    updateIncomeClaimed(msg.sender)
+    returns (bool) {
+        uint amount = incomeOwed[msg.sender].div(scalingFactor);
+        delete incomeOwed[msg.sender];
+        emit LogIncomeCollected(msg.sender, amount);
+        msg.sender.transfer(amount);
+        return true;
+    }
+ 
+    // @notice assets can send their income here to be collected by investors
+    function issueDividends()
+    payable
+    public
+    returns (bool) {
+        assetIncome = assetIncome.add(msg.value);
+        valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+        emit LogIncomeReceived(msg.sender, msg.value);
+        return true;
+    }
+ 
+    // @notice returns null address to specify this token accepts only Ether payments
+    function getERC20()
+    external
+    pure
+    returns(address){
+      return address(0);
+    }
+ 
+    // Fallback function: receives Ether and updates income ledger
+    function ()
+    payable
+    public {
+        assetIncome = assetIncome.add(msg.value);
+        valuePerToken = valuePerToken.add(msg.value.mul(scalingFactor).div(supply));
+        emit LogIncomeReceived(msg.sender, msg.value);
+    }
+ 
+ 
+    // ------------------------------------------------------------------------
+    //                           View functions
+    // ------------------------------------------------------------------------
+ 
+    // @notice Calculates how much more income is owed to investor since last calculation
+    function collectLatestPayments(address _investor)
+    private
+    view
+    returns (uint) {
+        uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_investor]);
+        return valuePerTokenDifference.mul(balances[_investor]);
+    }
+ 
+    // @notice Calculates how much wei investor is owed. (points + incomeOwed) / 10**32
+    function getAmountOwed(address _investor)
+    public
+    view
+    returns (uint) {
+        return (collectLatestPayments(_investor).add(incomeOwed[_investor]).div(scalingFactor));
+    }
+ 
+    // ------------------------------------------------------------------------
+    //                            Modifiers
+    // ------------------------------------------------------------------------
+ 
+    // Updates the amount owed to investor while holding tokenSupply
+    // @dev must be called before transfering tokens
+    modifier updateIncomeClaimed(address _investor) {
+        incomeOwed[_investor] = incomeOwed[_investor].add(collectLatestPayments(_investor));
+        previousValuePerToken[_investor] = valuePerToken;
+        _;
+    }
+ 
+ 
+ 
+ 
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogIncomeCollected(address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/DividendTokenERC20.sol.html b/coverage/tokens/erc20/DividendTokenERC20.sol.html new file mode 100644 index 00000000..1f7073b6 --- /dev/null +++ b/coverage/tokens/erc20/DividendTokenERC20.sol.html @@ -0,0 +1,572 @@ + + + + Code coverage report for tokens/erc20/DividendTokenERC20.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ DividendTokenERC20.sol +

+
+
+ 100% + Statements + 33/33 +
+
+ 83.33% + Branches + 10/12 +
+
+ 100% + Functions + 11/11 +
+
+ 100% + Lines + 37/37 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +5× +  +  +  +  +  +  +  +  +3× +2× +1× +  +  +  +  +  +  +  +  +3× +2× +1× +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +  +  +  +  +  +6× +5× +5× +5× +5× +5× +  +  +  +  +  +  +  +10× +10× +10× +10× +10× +10× +  +  +  +  +  +  +  +2× +2× +2× +2× +  +1× +1× +  +2× +  +  +  +  +  +  +  +  +  +  +  +  +28× +28× +  +  +  +  +  +  +  +4× +  +  +  +  +  +  +2× +  +  +  +  +  +  +  +  +  +24× +24× +24× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity ^0.4.24;
+ 
+import './MintableToken.sol';
+import '../../math/SafeMath.sol';
+import '../../interfaces/ERC20.sol';
+import '../../interfaces/ApproveAndCallFallback.sol';
+ 
+// @title ERC20 token contract with shared revenue distribution functionality.
+// @notice This token contract can receive ERC20 tokens as payments and token owners receive their share when transferring tokens.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// Credit goes to Nick Johnson for the dividend token https://medium.com/@weka/dividend-bearing-tokens-on-ethereum-42d01c710657
+contract DividendTokenERC20 is MintableToken {
+    using SafeMath for uint;
+ 
+    ERC20 public erc20;
+ 
+    // @notice Token Income Information
+    uint constant scalingFactor = 1e32;
+ 
+    uint public assetIncome;
+    uint public assetIncomeIssued;
+    uint public valuePerToken;
+ 
+ 
+    mapping (address => uint) public incomeClaimed;
+    mapping (address => uint) public previousValuePerToken;
+ 
+ 
+    // @notice constructor: initialized
+    constructor(string _tokenURI, address _owner, address _erc20Address)
+    public  MintableToken(_tokenURI, _owner){
+        erc20 = ERC20(_erc20Address); //Set the address of the ERC20 token that will be issued as dividends
+    }
+ 
+ 
+    function transfer(address _to, uint _amount)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transfer(_to, _amount);
+        return true;
+    }
+ 
+ 
+    function transferFrom(address _from, address _to, uint _amount)
+    public
+    updateIncomeClaimed(_from)
+    updateIncomeClaimed(_to)
+    returns (bool success) {
+        require(_to != address(this));
+        super.transferFrom(_from, _to, _amount);
+        return true;
+    }
+ 
+    // @notice Token holder can notify a contract that it has been approved to spend _amount of tokens
+    // @param (address) _spender = The contract to call after approval is done
+    // @param (uint) _amount = Number of tokens to send
+    // @param (bytes) _data = Bytes data to send along with the contract call
+    function approveAndCall(address _spender, uint _amount, bytes _data)
+    public
+    updateIncomeClaimed(msg.sender)
+    updateIncomeClaimed(_spender)
+    returns (bool success) {
+        allowed[msg.sender][_spender] = _amount;
+        emit Approval(msg.sender, _spender, _amount);
+        ApproveAndCallFallBack(_spender).receiveApproval(msg.sender, _amount, address(this), _data);
+        return true;
+    }
+ 
+    function issueDividends(uint _amount)
+    public
+    returns (bool){
+        require(_amount > 0);
+        Erequire(erc20.transferFrom(msg.sender, address(this), _amount));
+        valuePerToken = valuePerToken.add(_amount.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(_amount);
+        emit LogIncomeReceived(msg.sender, _amount);
+        return true;
+    }
+ 
+    // @notice Updates incomeClaimed, sends all wei to the token holder
+    function withdraw()
+    public
+    updateIncomeClaimed(msg.sender)
+    returns (bool) {
+        uint amount = incomeClaimed[msg.sender].div(scalingFactor);
+        delete incomeClaimed[msg.sender];
+        assetIncomeIssued = assetIncomeIssued.add(amount);
+        Erequire(erc20.transfer(msg.sender, amount));
+        emit LogIncomeCollected(msg.sender, amount);
+        return true;
+    }
+ 
+    //In case a investor transferred a token directly to this contract
+    //anyone can run this function to clean up the balances
+    //and distribute the difference to token holders
+    function checkForTransfers()
+    external {
+      uint bookBalance = assetIncome.sub(assetIncomeIssued);
+      uint actualBalance = erc20.balanceOf(address(this));
+      uint diffBalance = actualBalance.sub(bookBalance);
+      if(diffBalance > 0){
+        //Update value per token
+        valuePerToken = valuePerToken.add(diffBalance.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(diffBalance);
+      }
+      emit LogCheckBalance(diffBalance);
+    }
+ 
+ 
+    // ------------------------------------------------------------------------
+    //                           View functions
+    // ------------------------------------------------------------------------
+ 
+    // @notice Calculates how much value _investor holds
+    function collectLatestPayments(address _investor)
+    public
+    view
+    returns (uint) {
+        uint valuePerTokenDifference = valuePerToken.sub(previousValuePerToken[_investor]);
+        return valuePerTokenDifference.mul(balances[_investor]);
+    }
+ 
+    // @notice Calculates how much wei investor is owed. (points + incomeClaimed) / 10**32
+    function getAmountOwed(address _investor)
+    public
+    view
+    returns (uint) {
+        return (collectLatestPayments(_investor).add(incomeClaimed[_investor]).div(scalingFactor));
+    }
+ 
+    function getERC20()
+    external
+    view
+    returns(address){
+      return address(erc20);
+    }
+ 
+    // ------------------------------------------------------------------------
+    //                            Modifiers
+    // ------------------------------------------------------------------------
+ 
+    // Updates the amount owed to investor while holding tokenSupply
+    // @dev must be called before transfering tokens
+    modifier updateIncomeClaimed(address _investor) {
+        incomeClaimed[_investor] = incomeClaimed[_investor].add(collectLatestPayments(_investor));
+        previousValuePerToken[_investor] = valuePerToken;
+        _;
+    }
+ 
+    // Fallback function:
+    // Only works with ERC223
+    // Can't currently detect which token
+    /*
+    function tokenFallback(address _from, uint _value, bytes _data)
+      public {
+        valuePerToken = valuePerToken.add(_value.mul(scalingFactor).div(supply));
+        assetIncome = assetIncome.add(_value);
+        emit LogIncomeReceived(_from, _value);
+    }
+    */
+ 
+    event LogIncomeReceived(address indexed _sender, uint _paymentAmount);
+    event LogCheckBalance(uint _difference);
+    event LogIncomeCollected(address _address, uint _amount);
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/GovernedToken.sol.html b/coverage/tokens/erc20/GovernedToken.sol.html new file mode 100644 index 00000000..409729a6 --- /dev/null +++ b/coverage/tokens/erc20/GovernedToken.sol.html @@ -0,0 +1,245 @@ + + + + Code coverage report for tokens/erc20/GovernedToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ GovernedToken.sol +

+
+
+ 70% + Statements + 7/10 +
+
+ 25% + Branches + 1/4 +
+
+ 75% + Functions + 3/4 +
+
+ 58.33% + Lines + 7/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +  +  +  +  +  +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +1× +1× +1× +1× +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./DividendToken.sol";
+import "../../math/SafeMath.sol";
+ 
+ 
+// @notice give GovernedToken access to view uint and bytes32 storage
+interface DBAccess {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+}
+ 
+// @title A Dividend token that has governance features .
+// @notice This token contract can receive ERC20 tokens as payments and token owners can lock tokens while submitting votes
+// @dev Dividend tokens aren't actually locked, but restricted from transferring to avoid locking contravt having to distribute dividends.
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+contract GovernedToken is DividendToken {
+  using SafeMath for uint;
+ 
+  DBAccess public database;
+ 
+ 
+  // @notice constructor: initialized
+  constructor(address _database, string _tokenURI, address _owner)
+  public
+  DividendToken(_tokenURI, _owner){
+    database = DBAccess(_database);
+  }
+ 
+  // @notice Standard DividendToke transfer function, which checks for locked tokens before sending
+  function transfer(address _to, uint _amount)
+  public
+  returns (bool success) {
+      Irequire(_amount <= getAmountAvailable(msg.sender));
+      super.transfer(_to, _amount);
+      return true;
+  }
+ 
+  // @notice Standard DividendToke transferFrom function, which checks for locked tokens before sending
+  function transferFrom(address _from, address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(_from));
+      super.transferFrom(_from, _to, _amount);
+      return true;
+  }
+ 
+  // @notice returns the amount of tokens _investor has locked for this asset
+  function getAmountAvailable(address _investor)
+  public
+  view
+  returns (uint) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", address(this))));
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", assetID, _investor)));
+    uint balance = balances[_investor];
+    uint available = balance.sub(amountLocked);
+    return available;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/GovernedTokenERC20.sol.html b/coverage/tokens/erc20/GovernedTokenERC20.sol.html new file mode 100644 index 00000000..1f513f40 --- /dev/null +++ b/coverage/tokens/erc20/GovernedTokenERC20.sol.html @@ -0,0 +1,248 @@ + + + + Code coverage report for tokens/erc20/GovernedTokenERC20.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ GovernedTokenERC20.sol +

+
+
+ 0% + Statements + 0/10 +
+
+ 0% + Branches + 0/4 +
+
+ 0% + Functions + 0/4 +
+
+ 0% + Lines + 0/12 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./DividendTokenERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+// @notice give GovernedToken access to view uint and bytes32 storage
+interface DBAccess {
+  function uintStorage(bytes32 _key) external view returns (uint);
+  function bytes32Storage(bytes32 _key) external view returns (bytes32);
+}
+ 
+// @title A Dividend token that has governance features and receives ERC20 tokens as payment
+// @notice This token contract can receive ERC20 tokens as payments and token owners can lock tokens while submitting votes
+// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
+// @dev Dividend tokens aren't actually locked, but restricted from transferring to avoid locking contravt having to distribute dividends.
+contract GovernedTokenERC20 is DividendTokenERC20{
+  DBAccess public database;
+ 
+ 
+  // @notice constructor: initializes database and DividendTokenERC20
+  // @param (address) _database = the address of the platform database
+  // @param (string) _tokenURI = The URI where details of the token (asse) can be found
+  // @param (address) _owner = The minting authority for this token
+  // @param (address) _erc20Address = The address of the erc20 token to be sent for dividends
+  constructor(address _database, string _tokenURI, address _owner, address _erc20Address)
+  public
+  DividendTokenERC20(_tokenURI, _owner, _erc20Address){
+    database = DBAccess(_database);
+  }
+ 
+  // @notice Standard DividendToke transfer function, which checks for locked tokens before sending
+  function transfer(address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(msg.sender));
+      super.transfer(_to, _amount);
+      return true;
+  }
+ 
+  // @notice Standard DividendToke transferFrom function, which checks for locked tokens before sending
+  function transferFrom(address _from, address _to, uint _amount)
+  public
+  returns (bool success) {
+      require(_amount <= getAmountAvailable(_from));
+      super.transferFrom(_from, _to, _amount);
+      return true;
+  }
+ 
+  // @notice returns the amount of tokens _investor has locked for this asset
+  function getAmountAvailable(address _investor)
+  public
+  view
+  returns (uint) {
+    bytes32 assetID = database.bytes32Storage(keccak256(abi.encodePacked("assetTokenID", address(this))));
+    uint amountLocked = database.uintStorage(keccak256(abi.encodePacked("tokensLocked", assetID, _investor)));
+    uint balance = balances[_investor];
+    uint available = balance.sub(amountLocked);
+    return available;
+  }
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/MintableToken.sol.html b/coverage/tokens/erc20/MintableToken.sol.html new file mode 100644 index 00000000..509664d0 --- /dev/null +++ b/coverage/tokens/erc20/MintableToken.sol.html @@ -0,0 +1,263 @@ + + + + Code coverage report for tokens/erc20/MintableToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ MintableToken.sol +

+
+
+ 100% + Statements + 13/13 +
+
+ 100% + Branches + 2/2 +
+
+ 100% + Functions + 5/5 +
+
+ 100% + Lines + 14/14 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +17× +17× +  +  +  +  +  +  +  +  +  +  +43× +43× +43× +43× +43× +  +  +  +  +  +  +  +7× +7× +7× +  +  +  +  +  +  +2× +  +  +  +  +51× +50× +  +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "./StandardToken.sol";
+ 
+ 
+/**
+ * @title Mintable token
+ * @dev Simple ERC20 Token example, with mintable token creation
+ * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
+ */
+contract MintableToken is StandardToken {
+ 
+  bool public mintingFinished;
+  address internal minter;
+  string internal tokenURI;                 // A reference to a URI containing further token information
+ 
+ 
+  // @notice constructor: initialized
+  constructor(string _tokenURI, address _minter)
+  public {
+      tokenURI = _tokenURI;                         // Set the id for reference
+      minter = _minter;
+      supply = 0;
+  }
+ 
+ 
+  // @dev Function to mint tokens
+  // @param _to The address that will receive the minted tokens.
+  // @param _amount The amount of tokens to mint.
+  function mint(address _to, uint256 _amount)
+  public
+  canMint
+  returns (bool) {
+    supply = supply.add(_amount);
+    balances[_to] = balances[_to].add(_amount);
+    emit Mint(_to, _amount);
+    emit Transfer(address(0), _to, _amount);
+    return true;
+  }
+ 
+  // @dev Function to stop minting new tokens.
+  function finishMinting()
+  public
+  canMint
+  returns (bool) {
+    mintingFinished = true;
+    emit MintFinished();
+    return true;
+  }
+ 
+  function getTokenURI()
+  external
+  view
+  returns (string) {
+      return tokenURI;
+  }
+ 
+  // @notice modifier: Requires that minting hasn't finished
+  modifier canMint() {
+    require(!mintingFinished && msg.sender == minter);
+    _;
+  }
+ 
+  event Mint(address indexed to, uint256 amount);
+  event MintFinished();
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/StandardToken.sol.html b/coverage/tokens/erc20/StandardToken.sol.html new file mode 100644 index 00000000..a55554cf --- /dev/null +++ b/coverage/tokens/erc20/StandardToken.sol.html @@ -0,0 +1,509 @@ + + + + Code coverage report for tokens/erc20/StandardToken.sol + + + + + + + +
+
+

+ all files / tokens/erc20/ StandardToken.sol +

+
+
+ 100% + Statements + 29/29 +
+
+ 100% + Branches + 12/12 +
+
+ 100% + Functions + 8/8 +
+
+ 100% + Lines + 29/29 +
+
+
+
+

+
+
1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +47 +48 +49 +50 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +17× +  +  +  +  +  +  +  +  +5× +3× +2× +2× +2× +2× +  +  +  +  +  +  +  +  +  +  +  +  +11× +11× +11× +  +  +  +  +  +  +  +  +  +  +  +7× +6× +5× +4× +4× +4× +4× +4× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +1× +  +1× +1× +  +  +  +  +  +  +  +  +  +  +  +  +  +  +2× +2× +1× +  +  +1× +  +2× +2× +  +  +  +  +  +  +  +36× +  +  +  +  +  +  +  +  +55× +  +  +  +  + 
pragma solidity 0.4.24;
+ 
+import "../../interfaces/ERC20.sol";
+import "../../math/SafeMath.sol";
+ 
+ 
+/**
+ * @title Standard ERC20 token
+ *
+ * @dev Implementation of the basic standard token.
+ * https://github.com/ethereum/EIPs/issues/20
+ * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
+ */
+contract StandardToken is ERC20 {
+  using SafeMath for uint256;
+ 
+  mapping(address => uint256) internal balances;
+ 
+  mapping (address => mapping (address => uint256)) internal allowed;
+ 
+  uint256 internal supply;
+ 
+ 
+  /**
+   * @dev Function to check the amount of tokens that an owner allowed to a spender.
+   * @param _owner address The address which owns the funds.
+   * @param _spender address The address which will spend the funds.
+   * @return A uint256 specifying the amount of tokens still available for the spender.
+   */
+  function allowance(address _owner, address _spender)
+  public
+  view
+  returns (uint256) {
+    return allowed[_owner][_spender];
+  }
+ 
+  /**
+  * @dev Transfer token for a specified address
+  * @param _to The address to transfer to.
+  * @param _value The amount to be transferred.
+  */
+  function transfer(address _to, uint256 _value) public returns (bool) {
+    require(_value <= balances[msg.sender]);
+    require(_to != address(0));
+    balances[msg.sender] = balances[msg.sender].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    emit Transfer(msg.sender, _to, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
+   * Beware that changing an allowance with this method brings the risk that someone may use both the old
+   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
+   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
+   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
+   * @param _spender The address which will spend the funds.
+   * @param _value The amount of tokens to be spent.
+   */
+  function approve(address _spender, uint256 _value) public returns (bool) {
+    allowed[msg.sender][_spender] = _value;
+    emit Approval(msg.sender, _spender, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Transfer tokens from one address to another
+   * @param _from address The address which you want to send tokens from
+   * @param _to address The address which you want to transfer to
+   * @param _value uint256 the amount of tokens to be transferred
+   */
+  function transferFrom(address _from, address _to, uint256 _value)
+  public
+  returns (bool) {
+    require(_value <= balances[_from]);
+    require(_value <= allowed[_from][msg.sender]);
+    require(_to != address(0));
+    balances[_from] = balances[_from].sub(_value);
+    balances[_to] = balances[_to].add(_value);
+    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
+    emit Transfer(_from, _to, _value);
+    return true;
+  }
+ 
+  /**
+   * @dev Increase the amount of tokens that an owner allowed to a spender.
+   * approve should be called when allowed[_spender] == 0. To increment
+   * allowed value is better to use this function to avoid 2 calls (and wait until
+   * the first transaction is mined)
+   * From MonolithDAO Token.sol
+   * @param _spender The address which will spend the funds.
+   * @param _addedValue The amount of tokens to increase the allowance by.
+   */
+  function increaseApproval(
+    address _spender,
+    uint256 _addedValue
+  )
+    public
+    returns (bool)
+  {
+    allowed[msg.sender][_spender] = (
+      allowed[msg.sender][_spender].add(_addedValue));
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+  /**
+   * @dev Decrease the amount of tokens that an owner allowed to a spender.
+   * approve should be called when allowed[_spender] == 0. To decrement
+   * allowed value is better to use this function to avoid 2 calls (and wait until
+   * the first transaction is mined)
+   * From MonolithDAO Token.sol
+   * @param _spender The address which will spend the funds.
+   * @param _subtractedValue The amount of tokens to decrease the allowance by.
+   */
+  function decreaseApproval(address _spender, uint256 _subtractedValue)
+  public
+  returns (bool) {
+    uint256 oldValue = allowed[msg.sender][_spender];
+    if (_subtractedValue >= oldValue) {
+      allowed[msg.sender][_spender] = 0;
+    }
+    else {
+      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
+    }
+    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
+    return true;
+  }
+ 
+ 
+  /**
+  * @dev Total number of tokens in existence
+  */
+  function totalSupply() public view returns (uint256) {
+    return supply;
+  }
+ 
+  /**
+  * @dev Gets the balance of the specified address.
+  * @param _owner The address to query the the balance of.
+  * @return An uint256 representing the amount owned by the passed address.
+  */
+  function balanceOf(address _owner) public view returns (uint256) {
+    return balances[_owner];
+  }
+ 
+ 
+}
+ 
+
+
+ + + + + + + diff --git a/coverage/tokens/erc20/index.html b/coverage/tokens/erc20/index.html new file mode 100644 index 00000000..1dbfba6a --- /dev/null +++ b/coverage/tokens/erc20/index.html @@ -0,0 +1,171 @@ + + + + Code coverage report for tokens/erc20/ + + + + + + + +
+
+

+ all files tokens/erc20/ +

+
+
+ 91.3% + Statements + 147/161 +
+
+ 80.43% + Branches + 37/46 +
+
+ 88.89% + Functions + 48/54 +
+
+ 89.71% + Lines + 157/175 +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileStatementsBranchesFunctionsLines
BurnableToken.sol
100%42/42100%8/8100%11/11100%42/42
DividendToken.sol
95.83%23/24100%4/490.91%10/1196.55%28/29
DividendTokenERC20.sol
100%33/3383.33%10/12100%11/11100%37/37
GovernedToken.sol
70%7/1025%1/475%3/458.33%7/12
GovernedTokenERC20.sol
0%0/100%0/40%0/40%0/12
MintableToken.sol
100%13/13100%2/2100%5/5100%14/14
StandardToken.sol
100%29/29100%12/12100%8/8100%29/29
+
+
+ + + + + + + diff --git a/coverageEnv b/coverageEnv new file mode 160000 index 00000000..7213dc38 --- /dev/null +++ b/coverageEnv @@ -0,0 +1 @@ +Subproject commit 7213dc387a7fa8fcaaecc7e73dd50bcc177ffc15 diff --git a/docgen/docs/api_alphacontracts_contracts_api.md b/docgen/docs/api_alphacontracts_contracts_api.md deleted file mode 100644 index e798a316..00000000 --- a/docgen/docs/api_alphacontracts_contracts_api.md +++ /dev/null @@ -1,296 +0,0 @@ ---- -id: alphacontracts_contracts_API -title: API ---- - -# api\_alphacontracts\_contracts\_API - -## contract API - -Source: [alphacontracts/contracts/API.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/API.sol) - -## Index - -* [InstallerEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#InstallerEscrow) -* [MyBitFoundation](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#MyBitFoundation) -* [accessTokenFee](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#accessTokenFee) -* [amountRaised](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#amountRaised) -* [amountToBeRaised](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#amountToBeRaised) -* [assetIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#assetIncome) -* [assetManager](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#assetManager) -* [assetStaker](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#assetStaker) -* [contractAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#contractAddress) -* [contractExists](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#contractExists) -* [depositedMYB](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#depositedMYB) -* [escrowExpiration](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#escrowExpiration) -* [escrowedForAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#escrowedForAsset) -* [escrowedMYB](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#escrowedMYB) -* [ethUSDPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#ethUSDPrice) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html) -* [fundingDeadline](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#fundingDeadline) -* [fundingStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#fundingStage) -* [getAmountOwed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#getAmountOwed) -* [getFunctionAuthorizationHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#getFunctionAuthorizationHash) -* [installerPercentage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#installerPercentage) -* [isFunctionAuthorized](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#isFunctionAuthorized) -* [isOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#isOwner) -* [isPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#isPaused) -* [lockedForAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#lockedForAsset) -* [managerIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#managerIncome) -* [managerPercentage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#managerPercentage) -* [myBitFoundationPercentage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#myBitFoundationPercentage) -* [mybUSDPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#mybUSDPrice) -* [ownershipUnits](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#ownershipUnits) -* [priceExpiration](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#priceExpiration) -* [priceTimeToExpiration](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#priceTimeToExpiration) -* [priceUpdateTimeline](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#priceUpdateTimeline) -* [stakerIncomeShare](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#stakerIncomeShare) -* [stakingExpiration](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#stakingExpiration) -* [totalPaidToFunder](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#totalPaidToFunder) -* [totalPaidToFunders](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#totalPaidToFunders) -* [totalReceived](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#totalReceived) -* [userAccess](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_API.html#userAccess) - -## Reference - -### Functions - -* **InstallerEscrow** - - `function` **`InstallerEscrow`**`() public view returns (address)` - - Returns:address - -* **MyBitFoundation** - - `function` **`MyBitFoundation`**`() public view returns (address)` - - Returns:address - -* **accessTokenFee** - - `function` **`accessTokenFee`**`(uint _accessLevelDesired) public view returns (uint)` - - Parameters:`_accessLevelDesired` - uintReturns:uint - -* **amountRaised** - - `function` **`amountRaised`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **amountToBeRaised** - - `function` **`amountToBeRaised`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **assetIncome** - - `function` **`assetIncome`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **assetManager** - - `function` **`assetManager`**`(bytes32 _assetID) public view returns (address)` - - Parameters:`_assetID` - bytes32Returns:address - -* **assetStaker** - - `function` **`assetStaker`**`(bytes32 _assetID) public view returns (address)` - - Parameters:`_assetID` - bytes32Returns:address - -* **contractAddress** - - `function` **`contractAddress`**`(string _name) public view returns (address)` - - Parameters:`_name` - stringReturns:address - -* **contractExists** - - `function` **`contractExists`**`(address _contractAddress) public view returns (bool)` - - Parameters:`_contractAddress` - addressReturns:bool - -* **depositedMYB** - - `function` **`depositedMYB`**`(address _manager) public view returns (uint)` - - Parameters:`_manager` - addressReturns:uint - -* **escrowExpiration** - - `function` **`escrowExpiration`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **escrowedForAsset** - - `function` **`escrowedForAsset`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **escrowedMYB** - - `function` **`escrowedMYB`**`(address _manager) public view returns (uint)` - - Parameters:`_manager` - addressReturns:uint - -* **ethUSDPrice** - - `function` **`ethUSDPrice`**`() public view returns (uint)` - - Returns:uint - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fallback** - - `function () public` - -* **fundingDeadline** - - `function` **`fundingDeadline`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **fundingStage** - - `function` **`fundingStage`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **getAmountOwed** - - `function` **`getAmountOwed`**`(bytes32 _assetID, address _user) public view returns (uint)` - - Parameters:`_assetID` - bytes32`_user` - addressReturns:uint - -* **getFunctionAuthorizationHash** - - `function` **`getFunctionAuthorizationHash`**`(address _contractAddress, address _signer, string _functionName, bytes32 _agreedParameter) public pure returns (bytes32)` - - Parameters:`_contractAddress` - address`_signer` - address`_functionName` - string`_agreedParameter` - bytes32Returns:bytes32 - -* **installerPercentage** - - `function` **`installerPercentage`**`() public view returns (uint)` - - Returns:uint - -* **isFunctionAuthorized** - - `function` **`isFunctionAuthorized`**`(bytes32 _functionAuthorizationHash) public view returns (bool)` - - Parameters:`_functionAuthorizationHash` - bytes32Returns:bool - -* **isOwner** - - `function` **`isOwner`**`(address _user) public view returns (bool)` - - Parameters:`_user` - addressReturns:bool - -* **isPaused** - - `function` **`isPaused`**`(address _contractAddress) public view returns (bool)` - - Parameters:`_contractAddress` - addressReturns:bool - -* **lockedForAsset** - - `function` **`lockedForAsset`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **managerIncome** - - `function` **`managerIncome`**`(address _manager) public view returns (uint)` - - Parameters:`_manager` - addressReturns:uint - -* **managerPercentage** - - `function` **`managerPercentage`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **myBitFoundationPercentage** - - `function` **`myBitFoundationPercentage`**`() public view returns (uint)` - - Returns:uint - -* **mybUSDPrice** - - `function` **`mybUSDPrice`**`() public view returns (uint)` - - Returns:uint - -* **ownershipUnits** - - `function` **`ownershipUnits`**`(bytes32 _assetID, address _user) public view returns (uint)` - - Parameters:`_assetID` - bytes32`_user` - addressReturns:uint - -* **priceExpiration** - - `function` **`priceExpiration`**`() public view returns (uint)` - - Returns:uint - -* **priceTimeToExpiration** - - `function` **`priceTimeToExpiration`**`() public view returns (uint)` - - Returns:uint - -* **priceUpdateTimeline** - - `function` **`priceUpdateTimeline`**`() public view returns (uint)` - - Returns:uint - -* **stakerIncomeShare** - - `function` **`stakerIncomeShare`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **stakingExpiration** - - `function` **`stakingExpiration`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **totalPaidToFunder** - - `function` **`totalPaidToFunder`**`(bytes32 _assetID, address _funder) public view returns (uint)` - - Parameters:`_assetID` - bytes32`_funder` - addressReturns:uint - -* **totalPaidToFunders** - - `function` **`totalPaidToFunders`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **totalReceived** - - `function` **`totalReceived`**`(bytes32 _assetID) public view returns (uint)` - - Parameters:`_assetID` - bytes32Returns:uint - -* **userAccess** - - `function` **`userAccess`**`(address _user) public view returns (uint)` - - Parameters:`_user` - addressReturns:uint - diff --git a/docgen/docs/api_alphacontracts_contracts_asset.md b/docgen/docs/api_alphacontracts_contracts_asset.md deleted file mode 100644 index ea2166f2..00000000 --- a/docgen/docs/api_alphacontracts_contracts_asset.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -id: alphacontracts_contracts_Asset -title: Asset ---- - -# api\_alphacontracts\_contracts\_Asset - -## contract Asset - -Source: [alphacontracts/contracts/Asset.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Asset.sol) - -## Index - -* [LogDestruction](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#LogDestruction) -* [LogIncomeReceived](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#LogIncomeReceived) -* [LogIncomeWithdrawl](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#LogIncomeWithdrawl) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#anyOwner) -* [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#atStage) -* [batchWithdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#batchWithdraw) -* [destroy](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#destroy) -* [distributeStakingShare](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#distributeStakingShare) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html) -* [onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#onlyApproved) -* [receiveIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#receiveIncome) -* [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#requiresEther) -* [setManagerIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#setManagerIncome) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#whenNotPaused) -* [withdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#withdraw) -* [withdrawManagerIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#withdrawManagerIncome) - -## Reference - -### Events - -* **LogDestruction** - - `event` **`LogDestruction`**`(address _locationSent, uint _amountSent, address _caller)` - - Parameters:`_locationSent` - address`_amountSent` - uint`_caller` - address - -* **LogIncomeReceived** - - `event` **`LogIncomeReceived`**`(bytes32 _assetID, address _sender, uint _amount, bytes32 _note)` - - Parameters:`_assetID` - bytes32`_sender` - address`_amount` - uint`_note` - bytes32 - -* **LogIncomeWithdrawl** - - `event` **`LogIncomeWithdrawl`**`(address _funder, uint _amount)` - - Parameters:`_funder` - address`_amount` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **atStage** - - `modifier` **`atStage`**`(bytes32 _assetID, uint _stage)` - - Parameters:`_assetID` - bytes32`_stage` - uint - -* **onlyApproved** - - `modifier` **`onlyApproved`**`(uint8 _accessLevel)` - - Parameters:`_accessLevel` - uint8 - -* **requiresEther** - - `modifier` **`requiresEther`**`()` - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **batchWithdraw** - - `function` **`batchWithdraw`**`(bytes32[] _assetIDs) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#whenNotPaused)Parameters:`_assetIDs` - bytes32\[\]Returns:bool - -* **destroy** - - `function` **`destroy`**`(address _functionInitiator, address _holdingAddress) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#anyOwner)Parameters:`_functionInitiator` - address`_holdingAddress` - address - -* **distributeStakingShare** - - `function` **`distributeStakingShare`**`(bytes32 _assetID, uint _managerAmount) internal returns (bool)` - - Parameters:`_assetID` - bytes32`_managerAmount` - uintReturns:bool - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fallback** - - `function () public` - -* **receiveIncome** - - `function` **`receiveIncome`**`(bytes32 _assetID, bytes32 _note) external payable returns (bool)` - - Modifiers:[requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#requiresEther) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#atStage)Parameters:`_assetID` - bytes32`_note` - bytes32Returns:bool - -* **setManagerIncome** - - `function` **`setManagerIncome`**`(address _manager, uint _managerAmount) internal returns (bool)` - - Parameters:`_manager` - address`_managerAmount` - uintReturns:bool - -* **withdraw** - - `function` **`withdraw`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#whenNotPaused)Parameters:`_assetID` - bytes32Returns:bool - -* **withdrawManagerIncome** - - `function` **`withdrawManagerIncome`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Asset.html#atStage)Parameters:`_assetID` - bytes32Returns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_assetbank.md b/docgen/docs/api_alphacontracts_contracts_assetbank.md deleted file mode 100644 index 41e563b6..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assetbank.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -id: alphacontracts_contracts_AssetBank -title: AssetBank ---- - -# api\_alphacontracts\_contracts\_AssetBank - -## contract AssetBank - -Source: [alphacontracts/contracts/AssetBank.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetBank.sol) - -## Index - -* [LogDestruction](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#LogDestruction) -* [LogIncomeReceived](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#LogIncomeReceived) -* [LogIncomeWithdrawl](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#LogIncomeWithdrawl) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#anyOwner) -* [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#atStage) -* [batchWithdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#batchWithdraw) -* [destroy](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#destroy) -* [distributeStakingShare](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#distributeStakingShare) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html) -* [onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#onlyApproved) -* [receiveIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#receiveIncome) -* [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#requiresEther) -* [setManagerIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#setManagerIncome) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#whenNotPaused) -* [withdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#withdraw) -* [withdrawManagerIncome](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#withdrawManagerIncome) - -## Reference - -### Events - -* **LogDestruction** - - `event` **`LogDestruction`**`(address _locationSent, uint _amountSent, address _caller)` - - Parameters:`_locationSent` - address`_amountSent` - uint`_caller` - address - -* **LogIncomeReceived** - - `event` **`LogIncomeReceived`**`(bytes32 _assetID, address _sender, uint _amount, bytes32 _note)` - - Parameters:`_assetID` - bytes32`_sender` - address`_amount` - uint`_note` - bytes32 - -* **LogIncomeWithdrawl** - - `event` **`LogIncomeWithdrawl`**`(address _funder, uint _amount)` - - Parameters:`_funder` - address`_amount` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **atStage** - - `modifier` **`atStage`**`(bytes32 _assetID, uint _stage)` - - Parameters:`_assetID` - bytes32`_stage` - uint - -* **onlyApproved** - - `modifier` **`onlyApproved`**`(uint8 _accessLevel)` - - Parameters:`_accessLevel` - uint8 - -* **requiresEther** - - `modifier` **`requiresEther`**`()` - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **batchWithdraw** - - `function` **`batchWithdraw`**`(bytes32[] _assetIDs) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#whenNotPaused)Parameters:`_assetIDs` - bytes32\[\]Returns:bool - -* **destroy** - - `function` **`destroy`**`(address _functionInitiator, address _holdingAddress) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#anyOwner)Parameters:`_functionInitiator` - address`_holdingAddress` - address - -* **distributeStakingShare** - - `function` **`distributeStakingShare`**`(bytes32 _assetID, uint _managerAmount) internal returns (bool)` - - Parameters:`_assetID` - bytes32`_managerAmount` - uintReturns:bool - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fallback** - - `function () public` - -* **receiveIncome** - - `function` **`receiveIncome`**`(bytes32 _assetID, bytes32 _note) external payable returns (bool)` - - Modifiers:[requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#requiresEther) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#atStage)Parameters:`_assetID` - bytes32`_note` - bytes32Returns:bool - -* **setManagerIncome** - - `function` **`setManagerIncome`**`(address _manager, uint _managerAmount) internal returns (bool)` - - Parameters:`_manager` - address`_managerAmount` - uintReturns:bool - -* **withdraw** - - `function` **`withdraw`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#whenNotPaused)Parameters:`_assetID` - bytes32Returns:bool - -* **withdrawManagerIncome** - - `function` **`withdrawManagerIncome`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetBank.html#atStage)Parameters:`_assetID` - bytes32Returns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_assetcreation.md b/docgen/docs/api_alphacontracts_contracts_assetcreation.md deleted file mode 100644 index 0fc2e9fb..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assetcreation.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -id: alphacontracts_contracts_AssetCreation -title: AssetCreation ---- - -# api\_alphacontracts\_contracts\_AssetCreation - -## contract AssetCreation - -Source: [alphacontracts/contracts/AssetCreation.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetCreation.sol) - -## Index - -* [LogAssetFundingStarted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogAssetFundingStarted) -* [LogAssetRemoved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogAssetRemoved) -* [LogDestruction](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogDestruction) -* [LogFundingPercentageChanged](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogFundingPercentageChanged) -* [LogFundingTimeChanged](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogFundingTimeChanged) -* [LogLockAssetEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#LogLockAssetEscrow) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#anyOwner) -* [changeFundingPercentages](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#changeFundingPercentages) -* [changeFundingTime](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#changeFundingTime) -* [destroy](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#destroy) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html) -* [lockAssetEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#lockAssetEscrow) -* [newAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#newAsset) -* [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#noEmptyBytes) -* [notZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#notZero) -* [removeAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#removeAsset) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#whenNotPaused) - -## Reference - -### Events - -* **LogAssetFundingStarted** - - `event` **`LogAssetFundingStarted`**`(bytes32 _assetID, bytes32 _installerID, bytes32 _assetType, bytes32 _ipfsHash)` - - Parameters:`_assetID` - bytes32`_installerID` - bytes32`_assetType` - bytes32`_ipfsHash` - bytes32 - -* **LogAssetRemoved** - - `event` **`LogAssetRemoved`**`(bytes32 _assetID, address _remover)` - - Parameters:`_assetID` - bytes32`_remover` - address - -* **LogDestruction** - - `event` **`LogDestruction`**`(address _locationSent, uint _amountSent, address _caller)` - - Parameters:`_locationSent` - address`_amountSent` - uint`_caller` - address - -* **LogFundingPercentageChanged** - - `event` **`LogFundingPercentageChanged`**`(uint _myBitFoundationPercentage, uint _installerPercentage)` - - Parameters:`_myBitFoundationPercentage` - uint`_installerPercentage` - uint - -* **LogFundingTimeChanged** - - `event` **`LogFundingTimeChanged`**`(address _sender, uint _newTimeForFunding)` - - Parameters:`_sender` - address`_newTimeForFunding` - uint - -* **LogLockAssetEscrow** - - `event` **`LogLockAssetEscrow`**`(address _from, bytes32 _assetID, uint _amountOf)` - - Parameters:`_from` - address`_assetID` - bytes32`_amountOf` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **noEmptyBytes** - - `modifier` **`noEmptyBytes`**`(bytes32 _data)` - - Parameters:`_data` - bytes32 - -* **notZero** - - `modifier` **`notZero`**`(uint _uint)` - - Parameters:`_uint` - uint - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **changeFundingPercentages** - - `function` **`changeFundingPercentages`**`(uint _myBitFoundationPercentage, uint _installerPercentage, address _functionSigner) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#anyOwner) [notZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#notZero) [notZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#notZero)Parameters:`_myBitFoundationPercentage` - uint`_installerPercentage` - uint`_functionSigner` - addressReturns:bool - -* **changeFundingTime** - - `function` **`changeFundingTime`**`(uint _newTimeGivenForFunding) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#anyOwner) [notZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#notZero)Parameters:`_newTimeGivenForFunding` - uintReturns:bool - -* **destroy** - - `function` **`destroy`**`(address _functionInitiator, address _holdingAddress) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#anyOwner)Parameters:`_functionInitiator` - address`_holdingAddress` - address - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **lockAssetEscrow** - - `function` **`lockAssetEscrow`**`(bytes32 _assetID, uint _amountToEscrow, address _escrowDepositer) internal returns (bool)` - - Parameters:`_assetID` - bytes32`_amountToEscrow` - uint`_escrowDepositer` - addressReturns:bool - -* **newAsset** - - `function` **`newAsset`**`(uint _amountToBeRaised, uint _managerPercentage, uint _amountToEscrow, bytes32 _installerID, bytes32 _assetType, uint _blockAtCreation, bytes32 _ipfsHash) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#whenNotPaused) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#noEmptyBytes) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#noEmptyBytes) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#noEmptyBytes)Parameters:`_amountToBeRaised` - uint`_managerPercentage` - uint`_amountToEscrow` - uint`_installerID` - bytes32`_assetType` - bytes32`_blockAtCreation` - uint`_ipfsHash` - bytes32Returns:bool - -* **removeAsset** - - `function` **`removeAsset`**`(bytes32 _assetID, address _functionSigner) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#anyOwner) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#noEmptyBytes) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetCreation.html#whenNotPaused)Parameters:`_assetID` - bytes32`_functionSigner` - addressReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_assetexchange.md b/docgen/docs/api_alphacontracts_contracts_assetexchange.md deleted file mode 100644 index 08eabcfd..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assetexchange.md +++ /dev/null @@ -1,194 +0,0 @@ ---- -id: alphacontracts_contracts_AssetExchange -title: AssetExchange ---- - -# api\_alphacontracts\_contracts\_AssetExchange - -## contract AssetExchange - -Source: [alphacontracts/contracts/AssetExchange.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetExchange.sol) - -## Index - -* [LogBuyOrderCompleted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogBuyOrderCompleted) -* [LogBuyOrderCreated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogBuyOrderCreated) -* [LogBuyOrderDetails](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogBuyOrderDetails) -* [LogDestruction](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogDestruction) -* [LogSellOrderCompleted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogSellOrderCompleted) -* [LogSellOrderCreated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogSellOrderCreated) -* [LogSellOrderDetails](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogSellOrderDetails) -* [LogownershipUnitsTraded](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#LogownershipUnitsTraded) -* [aboveZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#aboveZero) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#anyOwner) -* [buyAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#buyAsset) -* [createBuyOrder](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#createBuyOrder) -* [createSellOrder](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#createSellOrder) -* [deleteOrder](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#deleteOrder) -* [destroy](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#destroy) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html) -* [getAmountOwed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#getAmountOwed) -* [hasEnoughOwnership](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#hasEnoughOwnership) -* [onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved) -* [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#requiresEther) -* [sellAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#sellAsset) -* [tradeOwnershipUnits](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#tradeOwnershipUnits) -* [validAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#validAsset) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#whenNotPaused) -* [withdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#withdraw) - -## Reference - -### Events - -* **LogBuyOrderCompleted** - - `event` **`LogBuyOrderCompleted`**`(bytes32 _orderID, bytes32 _assetAddress, address _purchaser)` - - Parameters:`_orderID` - bytes32`_assetAddress` - bytes32`_purchaser` - address - -* **LogBuyOrderCreated** - - `event` **`LogBuyOrderCreated`**`(bytes32 _orderID, bytes32 _assetID, address _creator)` - - Parameters:`_orderID` - bytes32`_assetID` - bytes32`_creator` - address - -* **LogBuyOrderDetails** - - `event` **`LogBuyOrderDetails`**`(bytes32 _orderID, uint _amount, uint _price)` - - Parameters:`_orderID` - bytes32`_amount` - uint`_price` - uint - -* **LogDestruction** - - `event` **`LogDestruction`**`(address _locationSent, uint _amountSent, address _caller)` - - Parameters:`_locationSent` - address`_amountSent` - uint`_caller` - address - -* **LogSellOrderCompleted** - - `event` **`LogSellOrderCompleted`**`(bytes32 _orderID, bytes32 _assetAddress, address _purchaser)` - - Parameters:`_orderID` - bytes32`_assetAddress` - bytes32`_purchaser` - address - -* **LogSellOrderCreated** - - `event` **`LogSellOrderCreated`**`(bytes32 _orderID, bytes32 _assetAddress, address _creator)` - - Parameters:`_orderID` - bytes32`_assetAddress` - bytes32`_creator` - address - -* **LogSellOrderDetails** - - `event` **`LogSellOrderDetails`**`(bytes32 orderID, uint _amount, uint _price)` - - Parameters:`orderID` - bytes32`_amount` - uint`_price` - uint - -* **LogownershipUnitsTraded** - - `event` **`LogownershipUnitsTraded`**`(bytes32 _assetID, address _from, address _to, uint _amount)` - - Parameters:`_assetID` - bytes32`_from` - address`_to` - address`_amount` - uint - -### Modifiers - -* **aboveZero** - - `modifier` **`aboveZero`**`(uint _amount, uint _price)` - - Parameters:`_amount` - uint`_price` - uint - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **hasEnoughOwnership** - - `modifier` **`hasEnoughOwnership`**`(bytes32 _assetID, uint _requiredOwnership)` - - Parameters:`_assetID` - bytes32`_requiredOwnership` - uint - -* **onlyApproved** - - `modifier` **`onlyApproved`**`()` - -* **requiresEther** - - `modifier` **`requiresEther`**`()` - -* **validAsset** - - `modifier` **`validAsset`**`(bytes32 _assetID)` - - Parameters:`_assetID` - bytes32 - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **buyAsset** - - `function` **`buyAsset`**`(bytes32 _assetID, address _seller, uint _amount, uint _price) external payable returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#whenNotPaused) [onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved)Parameters:`_assetID` - bytes32`_seller` - address`_amount` - uint`_price` - uintReturns:bool - -* **createBuyOrder** - - `function` **`createBuyOrder`**`(bytes32 _assetID, uint _amount, uint _price) external payable returns (bool)` - - Modifiers:[onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved) [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#requiresEther) [aboveZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#aboveZero) [validAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#validAsset)Parameters:`_assetID` - bytes32`_amount` - uint`_price` - uintReturns:bool - -* **createSellOrder** - - `function` **`createSellOrder`**`(bytes32 _assetID, uint _amount, uint _price) external returns (bool)` - - Modifiers:[onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved) [aboveZero](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#aboveZero) [validAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#validAsset) [hasEnoughOwnership](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#hasEnoughOwnership)Parameters:`_assetID` - bytes32`_amount` - uint`_price` - uintReturns:bool - -* **deleteOrder** - - `function` **`deleteOrder`**`(bytes32 _assetID, uint _amount, uint _price, bool _buyOrder) external returns (bool)` - - Modifiers:[onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved)Parameters:`_assetID` - bytes32`_amount` - uint`_price` - uint`_buyOrder` - boolReturns:bool - -* **destroy** - - `function` **`destroy`**`(address _functionInitiator, address _holdingAddress) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#anyOwner)Parameters:`_functionInitiator` - address`_holdingAddress` - address - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fallback** - - `function () external` - -* **getAmountOwed** - - `function` **`getAmountOwed`**`(bytes32 _assetID, address _user) public view returns (uint)` - - Parameters:`_assetID` - bytes32`_user` - addressReturns:uint - -* **sellAsset** - - `function` **`sellAsset`**`(bytes32 _assetID, address _buyer, uint _amount, uint _price) public returns (bool)` - - Modifiers:[onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#whenNotPaused)Parameters:`_assetID` - bytes32`_buyer` - address`_amount` - uint`_price` - uintReturns:bool - -* **tradeOwnershipUnits** - - `function` **`tradeOwnershipUnits`**`(bytes32 _assetID, address _from, address _to, uint _amount) internal returns (bool)` - - Parameters:`_assetID` - bytes32`_from` - address`_to` - address`_amount` - uintReturns:bool - -* **withdraw** - - `function` **`withdraw`**`() external returns (bool)` - - Modifiers:[onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#onlyApproved) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetExchange.html#whenNotPaused)Returns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_assetmanager.md b/docgen/docs/api_alphacontracts_contracts_assetmanager.md deleted file mode 100644 index ab524c39..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assetmanager.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: alphacontracts_contracts_AssetManager -title: AssetManager ---- - -# api\_alphacontracts\_contracts\_AssetManager - -## contract AssetManager - -Source: [alphacontracts/contracts/AssetManager.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetManager.sol) - -## Index - -* [LogAssetManagerReplaced](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#LogAssetManagerReplaced) -* [LogEscrowUnlocked](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#LogEscrowUnlocked) -* [accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#accessApproved) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#anyOwner) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html) -* [releaseEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#releaseEscrow) -* [replaceAssetManager](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#replaceAssetManager) -* [unlockEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#unlockEscrow) - -## Reference - -### Events - -* **LogAssetManagerReplaced** - - `event` **`LogAssetManagerReplaced`**`(bytes32 _assetID, address oldAssetManager, address _newManager)` - - Parameters:`_assetID` - bytes32`oldAssetManager` - address`_newManager` - address - -* **LogEscrowUnlocked** - - `event` **`LogEscrowUnlocked`**`(bytes32 _assetID, address _user, uint _amount)` - - Parameters:`_assetID` - bytes32`_user` - address`_amount` - uint - -### Modifiers - -* **accessApproved** - - `modifier` **`accessApproved`**`(uint _accessLevel)` - - Parameters:`_accessLevel` - uint - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -### Functions - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **releaseEscrow** - - `function` **`releaseEscrow`**`(bytes32 _assetID, address _user, uint _amount) internal` - - Parameters:`_assetID` - bytes32`_user` - address`_amount` - uint - -* **replaceAssetManager** - - `function` **`replaceAssetManager`**`(address _newManager, bytes32 _assetID) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#anyOwner)Parameters:`_newManager` - address`_assetID` - bytes32Returns:bool - -* **unlockEscrow** - - `function` **`unlockEscrow`**`(bytes32 _assetID) external` - - Modifiers:[accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetManager.html#accessApproved)Parameters:`_assetID` - bytes32 - diff --git a/docgen/docs/api_alphacontracts_contracts_assettoken.md b/docgen/docs/api_alphacontracts_contracts_assettoken.md deleted file mode 100644 index 1519c81e..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assettoken.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken -title: AssetToken ---- - -# api\_alphacontracts\_contracts\_AssetToken - -## contract AssetToken - -is [ERC20Interface](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html)Source: [alphacontracts/contracts/AssetToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetToken.sol) - -## Index - -* [LogIncomeReceived](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#LogIncomeReceived) -* [allowance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#allowance) -* [approve](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#approve) -* [approveAndCall](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#approveAndCall) -* [balanceOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#balanceOf) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html) -* [getOwedDividends](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#getOwedDividends) -* [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#requiresEther) -* [totalSupply](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#totalSupply) -* [transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#transfer) -* [transferFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#transferFrom) -* [updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed) - -## Reference - -### Events - -* **LogIncomeReceived** - - `event` **`LogIncomeReceived`**`(address _sender, uint _paymentAmount)` - - Parameters:`_sender` - address`_paymentAmount` - uint - -### Modifiers - -* **requiresEther** - - `modifier` **`requiresEther`**`()` - -* **updateIncomeClaimed** - - `modifier` **`updateIncomeClaimed`**`(address _user)` - - Parameters:`_user` - address - -### Functions - -* **allowance** - - `function` **`allowance`**`(address _tokenHolder, address _spender) public view returns (uint)` - - Parameters:`_tokenHolder` - address`_spender` - addressReturns:uint - -* **approve** - - `function` **`approve`**`(address _spender, uint _amount) public returns (bool)` - - Parameters:`_spender` - address`_amount` - uintReturns:bool - -* **approveAndCall** - - `function` **`approveAndCall`**`(address _spender, uint _amount, bytes _data) public returns (bool)` - - Modifiers:[updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed) [updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed)Parameters:`_spender` - address`_amount` - uint`_data` - bytesReturns:bool - -* **balanceOf** - - `function` **`balanceOf`**`(address _tokenHolder) public view returns (uint)` - - Parameters:`_tokenHolder` - addressReturns:uint - -* **fallback** - - `function () public payable` - - Modifiers:[requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#requiresEther) - -* **fallback** - - `function (uint _initialAmount, string _id) public` - - Parameters:`_initialAmount` - uint`_id` - string - -* **getOwedDividends** - - `function` **`getOwedDividends`**`(address _user) public view returns (uint)` - - Parameters:`_user` - addressReturns:uint - -* **totalSupply** - - `function` **`totalSupply`**`() public view returns (uint)` - - Returns:uint - -* **transfer** - - `function` **`transfer`**`(address _to, uint _amount) public returns (bool)` - - Modifiers:[updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed) [updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed)Parameters:`_to` - address`_amount` - uintReturns:bool - -* **transferFrom** - - `function` **`transferFrom`**`(address _from, address _to, uint _amount) public returns (bool)` - - Modifiers:[updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed) [updateIncomeClaimed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken.html#updateIncomeClaimed)Parameters:`_from` - address`_to` - address`_amount` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_assettoken_approveandcallfallback.md b/docgen/docs/api_alphacontracts_contracts_assettoken_approveandcallfallback.md deleted file mode 100644 index f7ccd5bd..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assettoken_approveandcallfallback.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken_ApproveAndCallFallBack -title: ApproveAndCallFallBack ---- - -# api\_alphacontracts\_contracts\_AssetToken\_ApproveAndCallFallBack - -## contract ApproveAndCallFallBack - -Source: [alphacontracts/contracts/AssetToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetToken.sol) - -## Index - -* [receiveApproval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ApproveAndCallFallBack.html#receiveApproval) - -## Reference - -### Functions - -* **receiveApproval** - - `abstract function` **`receiveApproval`**`(address from, uint tokens, address token, bytes data) public` - - Parameters:`from` - address`tokens` - uint`token` - address`data` - bytes - diff --git a/docgen/docs/api_alphacontracts_contracts_assettoken_erc20interface.md b/docgen/docs/api_alphacontracts_contracts_assettoken_erc20interface.md deleted file mode 100644 index 3c570ccd..00000000 --- a/docgen/docs/api_alphacontracts_contracts_assettoken_erc20interface.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken_ERC20Interface -title: ERC20Interface ---- - -# api\_alphacontracts\_contracts\_AssetToken\_ERC20Interface - -## contract ERC20Interface - -Source: [alphacontracts/contracts/AssetToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/AssetToken.sol) - -## Index - -* [Approval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#Approval) -* [Transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#Transfer) -* [allowance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#allowance) -* [approve](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#approve) -* [balanceOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#balanceOf) -* [totalSupply](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#totalSupply) -* [transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#transfer) -* [transferFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_AssetToken_ERC20Interface.html#transferFrom) - -## Reference - -### Events - -* **Approval** - - `event` **`Approval`**`(address tokenOwner, address spender, uint tokens)` - - Parameters:`tokenOwner` - address`spender` - address`tokens` - uint - -* **Transfer** - - `event` **`Transfer`**`(address from, address to, uint tokens)` - - Parameters:`from` - address`to` - address`tokens` - uint - -### Functions - -* **allowance** - - `abstract function` **`allowance`**`(address tokenOwner, address spender) public view returns (uint)` - - Parameters:`tokenOwner` - address`spender` - addressReturns:uint - -* **approve** - - `abstract function` **`approve`**`(address spender, uint tokens) public returns (bool)` - - Parameters:`spender` - address`tokens` - uintReturns:bool - -* **balanceOf** - - `abstract function` **`balanceOf`**`(address tokenOwner) public view returns (uint)` - - Parameters:`tokenOwner` - addressReturns:uint - -* **totalSupply** - - `abstract function` **`totalSupply`**`() public view returns (uint)` - - Returns:uint - -* **transfer** - - `abstract function` **`transfer`**`(address to, uint tokens) public returns (bool)` - - Parameters:`to` - address`tokens` - uintReturns:bool - -* **transferFrom** - - `abstract function` **`transferFrom`**`(address from, address to, uint tokens) public returns (bool)` - - Parameters:`from` - address`to` - address`tokens` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_contractmanager.md b/docgen/docs/api_alphacontracts_contracts_contractmanager.md deleted file mode 100644 index 9d12cdbb..00000000 --- a/docgen/docs/api_alphacontracts_contracts_contractmanager.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -id: alphacontracts_contracts_ContractManager -title: ContractManager ---- - -# api\_alphacontracts\_contracts\_ContractManager - -## contract ContractManager - -Source: [alphacontracts/contracts/ContractManager.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/ContractManager.sol) - -## Index - -* [LogContractAdded](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#LogContractAdded) -* [LogContractRemoved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#LogContractRemoved) -* [LogContractUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#LogContractUpdated) -* [addContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#addContract) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#anyOwner) -* [contractExists](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#contractExists) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html) -* [multiSigRequired](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#multiSigRequired) -* [noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyAddress) -* [noEmptyString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyString) -* [removeContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#removeContract) -* [updateContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#updateContract) - -## Reference - -### Events - -* **LogContractAdded** - - `event` **`LogContractAdded`**`(address _contractAddress, string _name)` - - Parameters:`_contractAddress` - address`_name` - string - -* **LogContractRemoved** - - `event` **`LogContractRemoved`**`(address _contractToDelete, string _name)` - - Parameters:`_contractToDelete` - address`_name` - string - -* **LogContractUpdated** - - `event` **`LogContractUpdated`**`(address _oldAddress, address _newAddress, string _name)` - - Parameters:`_oldAddress` - address`_newAddress` - address`_name` - string - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **multiSigRequired** - - `modifier` **`multiSigRequired`**`(address _signer, string _functionName, bytes32 _keyParam)` - - Parameters:`_signer` - address`_functionName` - string`_keyParam` - bytes32 - -* **noEmptyAddress** - - `modifier` **`noEmptyAddress`**`(address _contract)` - - Parameters:`_contract` - address - -* **noEmptyString** - - `modifier` **`noEmptyString`**`(string _name)` - - Parameters:`_name` - string - -### Functions - -* **addContract** - - `function` **`addContract`**`(string _name, address _contractAddress, address _functionSigner) external` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyAddress) [noEmptyString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyString) [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#anyOwner)Parameters:`_name` - string`_contractAddress` - address`_functionSigner` - address - -* **contractExists** - - `function` **`contractExists`**`(address _contract) public view returns (bool)` - - Parameters:`_contract` - addressReturns:bool - -* **fallback** - - `function (address _database) public` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyAddress)Parameters:`_database` - address - -* **removeContract** - - `function` **`removeContract`**`(string _name, address _functionSigner) external` - - Modifiers:[noEmptyString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyString) [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#anyOwner)Parameters:`_name` - string`_functionSigner` - address - -* **updateContract** - - `function` **`updateContract`**`(string _name, address _newContractAddress, address _functionSigner) external` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#noEmptyAddress) [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_ContractManager.html#anyOwner)Parameters:`_name` - string`_newContractAddress` - address`_functionSigner` - address - diff --git a/docgen/docs/api_alphacontracts_contracts_database.md b/docgen/docs/api_alphacontracts_contracts_database.md deleted file mode 100644 index 2a31523b..00000000 --- a/docgen/docs/api_alphacontracts_contracts_database.md +++ /dev/null @@ -1,153 +0,0 @@ ---- -id: alphacontracts_contracts_Database -title: Database ---- - -# api\_alphacontracts\_contracts\_Database - -## contract Database - -Source: [alphacontracts/contracts/Database.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Database.sol) - -## Index - -* [LogContractManager](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#LogContractManager) -* [LogInitialized](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#LogInitialized) -* [deleteAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteAddress) -* [deleteBool](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteBool) -* [deleteBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteBytes) -* [deleteBytes32](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteBytes32) -* [deleteInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteInt) -* [deleteString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteString) -* [deleteUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#deleteUint) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html) -* [onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract) -* [setAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setAddress) -* [setBool](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setBool) -* [setBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setBytes) -* [setBytes32](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setBytes32) -* [setContractManager](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setContractManager) -* [setInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setInt) -* [setString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setString) -* [setUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#setUint) - -## Reference - -### Events - -* **LogContractManager** - - `event` **`LogContractManager`**`(address _contractManager, address _initiator)` - - Parameters:`_contractManager` - address`_initiator` - address - -* **LogInitialized** - - `event` **`LogInitialized`**`(address _ownerOne, address _ownerTwo, address _ownerThree)` - - Parameters:`_ownerOne` - address`_ownerTwo` - address`_ownerThree` - address - -### Modifiers - -* **onlyMyBitContract** - - `modifier` **`onlyMyBitContract`**`()` - -### Functions - -* **deleteAddress** - - `function` **`deleteAddress`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteBool** - - `function` **`deleteBool`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteBytes** - - `function` **`deleteBytes`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteBytes32** - - `function` **`deleteBytes32`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteInt** - - `function` **`deleteInt`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteString** - - `function` **`deleteString`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **deleteUint** - - `function` **`deleteUint`**`(bytes32 _key) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32 - -* **fallback** - - `function (address _ownerOne, address _ownerTwo, address _ownerThree) public` - - Parameters:`_ownerOne` - address`_ownerTwo` - address`_ownerThree` - address - -* **setAddress** - - `function` **`setAddress`**`(bytes32 _key, address _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - address - -* **setBool** - - `function` **`setBool`**`(bytes32 _key, bool _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - bool - -* **setBytes** - - `function` **`setBytes`**`(bytes32 _key, bytes _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - bytes - -* **setBytes32** - - `function` **`setBytes32`**`(bytes32 _key, bytes32 _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - bytes32 - -* **setContractManager** - - `function` **`setContractManager`**`(address _contractManager) external` - - Parameters:`_contractManager` - address - -* **setInt** - - `function` **`setInt`**`(bytes32 _key, int _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - int - -* **setString** - - `function` **`setString`**`(bytes32 _key, string _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - string - -* **setUint** - - `function` **`setUint`**`(bytes32 _key, uint _value) external` - - Modifiers:[onlyMyBitContract](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Database.html#onlyMyBitContract)Parameters:`_key` - bytes32`_value` - uint - diff --git a/docgen/docs/api_alphacontracts_contracts_fundinghub.md b/docgen/docs/api_alphacontracts_contracts_fundinghub.md deleted file mode 100644 index 2b69fec1..00000000 --- a/docgen/docs/api_alphacontracts_contracts_fundinghub.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -id: alphacontracts_contracts_FundingHub -title: FundingHub ---- - -# api\_alphacontracts\_contracts\_FundingHub - -## contract FundingHub - -Source: [alphacontracts/contracts/FundingHub.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/FundingHub.sol) - -## Index - -* [LogAssetFunded](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogAssetFunded) -* [LogAssetFundingFailed](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogAssetFundingFailed) -* [LogAssetFundingSuccess](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogAssetFundingSuccess) -* [LogAssetPayout](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogAssetPayout) -* [LogDestruction](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogDestruction) -* [LogNewFunder](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogNewFunder) -* [LogRefund](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#LogRefund) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#anyOwner) -* [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#atStage) -* [destroy](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#destroy) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html) -* [fund](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#fund) -* [fundingLimit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#fundingLimit) -* [fundingPeriodOver](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#fundingPeriodOver) -* [initiateRefund](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#initiateRefund) -* [nonReentrant](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#nonReentrant) -* [onlyApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#onlyApproved) -* [payout](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#payout) -* [priceUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#priceUpdated) -* [refund](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#refund) -* [requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#requiresEther) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#whenNotPaused) - -## Reference - -### Events - -* **LogAssetFunded** - - `event` **`LogAssetFunded`**`(bytes32 _assetID, address _sender, uint _amount)` - - Parameters:`_assetID` - bytes32`_sender` - address`_amount` - uint - -* **LogAssetFundingFailed** - - `event` **`LogAssetFundingFailed`**`(bytes32 _assetID, uint _amountRaised)` - - Parameters:`_assetID` - bytes32`_amountRaised` - uint - -* **LogAssetFundingSuccess** - - `event` **`LogAssetFundingSuccess`**`(bytes32 _assetID, uint _currentEthPrice, uint _amountRaised)` - - Parameters:`_assetID` - bytes32`_currentEthPrice` - uint`_amountRaised` - uint - -* **LogAssetPayout** - - `event` **`LogAssetPayout`**`(bytes32 _assetID, uint _amount)` - - Parameters:`_assetID` - bytes32`_amount` - uint - -* **LogDestruction** - - `event` **`LogDestruction`**`(address _locationSent, uint _amountSent, address _caller)` - - Parameters:`_locationSent` - address`_amountSent` - uint`_caller` - address - -* **LogNewFunder** - - `event` **`LogNewFunder`**`(bytes32 _assetID, address _funder)` - - Parameters:`_assetID` - bytes32`_funder` - address - -* **LogRefund** - - `event` **`LogRefund`**`(bytes32 _assetID, address _funder, uint _amount)` - - Parameters:`_assetID` - bytes32`_funder` - address`_amount` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **atStage** - - `modifier` **`atStage`**`(bytes32 _assetID, uint _stage)` - - Parameters:`_assetID` - bytes32`_stage` - uint - -* **fundingLimit** - - `modifier` **`fundingLimit`**`(bytes32 _assetID)` - - Parameters:`_assetID` - bytes32 - -* **fundingPeriodOver** - - `modifier` **`fundingPeriodOver`**`(bytes32 _assetID)` - - Parameters:`_assetID` - bytes32 - -* **nonReentrant** - - `modifier` **`nonReentrant`**`()` - -* **onlyApproved** - - `modifier` **`onlyApproved`**`()` - -* **priceUpdated** - - `modifier` **`priceUpdated`**`()` - -* **requiresEther** - - `modifier` **`requiresEther`**`()` - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **destroy** - - `function` **`destroy`**`(address _functionInitiator, address _holdingAddress) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#anyOwner)Parameters:`_functionInitiator` - address`_holdingAddress` - address - -* **fallback** - - `function () public` - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fund** - - `function` **`fund`**`(bytes32 _assetID) external payable returns (bool)` - - Modifiers:[requiresEther](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#requiresEther) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#whenNotPaused) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#atStage) [priceUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#priceUpdated) [fundingLimit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#fundingLimit)Parameters:`_assetID` - bytes32Returns:bool - -* **initiateRefund** - - `function` **`initiateRefund`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[fundingPeriodOver](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#fundingPeriodOver) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#atStage)Parameters:`_assetID` - bytes32Returns:bool - -* **payout** - - `function` **`payout`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[nonReentrant](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#nonReentrant) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#whenNotPaused) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#atStage)Parameters:`_assetID` - bytes32Returns:bool - -* **refund** - - `function` **`refund`**`(bytes32 _assetID) external returns (bool)` - - Modifiers:[nonReentrant](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#nonReentrant) [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#whenNotPaused) [atStage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_FundingHub.html#atStage)Parameters:`_assetID` - bytes32Returns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_hashfunctions.md b/docgen/docs/api_alphacontracts_contracts_hashfunctions.md deleted file mode 100644 index 33c49dc9..00000000 --- a/docgen/docs/api_alphacontracts_contracts_hashfunctions.md +++ /dev/null @@ -1,156 +0,0 @@ ---- -id: alphacontracts_contracts_HashFunctions -title: HashFunctions ---- - -# api\_alphacontracts\_contracts\_HashFunctions - -## contract HashFunctions - -Source: [alphacontracts/contracts/HashFunctions.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/HashFunctions.sol) - -## Index - -* [addressHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#addressHash) -* [addressUintUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#addressUintUint) -* [contractHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#contractHash) -* [currentTime](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#currentTime) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html) -* [getAuthorizeHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#getAuthorizeHash) -* [getOrderID](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#getOrderID) -* [getStakingID](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#getStakingID) -* [nullAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#nullAddress) -* [nullBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#nullBytes) -* [stringAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringAddress) -* [stringBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringBytes) -* [stringBytesAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringBytesAddress) -* [stringHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringHash) -* [stringString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringString) -* [stringUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#stringUint) -* [toBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#toBytes) -* [uintHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#uintHash) -* [uintUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#uintUint) -* [uintUintUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_HashFunctions.html#uintUintUint) - -## Reference - -### Functions - -* **addressHash** - - `function` **`addressHash`**`(address _param) external pure returns (bytes32)` - - Parameters:`_param` - addressReturns:bytes32 - -* **addressUintUint** - - `function` **`addressUintUint`**`(address _param, uint _paramTwo, uint _paramThree) external pure returns (bytes32)` - - Parameters:`_param` - address`_paramTwo` - uint`_paramThree` - uintReturns:bytes32 - -* **contractHash** - - `function` **`contractHash`**`(string _name) external pure returns (bytes32)` - - Parameters:`_name` - stringReturns:bytes32 - -* **currentTime** - - `function` **`currentTime`**`() external view returns (uint)` - - Returns:uint - -* **fallback** - - `function () public` - -* **getAuthorizeHash** - - `function` **`getAuthorizeHash`**`(address _contractAddress, address _owner, string _fnName, bytes32 _recipient) external pure returns (bytes32)` - - Parameters:`_contractAddress` - address`_owner` - address`_fnName` - string`_recipient` - bytes32Returns:bytes32 - -* **getOrderID** - - `function` **`getOrderID`**`(bytes _assetID, address _user, uint _amount, uint _price, bool _buyOrder) external pure returns (bytes32)` - - Parameters:`_assetID` - bytes`_user` - address`_amount` - uint`_price` - uint`_buyOrder` - boolReturns:bytes32 - -* **getStakingID** - - `function` **`getStakingID`**`(address _staker, uint256 _blockNumber, uint256 _amount) external pure returns (bytes32)` - - Parameters:`_staker` - address`_blockNumber` - uint256`_amount` - uint256Returns:bytes32 - -* **nullAddress** - - `function` **`nullAddress`**`() external pure returns (address)` - - Returns:address - -* **nullBytes** - - `function` **`nullBytes`**`() external pure returns (bytes32)` - - Returns:bytes32 - -* **stringAddress** - - `function` **`stringAddress`**`(string _param, address _paramTwo) external pure returns (bytes32)` - - Parameters:`_param` - string`_paramTwo` - addressReturns:bytes32 - -* **stringBytes** - - `function` **`stringBytes`**`(string _param, bytes32 _paramTwo) external pure returns (bytes32)` - - Parameters:`_param` - string`_paramTwo` - bytes32Returns:bytes32 - -* **stringBytesAddress** - - `function` **`stringBytesAddress`**`(string _param, bytes32 _paramTwo, address _paramThree) external pure returns (bytes32)` - - Parameters:`_param` - string`_paramTwo` - bytes32`_paramThree` - addressReturns:bytes32 - -* **stringHash** - - `function` **`stringHash`**`(string _name) external pure returns (bytes32)` - - Parameters:`_name` - stringReturns:bytes32 - -* **stringString** - - `function` **`stringString`**`(string _param, string _paramTwo) external pure returns (bytes32)` - - Parameters:`_param` - string`_paramTwo` - stringReturns:bytes32 - -* **stringUint** - - `function` **`stringUint`**`(string _param, uint _paramTwo) external pure returns (bytes32)` - - Parameters:`_param` - string`_paramTwo` - uintReturns:bytes32 - -* **toBytes** - - `function` **`toBytes`**`(uint x) external pure returns (bytes)` - - Parameters:`x` - uintReturns:bytes - -* **uintHash** - - `function` **`uintHash`**`(uint _param) external pure returns (bytes32)` - - Parameters:`_param` - uintReturns:bytes32 - -* **uintUint** - - `function` **`uintUint`**`(uint _paramOne, uint _paramTwo) external pure returns (bytes32)` - - Parameters:`_paramOne` - uint`_paramTwo` - uintReturns:bytes32 - -* **uintUintUint** - - `function` **`uintUintUint`**`(uint _paramOne, uint _paramTwo, uint _paramThree) external pure returns (bytes32)` - - Parameters:`_paramOne` - uint`_paramTwo` - uint`_paramThree` - uintReturns:bytes32 - diff --git a/docgen/docs/api_alphacontracts_contracts_initialvariables.md b/docgen/docs/api_alphacontracts_contracts_initialvariables.md deleted file mode 100644 index b9b87465..00000000 --- a/docgen/docs/api_alphacontracts_contracts_initialvariables.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -id: alphacontracts_contracts_InitialVariables -title: InitialVariables ---- - -# api\_alphacontracts\_contracts\_InitialVariables - -## contract InitialVariables - -Source: [alphacontracts/contracts/InitialVariables.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/InitialVariables.sol) - -## Index - -* [LogInitialized](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#LogInitialized) -* [LogPriceUpdate](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#LogPriceUpdate) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner) -* [changeAccessTokenFee](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#changeAccessTokenFee) -* [changeFoundationAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#changeFoundationAddress) -* [changeInstallerEscrowAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#changeInstallerEscrowAddress) -* [changePriceUpdateTimeline](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#changePriceUpdateTimeline) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html) -* [multiSigRequired](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#multiSigRequired) -* [noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#noEmptyAddress) -* [setDailyPrices](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#setDailyPrices) -* [startDapp](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#startDapp) - -## Reference - -### Events - -* **LogInitialized** - - `event` **`LogInitialized`**`(address _sender, address _database)` - - Parameters:`_sender` - address`_database` - address - -* **LogPriceUpdate** - - `event` **`LogPriceUpdate`**`(uint _oldETHPrice, uint _oldMYBPrice)` - - Parameters:`_oldETHPrice` - uint`_oldMYBPrice` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **multiSigRequired** - - `modifier` **`multiSigRequired`**`(address _signer, string _functionName, bytes32 _keyParam)` - - Parameters:`_signer` - address`_functionName` - string`_keyParam` - bytes32 - -* **noEmptyAddress** - - `modifier` **`noEmptyAddress`**`(address _contract)` - - Parameters:`_contract` - address - -### Functions - -* **changeAccessTokenFee** - - `function` **`changeAccessTokenFee`**`(address _signer, string _functionName, uint _accessLevel, uint _newPrice) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner) [multiSigRequired](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#multiSigRequired)Parameters:`_signer` - address`_functionName` - string`_accessLevel` - uint`_newPrice` - uintReturns:bool - -* **changeFoundationAddress** - - `function` **`changeFoundationAddress`**`(address _signer, string _functionName, address _newAddress) external returns (bool)` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#noEmptyAddress) [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner) [multiSigRequired](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#multiSigRequired)Parameters:`_signer` - address`_functionName` - string`_newAddress` - addressReturns:bool - -* **changeInstallerEscrowAddress** - - `function` **`changeInstallerEscrowAddress`**`(address _signer, string _functionName, address _newAddress) external returns (bool)` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#noEmptyAddress) [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner) [multiSigRequired](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#multiSigRequired)Parameters:`_signer` - address`_functionName` - string`_newAddress` - addressReturns:bool - -* **changePriceUpdateTimeline** - - `function` **`changePriceUpdateTimeline`**`(uint _newPriceExpiration) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner)Parameters:`_newPriceExpiration` - uintReturns:bool - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **setDailyPrices** - - `function` **`setDailyPrices`**`(uint _ethPrice, uint _mybPrice) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_InitialVariables.html#anyOwner)Parameters:`_ethPrice` - uint`_mybPrice` - uintReturns:bool - -* **startDapp** - - `function` **`startDapp`**`(address _myBitFoundation, address _installerEscrow) external` - - Parameters:`_myBitFoundation` - address`_installerEscrow` - address - diff --git a/docgen/docs/api_alphacontracts_contracts_migrations.md b/docgen/docs/api_alphacontracts_contracts_migrations.md deleted file mode 100644 index 6cf27150..00000000 --- a/docgen/docs/api_alphacontracts_contracts_migrations.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: alphacontracts_contracts_Migrations -title: Migrations ---- - -# api\_alphacontracts\_contracts\_Migrations - -## contract Migrations - -Source: [alphacontracts/contracts/Migrations.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Migrations.sol) - -## Index - -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html) -* [restricted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html#restricted) -* [setCompleted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html#setCompleted) -* [upgrade](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html#upgrade) - -## Reference - -### Modifiers - -* **restricted** - - `modifier` **`restricted`**`()` - -### Functions - -* **fallback** - - `function () public` - -* **setCompleted** - - `function` **`setCompleted`**`(uint completed) public` - - Modifiers:[restricted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html#restricted)Parameters:`completed` - uint - -* **upgrade** - - `function` **`upgrade`**`(address new_address) public` - - Modifiers:[restricted](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Migrations.html#restricted)Parameters:`new_address` - address - diff --git a/docgen/docs/api_alphacontracts_contracts_mybittoken.md b/docgen/docs/api_alphacontracts_contracts_mybittoken.md deleted file mode 100644 index b51165cf..00000000 --- a/docgen/docs/api_alphacontracts_contracts_mybittoken.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken -title: MyBitToken ---- - -# api\_alphacontracts\_contracts\_MyBitToken - -## contract MyBitToken - -is [ERC20Interface](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html)Source: [alphacontracts/contracts/MyBitToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/MyBitToken.sol) - -## Index - -* [LogBurn](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#LogBurn) -* [allowance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#allowance) -* [approve](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#approve) -* [approveAndCall](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#approveAndCall) -* [balanceOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#balanceOf) -* [burn](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#burn) -* [burnFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#burnFrom) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html) -* [totalSupply](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#totalSupply) -* [transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#transfer) -* [transferFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken.html#transferFrom) - -## Reference - -### Events - -* **LogBurn** - - `event` **`LogBurn`**`(address _burner, uint _amountBurned)` - - Parameters:`_burner` - address`_amountBurned` - uint - -### Functions - -* **allowance** - - `function` **`allowance`**`(address _tokenHolder, address _spender) public view returns (uint)` - - Parameters:`_tokenHolder` - address`_spender` - addressReturns:uint - -* **approve** - - `function` **`approve`**`(address _spender, uint _amount) public returns (bool)` - - Parameters:`_spender` - address`_amount` - uintReturns:bool - -* **approveAndCall** - - `function` **`approveAndCall`**`(address _spender, uint _amount, bytes _data) public returns (bool)` - - Parameters:`_spender` - address`_amount` - uint`_data` - bytesReturns:bool - -* **balanceOf** - - `function` **`balanceOf`**`(address _tokenHolder) public view returns (uint)` - - Parameters:`_tokenHolder` - addressReturns:uint - -* **burn** - - `function` **`burn`**`(uint _amount) public returns (bool)` - - Parameters:`_amount` - uintReturns:bool - -* **burnFrom** - - `function` **`burnFrom`**`(address _from, uint _amount) public returns (bool)` - - Parameters:`_from` - address`_amount` - uintReturns:bool - -* **fallback** - - `function () public payable` - -* **fallback** - - `function (uint _initialAmount, string _tokenName, uint8 _decimalUnits, string _tokenSymbol) public` - - Parameters:`_initialAmount` - uint`_tokenName` - string`_decimalUnits` - uint8`_tokenSymbol` - string - -* **totalSupply** - - `function` **`totalSupply`**`() public view returns (uint)` - - Returns:uint - -* **transfer** - - `function` **`transfer`**`(address _to, uint _amount) public returns (bool)` - - Parameters:`_to` - address`_amount` - uintReturns:bool - -* **transferFrom** - - `function` **`transferFrom`**`(address _from, address _to, uint _amount) public returns (bool)` - - Parameters:`_from` - address`_to` - address`_amount` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_mybittoken_approveandcallfallback.md b/docgen/docs/api_alphacontracts_contracts_mybittoken_approveandcallfallback.md deleted file mode 100644 index 1a19036b..00000000 --- a/docgen/docs/api_alphacontracts_contracts_mybittoken_approveandcallfallback.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken_ApproveAndCallFallBack -title: ApproveAndCallFallBack ---- - -# api\_alphacontracts\_contracts\_MyBitToken\_ApproveAndCallFallBack - -## contract ApproveAndCallFallBack - -Source: [alphacontracts/contracts/MyBitToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/MyBitToken.sol) - -## Index - -* [receiveApproval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ApproveAndCallFallBack.html#receiveApproval) - -## Reference - -### Functions - -* **receiveApproval** - - `abstract function` **`receiveApproval`**`(address from, uint tokens, address token, bytes data) public` - - Parameters:`from` - address`tokens` - uint`token` - address`data` - bytes - diff --git a/docgen/docs/api_alphacontracts_contracts_mybittoken_erc20interface.md b/docgen/docs/api_alphacontracts_contracts_mybittoken_erc20interface.md deleted file mode 100644 index 7fb98994..00000000 --- a/docgen/docs/api_alphacontracts_contracts_mybittoken_erc20interface.md +++ /dev/null @@ -1,76 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken_ERC20Interface -title: ERC20Interface ---- - -# api\_alphacontracts\_contracts\_MyBitToken\_ERC20Interface - -## contract ERC20Interface - -Source: [alphacontracts/contracts/MyBitToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/MyBitToken.sol) - -## Index - -* [Approval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#Approval) -* [Transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#Transfer) -* [allowance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#allowance) -* [approve](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#approve) -* [balanceOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#balanceOf) -* [totalSupply](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#totalSupply) -* [transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#transfer) -* [transferFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_MyBitToken_ERC20Interface.html#transferFrom) - -## Reference - -### Events - -* **Approval** - - `event` **`Approval`**`(address tokenOwner, address spender, uint tokens)` - - Parameters:`tokenOwner` - address`spender` - address`tokens` - uint - -* **Transfer** - - `event` **`Transfer`**`(address from, address to, uint tokens)` - - Parameters:`from` - address`to` - address`tokens` - uint - -### Functions - -* **allowance** - - `abstract function` **`allowance`**`(address tokenOwner, address spender) public view returns (uint)` - - Parameters:`tokenOwner` - address`spender` - addressReturns:uint - -* **approve** - - `abstract function` **`approve`**`(address spender, uint tokens) public returns (bool)` - - Parameters:`spender` - address`tokens` - uintReturns:bool - -* **balanceOf** - - `abstract function` **`balanceOf`**`(address tokenOwner) public view returns (uint)` - - Parameters:`tokenOwner` - addressReturns:uint - -* **totalSupply** - - `abstract function` **`totalSupply`**`() public view returns (uint)` - - Returns:uint - -* **transfer** - - `abstract function` **`transfer`**`(address to, uint tokens) public returns (bool)` - - Parameters:`to` - address`tokens` - uintReturns:bool - -* **transferFrom** - - `abstract function` **`transferFrom`**`(address from, address to, uint tokens) public returns (bool)` - - Parameters:`from` - address`to` - address`tokens` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_owned.md b/docgen/docs/api_alphacontracts_contracts_owned.md deleted file mode 100644 index 8f3ba350..00000000 --- a/docgen/docs/api_alphacontracts_contracts_owned.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -id: alphacontracts_contracts_Owned -title: Owned ---- - -# api\_alphacontracts\_contracts\_Owned - -## contract Owned - -Source: [alphacontracts/contracts/Owned.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Owned.sol) - -## Index - -* [LogFunctionAuthorized](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#LogFunctionAuthorized) -* [LogOwnerChanged](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#LogOwnerChanged) -* [LogPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#LogPaused) -* [LogUnpaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#LogUnpaused) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#anyOwner) -* [changeOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#changeOwner) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html) -* [noZeroAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#noZeroAddress) -* [pause](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#pause) -* [setFunctionAuthorized](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#setFunctionAuthorized) -* [unpause](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#unpause) - -## Reference - -### Events - -* **LogFunctionAuthorized** - - `event` **`LogFunctionAuthorized`**`(address _owner, string _functionName, bytes32 _beneficiary, bytes32 _authHash)` - - Parameters:`_owner` - address`_functionName` - string`_beneficiary` - bytes32`_authHash` - bytes32 - -* **LogOwnerChanged** - - `event` **`LogOwnerChanged`**`(address _previousOwner, address _newOwner)` - - Parameters:`_previousOwner` - address`_newOwner` - address - -* **LogPaused** - - `event` **`LogPaused`**`(address _contract)` - - Parameters:`_contract` - address - -* **LogUnpaused** - - `event` **`LogUnpaused`**`(address _contract)` - - Parameters:`_contract` - address - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **noZeroAddress** - - `modifier` **`noZeroAddress`**`(address _param)` - - Parameters:`_param` - address - -### Functions - -* **changeOwner** - - `function` **`changeOwner`**`(address _newOwner, address _oldOwner, address _functionSigner) external` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#anyOwner) [noZeroAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#noZeroAddress) [noZeroAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#noZeroAddress)Parameters:`_newOwner` - address`_oldOwner` - address`_functionSigner` - address - -* **fallback** - - `function (address _database) public` - - Modifiers:[noZeroAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#noZeroAddress)Parameters:`_database` - address - -* **pause** - - `function` **`pause`**`(address _contract) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#anyOwner) [noZeroAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#noZeroAddress)Parameters:`_contract` - address - -* **setFunctionAuthorized** - - `function` **`setFunctionAuthorized`**`(address _contractAddress, string _functionName, bytes32 _beneficiary) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#anyOwner)Parameters:`_contractAddress` - address`_functionName` - string`_beneficiary` - bytes32Returns:bool - -* **unpause** - - `function` **`unpause`**`(address _contract) public` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Owned.html#anyOwner)Parameters:`_contract` - address - diff --git a/docgen/docs/api_alphacontracts_contracts_safemath.md b/docgen/docs/api_alphacontracts_contracts_safemath.md deleted file mode 100644 index 6dbebdde..00000000 --- a/docgen/docs/api_alphacontracts_contracts_safemath.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -id: alphacontracts_contracts_SafeMath -title: SafeMath ---- - -# api\_alphacontracts\_contracts\_SafeMath - -## library SafeMath - -Source: [alphacontracts/contracts/SafeMath.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/SafeMath.sol) - -## Index - -* [add](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#add) -* [bytesToUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#bytesToUint) -* [div](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#div) -* [getFractionalAmount](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#getFractionalAmount) -* [mul](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#mul) -* [sub](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_SafeMath.html#sub) - -## Reference - -### Functions - -* **add** - - `function` **`add`**`(uint256 a, uint256 b) internal pure returns (uint256)` - - Parameters:`a` - uint256`b` - uint256Returns:uint256 - -* **bytesToUint** - - `function` **`bytesToUint`**`(bytes b) internal pure returns (uint256)` - - Parameters:`b` - bytesReturns:uint256 - -* **div** - - `function` **`div`**`(uint256 a, uint256 b) internal pure returns (uint256)` - - Parameters:`a` - uint256`b` - uint256Returns:uint256 - -* **getFractionalAmount** - - `function` **`getFractionalAmount`**`(uint256 _amount, uint256 _percentage) internal pure returns (uint256)` - - Parameters:`_amount` - uint256`_percentage` - uint256Returns:uint256 - -* **mul** - - `function` **`mul`**`(uint256 a, uint256 b) internal pure returns (uint256)` - - Parameters:`a` - uint256`b` - uint256Returns:uint256 - -* **sub** - - `function` **`sub`**`(uint256 a, uint256 b) internal pure returns (uint256)` - - Parameters:`a` - uint256`b` - uint256Returns:uint256 - diff --git a/docgen/docs/api_alphacontracts_contracts_staking.md b/docgen/docs/api_alphacontracts_contracts_staking.md deleted file mode 100644 index 70dfaafa..00000000 --- a/docgen/docs/api_alphacontracts_contracts_staking.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -id: alphacontracts_contracts_Staking -title: Staking ---- - -# api\_alphacontracts\_contracts\_Staking - -## contract Staking - -Source: [alphacontracts/contracts/Staking.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Staking.sol) - -## Index - -* [LogEscrowRequestedP1](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#LogEscrowRequestedP1) -* [LogEscrowRequestedP2](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#LogEscrowRequestedP2) -* [LogEscrowRequester](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#LogEscrowRequester) -* [LogEscrowStaked](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#LogEscrowStaked) -* [accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#accessApproved) -* [approveEscrowLending](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#approveEscrowLending) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html) -* [lockAssetEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#lockAssetEscrow) -* [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#noEmptyBytes) -* [requestEscrowLending](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#requestEscrowLending) - -## Reference - -### Events - -* **LogEscrowRequestedP1** - - `event` **`LogEscrowRequestedP1`**`(uint _amount, uint _incomeShare, uint _managerPercentage)` - - Parameters:`_amount` - uint`_incomeShare` - uint`_managerPercentage` - uint - -* **LogEscrowRequestedP2** - - `event` **`LogEscrowRequestedP2`**`(uint _amountToBeRaised, bytes32 _assetType, bytes32 _installerID)` - - Parameters:`_amountToBeRaised` - uint`_assetType` - bytes32`_installerID` - bytes32 - -* **LogEscrowRequester** - - `event` **`LogEscrowRequester`**`(address _assetManager, bytes32 _escrowID, uint _blockAtCreation)` - - Parameters:`_assetManager` - address`_escrowID` - bytes32`_blockAtCreation` - uint - -* **LogEscrowStaked** - - `event` **`LogEscrowStaked`**`(bytes32 _assetID, address _staker, uint _amountMYB)` - - Parameters:`_assetID` - bytes32`_staker` - address`_amountMYB` - uint - -### Modifiers - -* **accessApproved** - - `modifier` **`accessApproved`**`(uint _accessLevel)` - - Parameters:`_accessLevel` - uint - -* **noEmptyBytes** - - `modifier` **`noEmptyBytes`**`(bytes32 _data)` - - Parameters:`_data` - bytes32 - -### Functions - -* **approveEscrowLending** - - `function` **`approveEscrowLending`**`(address _requester, uint _amount, uint _incomeShare, uint _managerPercentage, uint _amountToBeRaised, bytes32 _installerID, bytes32 _assetType, uint256 _blockAtCreation) external returns (bool)` - - Modifiers:[accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#accessApproved)Parameters:`_requester` - address`_amount` - uint`_incomeShare` - uint`_managerPercentage` - uint`_amountToBeRaised` - uint`_installerID` - bytes32`_assetType` - bytes32`_blockAtCreation` - uint256Returns:bool - -* **fallback** - - `function (address _database, address _tokenAddress) public` - - Parameters:`_database` - address`_tokenAddress` - address - -* **lockAssetEscrow** - - `function` **`lockAssetEscrow`**`(bytes32 _assetID, uint _amountToEscrow, address _escrowDepositer) internal returns (bool)` - - Parameters:`_assetID` - bytes32`_amountToEscrow` - uint`_escrowDepositer` - addressReturns:bool - -* **requestEscrowLending** - - `function` **`requestEscrowLending`**`(uint _amount, uint _incomeShare, uint _managerPercentage, uint _amountToBeRaised, bytes32 _installerID, bytes32 _assetType) external returns (bool)` - - Modifiers:[accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#accessApproved) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#noEmptyBytes) [noEmptyBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Staking.html#noEmptyBytes)Parameters:`_amount` - uint`_incomeShare` - uint`_managerPercentage` - uint`_amountToBeRaised` - uint`_installerID` - bytes32`_assetType` - bytes32Returns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_test.md b/docgen/docs/api_alphacontracts_contracts_test.md deleted file mode 100644 index 2eadab9b..00000000 --- a/docgen/docs/api_alphacontracts_contracts_test.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -id: alphacontracts_contracts_Test -title: Test ---- - -# api\_alphacontracts\_contracts\_Test - -## contract Test - -Source: [alphacontracts/contracts/Test.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/Test.sol) - -## Index - -* [burnAccessTokens](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#burnAccessTokens) -* [createAsset](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#createAsset) -* [deposit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#deposit) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html) -* [fund](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#fund) -* [getAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#getAddress) -* [getBalance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#getBalance) -* [logpayment](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_Test.html#logpayment) - -## Reference - -### Events - -* **logpayment** - - `event` **`logpayment`**`(address _sender, uint _amount, uint _timestamp)` - - Parameters:`_sender` - address`_amount` - uint`_timestamp` - uint - -### Functions - -* **burnAccessTokens** - - `function` **`burnAccessTokens`**`(uint _accessLevel) external` - - Parameters:`_accessLevel` - uint - -* **createAsset** - - `function` **`createAsset`**`(bytes32 _assetID, uint _amountToBeRaised, uint _managerPercentage, uint _amountToEscrow, bytes32 _installerID, bytes32 _assetType, bytes32 _ipfsHash) external` - - Parameters:`_assetID` - bytes32`_amountToBeRaised` - uint`_managerPercentage` - uint`_amountToEscrow` - uint`_installerID` - bytes32`_assetType` - bytes32`_ipfsHash` - bytes32 - -* **deposit** - - `function` **`deposit`**`() public payable` - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **fallback** - - `function () public payable` - -* **fund** - - `function` **`fund`**`(bytes32 _assetID, uint _amount) external` - - Parameters:`_assetID` - bytes32`_amount` - uint - -* **getAddress** - - `function` **`getAddress`**`(string _name) public view returns (address)` - - Parameters:`_name` - stringReturns:address - -* **getBalance** - - `function` **`getBalance`**`() public view returns (uint)` - - Returns:uint - diff --git a/docgen/docs/api_alphacontracts_contracts_tokenburn.md b/docgen/docs/api_alphacontracts_contracts_tokenburn.md deleted file mode 100644 index 0fc1887e..00000000 --- a/docgen/docs/api_alphacontracts_contracts_tokenburn.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: alphacontracts_contracts_TokenBurn -title: TokenBurn ---- - -# api\_alphacontracts\_contracts\_TokenBurn - -## contract TokenBurn - -Source: [alphacontracts/contracts/TokenBurn.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/TokenBurn.sol) - -## Index - -* [LogMyBitBurnt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#LogMyBitBurnt) -* [basicVerification](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#basicVerification) -* [burnTokens](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#burnTokens) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html) -* [priceUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#priceUpdated) -* [receiveApproval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#receiveApproval) -* [whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#whenNotPaused) - -## Reference - -### Events - -* **LogMyBitBurnt** - - `event` **`LogMyBitBurnt`**`(address _burner, uint _amount)` - - Parameters:`_burner` - address`_amount` - uint - -### Modifiers - -* **basicVerification** - - `modifier` **`basicVerification`**`(uint _newAccessLevel)` - - Parameters:`_newAccessLevel` - uint - -* **priceUpdated** - - `modifier` **`priceUpdated`**`()` - -* **whenNotPaused** - - `modifier` **`whenNotPaused`**`()` - -### Functions - -* **burnTokens** - - `function` **`burnTokens`**`(uint _accessLevelDesired) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#whenNotPaused) [priceUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#priceUpdated) [basicVerification](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#basicVerification)Parameters:`_accessLevelDesired` - uintReturns:bool - -* **fallback** - - `function (address _database, address _myBitToken) public` - - Parameters:`_database` - address`_myBitToken` - address - -* **receiveApproval** - - `function` **`receiveApproval`**`(address _from, uint _amount, address _token, bytes _accessLevelDesired) external returns (bool)` - - Modifiers:[whenNotPaused](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#whenNotPaused) [priceUpdated](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenBurn.html#priceUpdated)Parameters:`_from` - address`_amount` - uint`_token` - address`_accessLevelDesired` - bytesReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_tokenescrow.md b/docgen/docs/api_alphacontracts_contracts_tokenescrow.md deleted file mode 100644 index 8a8119c3..00000000 --- a/docgen/docs/api_alphacontracts_contracts_tokenescrow.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -id: alphacontracts_contracts_TokenEscrow -title: TokenEscrow ---- - -# api\_alphacontracts\_contracts\_TokenEscrow - -## contract TokenEscrow - -Source: [alphacontracts/contracts/TokenEscrow.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/TokenEscrow.sol) - -## Index - -* [LogEscrowDeposited](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#LogEscrowDeposited) -* [LogEscrowWithdrawn](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#LogEscrowWithdrawn) -* [accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#accessApproved) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#anyOwner) -* [depositEscrow](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#depositEscrow) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html) -* [receiveApproval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#receiveApproval) -* [withdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#withdraw) - -## Reference - -### Events - -* **LogEscrowDeposited** - - `event` **`LogEscrowDeposited`**`(address _from, uint _amount)` - - Parameters:`_from` - address`_amount` - uint - -* **LogEscrowWithdrawn** - - `event` **`LogEscrowWithdrawn`**`(address _user, uint _amount)` - - Parameters:`_user` - address`_amount` - uint - -### Modifiers - -* **accessApproved** - - `modifier` **`accessApproved`**`(uint _accessLevel)` - - Parameters:`_accessLevel` - uint - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -### Functions - -* **depositEscrow** - - `function` **`depositEscrow`**`(uint _amount) external returns (bool)` - - Modifiers:[accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#accessApproved)Parameters:`_amount` - uintReturns:bool - -* **fallback** - - `function (address _database, address _mybittoken) public` - - Parameters:`_database` - address`_mybittoken` - address - -* **fallback** - - `function () external` - -* **receiveApproval** - - `function` **`receiveApproval`**`(address _from, uint _amount, address _token, bytes _data) external returns (bool)` - - Parameters:`_from` - address`_amount` - uint`_token` - address`_data` - bytesReturns:bool - -* **withdraw** - - `function` **`withdraw`**`(uint _amount) external returns (bool)` - - Modifiers:[accessApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenEscrow.html#accessApproved)Parameters:`_amount` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_contracts_tokenfaucet.md b/docgen/docs/api_alphacontracts_contracts_tokenfaucet.md deleted file mode 100644 index a118f1ee..00000000 --- a/docgen/docs/api_alphacontracts_contracts_tokenfaucet.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -id: alphacontracts_contracts_TokenFaucet -title: TokenFaucet ---- - -# api\_alphacontracts\_contracts\_TokenFaucet - -## contract TokenFaucet - -Source: [alphacontracts/contracts/TokenFaucet.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/TokenFaucet.sol) - -## Index - -* [LogEthDeposited](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#LogEthDeposited) -* [LogEthWithdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#LogEthWithdraw) -* [LogMYBDeposited](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#LogMYBDeposited) -* [LogNewUser](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#LogNewUser) -* [LogWithdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#LogWithdraw) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#anyOwner) -* [basicVerification](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#basicVerification) -* [changePass](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#changePass) -* [depositWEI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#depositWEI) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html) -* [receiveApproval](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#receiveApproval) -* [withdraw](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#withdraw) - -## Reference - -### Events - -* **LogEthDeposited** - - `event` **`LogEthDeposited`**`(address _depositer, uint _amountWEI)` - - Parameters:`_depositer` - address`_amountWEI` - uint - -* **LogEthWithdraw** - - `event` **`LogEthWithdraw`**`(address _withdrawer, uint _amountWEI)` - - Parameters:`_withdrawer` - address`_amountWEI` - uint - -* **LogMYBDeposited** - - `event` **`LogMYBDeposited`**`(address _depositer, uint _amount, bytes _data)` - - Parameters:`_depositer` - address`_amount` - uint`_data` - bytes - -* **LogNewUser** - - `event` **`LogNewUser`**`(address _user)` - - Parameters:`_user` - address - -* **LogWithdraw** - - `event` **`LogWithdraw`**`(address _sender, uint _amountMYB, uint _amountWEI)` - - Parameters:`_sender` - address`_amountMYB` - uint`_amountWEI` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **basicVerification** - - `modifier` **`basicVerification`**`(uint _newAccessLevel)` - - Parameters:`_newAccessLevel` - uint - -### Functions - -* **changePass** - - `function` **`changePass`**`(bytes32 _newPass) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_TokenFaucet.html#anyOwner)Parameters:`_newPass` - bytes32Returns:bool - -* **depositWEI** - - `function` **`depositWEI`**`() external payable` - -* **fallback** - - `function (address _database, address _mybTokenAddress, bytes32 _accessPass) public` - - Parameters:`_database` - address`_mybTokenAddress` - address`_accessPass` - bytes32 - -* **receiveApproval** - - `function` **`receiveApproval`**`(address _from, uint _amount, address _mybToken, bytes _data) external` - - Parameters:`_from` - address`_amount` - uint`_mybToken` - address`_data` - bytes - -* **withdraw** - - `function` **`withdraw`**`(string _pass) external` - - Parameters:`_pass` - string - diff --git a/docgen/docs/api_alphacontracts_contracts_useraccess.md b/docgen/docs/api_alphacontracts_contracts_useraccess.md deleted file mode 100644 index 06800e52..00000000 --- a/docgen/docs/api_alphacontracts_contracts_useraccess.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -id: alphacontracts_contracts_UserAccess -title: UserAccess ---- - -# api\_alphacontracts\_contracts\_UserAccess - -## contract UserAccess - -Source: [alphacontracts/contracts/UserAccess.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/contracts/UserAccess.sol) - -## Index - -* [LogKYCApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#LogKYCApproved) -* [LogUserApproved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#LogUserApproved) -* [LogUserRemoved](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#LogUserRemoved) -* [anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#anyOwner) -* [approveKYC](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#approveKYC) -* [approveUser](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#approveUser) -* [fallback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html) -* [noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#noEmptyAddress) -* [removeUser](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#removeUser) - -## Reference - -### Events - -* **LogKYCApproved** - - `event` **`LogKYCApproved`**`(address _owner, address _user)` - - Parameters:`_owner` - address`_user` - address - -* **LogUserApproved** - - `event` **`LogUserApproved`**`(address _user, uint _approvalLevel)` - - Parameters:`_user` - address`_approvalLevel` - uint - -* **LogUserRemoved** - - `event` **`LogUserRemoved`**`(address _user, uint _accessLevel)` - - Parameters:`_user` - address`_accessLevel` - uint - -### Modifiers - -* **anyOwner** - - `modifier` **`anyOwner`**`()` - -* **noEmptyAddress** - - `modifier` **`noEmptyAddress`**`(address _param)` - - Parameters:`_param` - address - -### Functions - -* **approveKYC** - - `function` **`approveKYC`**`(address _user) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#anyOwner)Parameters:`_user` - addressReturns:bool - -* **approveUser** - - `function` **`approveUser`**`(address _newUser, uint _accessLevel) external returns (bool)` - - Modifiers:[noEmptyAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#noEmptyAddress)Parameters:`_newUser` - address`_accessLevel` - uintReturns:bool - -* **fallback** - - `function (address _database) public` - - Parameters:`_database` - address - -* **removeUser** - - `function` **`removeUser`**`(address _user) external returns (bool)` - - Modifiers:[anyOwner](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_contracts_UserAccess.html#anyOwner)Parameters:`_user` - addressReturns:bool - diff --git a/docgen/docs/api_alphacontracts_interfaces_database.md b/docgen/docs/api_alphacontracts_interfaces_database.md deleted file mode 100644 index 11cbd8cc..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_database.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -id: alphacontracts_interfaces_Database -title: Database ---- - -# api\_alphacontracts\_interfaces\_Database - -## interface Database - -Source: [alphacontracts/interfaces/Database.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/interfaces/Database.sol) - -## Index - -* [addressStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#addressStorage) -* [boolStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#boolStorage) -* [bytes32Storage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#bytes32Storage) -* [bytesStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#bytesStorage) -* [deleteAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteAddress) -* [deleteBool](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteBool) -* [deleteBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteBytes) -* [deleteBytes32](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteBytes32) -* [deleteInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteInt) -* [deleteString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteString) -* [deleteUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#deleteUint) -* [intStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#intStorage) -* [setAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setAddress) -* [setBool](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setBool) -* [setBytes](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setBytes) -* [setBytes32](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setBytes32) -* [setContractManager](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setContractManager) -* [setInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setInt) -* [setString](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setString) -* [setUint](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#setUint) -* [stringStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#stringStorage) -* [uintStorage](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_Database.html#uintStorage) - -## Reference - -### Functions - -* **addressStorage** - - `abstract function` **`addressStorage`**`(bytes32 _key) external returns (address)` - - Parameters:`_key` - bytes32Returns:address - -* **boolStorage** - - `abstract function` **`boolStorage`**`(bytes32 _key) external returns (bool)` - - Parameters:`_key` - bytes32Returns:bool - -* **bytes32Storage** - - `abstract function` **`bytes32Storage`**`(bytes32 _key) external returns (bytes32)` - - Parameters:`_key` - bytes32Returns:bytes32 - -* **bytesStorage** - - `abstract function` **`bytesStorage`**`(bytes32 _key) external returns (bytes)` - - Parameters:`_key` - bytes32Returns:bytes - -* **deleteAddress** - - `abstract function` **`deleteAddress`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteBool** - - `abstract function` **`deleteBool`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteBytes** - - `abstract function` **`deleteBytes`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteBytes32** - - `abstract function` **`deleteBytes32`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteInt** - - `abstract function` **`deleteInt`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteString** - - `abstract function` **`deleteString`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **deleteUint** - - `abstract function` **`deleteUint`**`(bytes32 _key) external` - - Parameters:`_key` - bytes32 - -* **intStorage** - - `abstract function` **`intStorage`**`(bytes32 _key) external returns (bool)` - - Parameters:`_key` - bytes32Returns:bool - -* **setAddress** - - `abstract function` **`setAddress`**`(bytes32 _key, address _value) external` - - Parameters:`_key` - bytes32`_value` - address - -* **setBool** - - `abstract function` **`setBool`**`(bytes32 _key, bool _value) external` - - Parameters:`_key` - bytes32`_value` - bool - -* **setBytes** - - `abstract function` **`setBytes`**`(bytes32 _key, bytes _value) external` - - Parameters:`_key` - bytes32`_value` - bytes - -* **setBytes32** - - `abstract function` **`setBytes32`**`(bytes32 _key, bytes32 _value) external` - - Parameters:`_key` - bytes32`_value` - bytes32 - -* **setContractManager** - - `abstract function` **`setContractManager`**`(address _contractManager) external` - - Parameters:`_contractManager` - address - -* **setInt** - - `abstract function` **`setInt`**`(bytes32 _key, int _value) external` - - Parameters:`_key` - bytes32`_value` - int - -* **setString** - - `abstract function` **`setString`**`(bytes32 _key, string _value) external` - - Parameters:`_key` - bytes32`_value` - string - -* **setUint** - - `abstract function` **`setUint`**`(bytes32 _key, uint _value) external` - - Parameters:`_key` - bytes32`_value` - uint - -* **stringStorage** - - `abstract function` **`stringStorage`**`(bytes32 _key) external returns (string)` - - Parameters:`_key` - bytes32Returns:string - -* **uintStorage** - - `abstract function` **`uintStorage`**`(bytes32 _key) external returns (uint)` - - Parameters:`_key` - bytes32Returns:uint - diff --git a/docgen/docs/api_alphacontracts_interfaces_mybittoken.md b/docgen/docs/api_alphacontracts_interfaces_mybittoken.md deleted file mode 100644 index 0214f873..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_mybittoken.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -id: alphacontracts_interfaces_MyBitToken -title: MyBitToken ---- - -# api\_alphacontracts\_interfaces\_MyBitToken - -## interface MyBitToken - -Source: [alphacontracts/interfaces/MyBitToken.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/interfaces/MyBitToken.sol) - -## Index - -* [allowance](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#allowance) -* [approve](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#approve) -* [balanceOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#balanceOf) -* [burn](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#burn) -* [burnFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#burnFrom) -* [totalSupply](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#totalSupply) -* [transfer](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#transfer) -* [transferFrom](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_MyBitToken.html#transferFrom) - -## Reference - -### Functions - -* **allowance** - - `abstract function` **`allowance`**`(address _owner, address _spender) external returns (uint)` - - Parameters:`_owner` - address`_spender` - addressReturns:uint - -* **approve** - - `abstract function` **`approve`**`(address _spender, uint _value) external returns (bool)` - - Parameters:`_spender` - address`_value` - uintReturns:bool - -* **balanceOf** - - `abstract function` **`balanceOf`**`(address _owner) external returns (uint)` - - Parameters:`_owner` - addressReturns:uint - -* **burn** - - `abstract function` **`burn`**`(uint _amount) external returns (bool)` - - Parameters:`_amount` - uintReturns:bool - -* **burnFrom** - - `abstract function` **`burnFrom`**`(address _from, uint _amount) external returns (bool)` - - Parameters:`_from` - address`_amount` - uintReturns:bool - -* **totalSupply** - - `abstract function` **`totalSupply`**`() external returns (uint)` - - Returns:uint - -* **transfer** - - `abstract function` **`transfer`**`(address _to, uint _value) external returns (bool)` - - Parameters:`_to` - address`_value` - uintReturns:bool - -* **transferFrom** - - `abstract function` **`transferFrom`**`(address _from, address _to, uint _value) external returns (bool)` - - Parameters:`_from` - address`_to` - address`_value` - uintReturns:bool - diff --git a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizeaddrresolveri.md b/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizeaddrresolveri.md deleted file mode 100644 index d6bf3ea9..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizeaddrresolveri.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_OraclizeAddrResolverI -title: OraclizeAddrResolverI ---- - -# api\_alphacontracts\_interfaces\_oraclizeAPI\_05\_OraclizeAddrResolverI - -## contract OraclizeAddrResolverI - -Source: [alphacontracts/interfaces/oraclizeAPI\_05.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/interfaces/oraclizeAPI_05.sol) - -## Index - -* [getAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeAddrResolverI.html#getAddress) - -## Reference - -### Functions - -* **getAddress** - - `abstract function` **`getAddress`**`() public returns (address)` - - Returns:address - diff --git a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizei.md b/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizei.md deleted file mode 100644 index ba369038..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_oraclizei.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_OraclizeI -title: OraclizeI ---- - -# api\_alphacontracts\_interfaces\_oraclizeAPI\_05\_OraclizeI - -## contract OraclizeI - -Source: [alphacontracts/interfaces/oraclizeAPI\_05.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/interfaces/oraclizeAPI_05.sol) - -## Index - -* [getPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#getPrice) -* [getPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#getPrice) -* [query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#query) -* [query2](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#query2) -* [query2\_withGasLimit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#query2_withGasLimit) -* [queryN](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#queryN) -* [queryN\_withGasLimit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#queryN_withGasLimit) -* [query\_withGasLimit](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#query_withGasLimit) -* [randomDS\_getSessionPubKeyHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#randomDS_getSessionPubKeyHash) -* [setCustomGasPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#setCustomGasPrice) -* [setProofType](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.html#setProofType) - -## Reference - -### Functions - -* **getPrice** - - `abstract function` **`getPrice`**`(string _datasource, uint gaslimit) public returns (uint)` - - Parameters:`_datasource` - string`gaslimit` - uintReturns:uint - -* **getPrice** - - `abstract function` **`getPrice`**`(string _datasource) public returns (uint)` - - Parameters:`_datasource` - stringReturns:uint - -* **query** - - `abstract function` **`query`**`(uint _timestamp, string _datasource, string _arg) external payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_arg` - stringReturns:bytes32 - -* **query2** - - `abstract function` **`query2`**`(uint _timestamp, string _datasource, string _arg1, string _arg2) public payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_arg1` - string`_arg2` - stringReturns:bytes32 - -* **query2\_withGasLimit** - - `abstract function` **`query2_withGasLimit`**`(uint _timestamp, string _datasource, string _arg1, string _arg2, uint _gaslimit) external payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_arg1` - string`_arg2` - string`_gaslimit` - uintReturns:bytes32 - -* **queryN** - - `abstract function` **`queryN`**`(uint _timestamp, string _datasource, bytes _argN) public payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_argN` - bytesReturns:bytes32 - -* **queryN\_withGasLimit** - - `abstract function` **`queryN_withGasLimit`**`(uint _timestamp, string _datasource, bytes _argN, uint _gaslimit) external payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_argN` - bytes`_gaslimit` - uintReturns:bytes32 - -* **query\_withGasLimit** - - `abstract function` **`query_withGasLimit`**`(uint _timestamp, string _datasource, string _arg, uint _gaslimit) external payable returns (bytes32)` - - Parameters:`_timestamp` - uint`_datasource` - string`_arg` - string`_gaslimit` - uintReturns:bytes32 - -* **randomDS\_getSessionPubKeyHash** - - `abstract function` **`randomDS_getSessionPubKeyHash`**`() external view returns (bytes32)` - - Returns:bytes32 - -* **setCustomGasPrice** - - `abstract function` **`setCustomGasPrice`**`(uint _gasPrice) external` - - Parameters:`_gasPrice` - uint - -* **setProofType** - - `abstract function` **`setProofType`**`(byte _proofType) external` - - Parameters:`_proofType` - byte - diff --git a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_usingoraclize.md b/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_usingoraclize.md deleted file mode 100644 index e7240509..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeapi_05_usingoraclize.md +++ /dev/null @@ -1,606 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_usingOraclize -title: usingOraclize ---- - -# api\_alphacontracts\_interfaces\_oraclizeAPI\_05\_usingOraclize - -## contract usingOraclize - -Source: [alphacontracts/interfaces/oraclizeAPI\_05.sol](https://github.com/MyBitFoundation/MyBit-Network.tech//blob/v0.0.0/contracts/alphacontracts/interfaces/oraclizeAPI_05.sol) - -## Index - -* [\_\_callback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#__callback) -* [\_\_callback](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#__callback) -* [ba2cbor](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#ba2cbor) -* [coupon](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#coupon) -* [getCodeSize](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#getCodeSize) -* [indexOf](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#indexOf) -* [oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI) -* [oraclize\_cbAddress](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_cbAddress) -* [oraclize\_getNetworkName](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_getNetworkName) -* [oraclize\_getPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_getPrice) -* [oraclize\_getPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_getPrice) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_query](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_query) -* [oraclize\_randomDS\_getSessionPubKeyHash](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_randomDS_getSessionPubKeyHash) -* [oraclize\_randomDS\_setCommitment](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_randomDS_setCommitment) -* [oraclize\_setCustomGasPrice](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_setCustomGasPrice) -* [oraclize\_setNetwork](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_setNetwork) -* [oraclize\_setNetwork](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_setNetwork) -* [oraclize\_setNetworkName](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_setNetworkName) -* [oraclize\_setProof](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclize_setProof) -* [parseAddr](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#parseAddr) -* [parseInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#parseInt) -* [parseInt](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#parseInt) -* [strCompare](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#strCompare) -* [strConcat](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#strConcat) -* [strConcat](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#strConcat) -* [strConcat](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#strConcat) -* [strConcat](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#strConcat) -* [stra2cbor](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#stra2cbor) -* [uint2str](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#uint2str) - -## Reference - -### Modifiers - -* **coupon** - - `modifier` **`coupon`**`(string code)` - - Parameters:`code` - string - -* **oraclizeAPI** - - `modifier` **`oraclizeAPI`**`()` - -### Functions - -* **\_\_callback** - - `function` **`__callback`**`(bytes32 myid, string result) public` - - Parameters:`myid` - bytes32`result` - string - -* **\_\_callback** - - `function` **`__callback`**`(bytes32 myid, string result, bytes proof) public` - - Parameters:`myid` - bytes32`result` - string`proof` - bytes - -* **ba2cbor** - - `function` **`ba2cbor`**`(bytes[] arr) internal pure returns (bytes)` - - Parameters:`arr` - bytes\[\]Returns:bytes - -* **getCodeSize** - - `function` **`getCodeSize`**`(address _addr) internal view returns (uint)` - - Parameters:`_addr` - addressReturns:uint - -* **indexOf** - - `function` **`indexOf`**`(string _haystack, string _needle) internal pure returns (int)` - - Parameters:`_haystack` - string`_needle` - stringReturns:int - -* **oraclize\_cbAddress** - - `function` **`oraclize_cbAddress`**`() internal returns (address)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Returns:address - -* **oraclize\_getNetworkName** - - `function` **`oraclize_getNetworkName`**`() internal view returns (string)` - - Returns:string - -* **oraclize\_getPrice** - - `function` **`oraclize_getPrice`**`(string datasource, uint gaslimit) internal returns (uint)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`gaslimit` - uintReturns:uint - -* **oraclize\_getPrice** - - `function` **`oraclize_getPrice`**`(string datasource) internal returns (uint)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - stringReturns:uint - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string arg, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`arg` - string`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string arg1, string arg2) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`arg1` - string`arg2` - stringReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string arg1, string arg2) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`arg1` - string`arg2` - stringReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`arg1` - string`arg2` - string`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string arg1, string arg2, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`arg1` - string`arg2` - string`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] argN) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`argN` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] argN) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`argN` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] argN, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`argN` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] argN, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`argN` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - string\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] argN) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`argN` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] argN) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`argN` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] argN, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`argN` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] argN, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`argN` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]Returns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, bytes[] args, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`args` - bytes\[\]`gaslimit` - uintReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(string datasource, string arg) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`datasource` - string`arg` - stringReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string arg) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`arg` - stringReturns:bytes32 - -* **oraclize\_query** - - `function` **`oraclize_query`**`(uint timestamp, string datasource, string arg, uint gaslimit) internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`timestamp` - uint`datasource` - string`arg` - string`gaslimit` - uintReturns:bytes32 - -* **oraclize\_randomDS\_getSessionPubKeyHash** - - `function` **`oraclize_randomDS_getSessionPubKeyHash`**`() internal returns (bytes32)` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Returns:bytes32 - -* **oraclize\_randomDS\_setCommitment** - - `function` **`oraclize_randomDS_setCommitment`**`(bytes32 queryId, bytes32 commitment) internal` - - Parameters:`queryId` - bytes32`commitment` - bytes32 - -* **oraclize\_setCustomGasPrice** - - `function` **`oraclize_setCustomGasPrice`**`(uint gasPrice) internal` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`gasPrice` - uint - -* **oraclize\_setNetwork** - - `function` **`oraclize_setNetwork`**`(uint8 networkID) internal returns (bool)` - - Parameters:`networkID` - uint8Returns:bool - -* **oraclize\_setNetwork** - - `function` **`oraclize_setNetwork`**`() internal returns (bool)` - - Returns:bool - -* **oraclize\_setNetworkName** - - `function` **`oraclize_setNetworkName`**`(string _network_name) internal` - - Parameters:`_network_name` - string - -* **oraclize\_setProof** - - `function` **`oraclize_setProof`**`(byte proofP) internal` - - Modifiers:[oraclizeAPI](https://github.com/MyBitFoundation/MyBit-Network.tech/tree/9bb35f4e2608f44c29e1b398fa64e00a295d0ed2/docgen/docs/alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.html#oraclizeAPI)Parameters:`proofP` - byte - -* **parseAddr** - - `function` **`parseAddr`**`(string _a) internal pure returns (address)` - - Parameters:`_a` - stringReturns:address - -* **parseInt** - - `function` **`parseInt`**`(string _a) internal pure returns (uint)` - - Parameters:`_a` - stringReturns:uint - -* **parseInt** - - `function` **`parseInt`**`(string _a, uint _b) internal pure returns (uint)` - - Parameters:`_a` - string`_b` - uintReturns:uint - -* **strCompare** - - `function` **`strCompare`**`(string _a, string _b) internal pure returns (int)` - - Parameters:`_a` - string`_b` - stringReturns:int - -* **strConcat** - - `function` **`strConcat`**`(string _a, string _b, string _c) internal pure returns (string)` - - Parameters:`_a` - string`_b` - string`_c` - stringReturns:string - -* **strConcat** - - `function` **`strConcat`**`(string _a, string _b, string _c, string _d) internal pure returns (string)` - - Parameters:`_a` - string`_b` - string`_c` - string`_d` - stringReturns:string - -* **strConcat** - - `function` **`strConcat`**`(string _a, string _b, string _c, string _d, string _e) internal pure returns (string)` - - Parameters:`_a` - string`_b` - string`_c` - string`_d` - string`_e` - stringReturns:string - -* **strConcat** - - `function` **`strConcat`**`(string _a, string _b) internal pure returns (string)` - - Parameters:`_a` - string`_b` - stringReturns:string - -* **stra2cbor** - - `function` **`stra2cbor`**`(string[] arr) internal pure returns (bytes)` - - Parameters:`arr` - string\[\]Returns:bytes - -* **uint2str** - - `function` **`uint2str`**`(uint i) internal pure returns (string)` - - Parameters:`i` - uintReturns:string - diff --git a/scTopics b/scTopics new file mode 100644 index 00000000..b29a53b7 --- /dev/null +++ b/scTopics @@ -0,0 +1,36 @@ +2decad8bb48804f0ee5d6db8d0af172133549dae6e87c580f8d4785b0a98a98c +f34edc0ebcd1b17116ff08d7496f017ec97263cfb9204e567e99cfd600c86a94 +61a99104105e93063e832b5caa1aff9e843d3ccb8856b2fbf87fd87c5994fb4f +406bb77c76a961878a9fd4dc62fc55850e4cf45e04dbb10997ff2200525af2bb +88c689ce203653ceef25729fbfafd1d88368ffdc653b6455de60529c3c38f972 +3c4afb3481123e55db3a3b4be9f256372a1da4da7d928f0abe156c7e11a2bd3a +0ca76200f2cbba9d442b4d488715c9cfa2b2a5fa1851ffab16246afe876f0bda +b316a66ff53eb90eea8654c8b3be7dd2c4ff73de6ecd93e5e7d638478ffbf89b +9ed4c7f03bca476f010a14f2645be8dd3b346f3eff949f47187752aaf3a74cc5 +6249617f357b193bbe3575a3a4354d394beadd04976d1e97feea5d9c9bb43272 +26775bfc8cdc046300e40fd06986d993bdbc9745820932c623479153555b2b58 +76894f3f43405586276a391d46dcf3fb44f068502398bfc3bd94ca74d9b17db5 +1ada3ebe9c7d7888935ef008df211264b7955ab7adf154420c5bcb690e6c905c +5757179a234073e47bf5234f10e81deab6a6f4b0286ce2eb8b3268b4fecabc4d +03617faa817f69a09ff99db36fed8f03429c01c76ed78e8fc520a116cf51b903 +0fd9c04ca9ef032499a1245920802f72952ece913c5e9c2918c134fb88daab28 +5fefc4b9ca44ae826cdd73195b8c01f0ab320538ee0d967f042dc8f3d542c997 +6060218136c5ffe9e5a19b21eed208cebd47950358a69d562233287fcec010a6 +757cd168a49b9acc83db53171bb0a87208582e418fc434c2ca2efeb9089d0922 +aa01a7ccaceb83667ab8b95a06d73975161f4fdf485e5ca9911a09f70b4a8da8 +e917cad2e45fc715729178bfe5788dea7a6ff46be501eac7c7d3fc09a89e9a89 +ef70472a810ac05b12fb9f6628e33f8bd27747531a5b89fe2b5d3ed96bfb24e8 +31132a67ac736d4e40522e88a5436b70edadb1a9cf45b668c0d9506b0b736b8f +4e0819defedf0f946ba9f14d45cf0ba8a1406a0f9b2854c303e43377b3fe498a +ddb01d1203b1a6024cac3b0de279683905c3013a33087961b8c167d511f88630 +61b7cbe6fd215363821c7c167c462bc83657af55404c14019588997f3e96580e +2f4e40ec22c2e77e00a1a025ae04c2aa684d7e50130fba597e204f6ed74d07bd +52f5c708878631c472f0c1ca1967743febc80819e04d6b90add1b12ff5fa2de7 +04fcfa9d98ff9a287a3f7e5a27942a6dc1371ca44543575b4ed465b1d40b1a82 +e6c51694889ce622f8cfe8a9ba1d12155779fc8ebed268cd0aace47a68af025a +7486347735fb510164d18d7a0591c96869c67861b4ead136c9b322e7949c1773 +56ea55d33b170e1a953a2bfc5ac3786e8b37ad16ad55958cfdf7db32bf3a686b +1ae408e8a7ff42bf83c94e421fe6524d2493f12699276d135e2d1e022ac08da9 +afde17ae1f536ebf7f5c2fabec38133e2661a50359ed93d212e8f0d0a3241f60 +b8fb0d01700c127d74e6a0895140fb6587001ff32c6f542bc38829806cd01c6a +9ce390764728004155ca2fbaa37a38718719ec7ba97885dfcdc06e4a54f7ddc6 diff --git a/test/AssetGovernance.js b/test/AssetGovernance.js index 5637e488..02339138 100644 --- a/test/AssetGovernance.js +++ b/test/AssetGovernance.js @@ -12,6 +12,16 @@ const API = artifacts.require("./database/API.sol"); const GovernedToken = artifacts.require("./tokens/ERC20/GovernedToken.sol"); const PlatformToken = artifacts.require("./tokens/ERC20/BurnableToken.sol"); const HashFunctions = artifacts.require("./test/HashFunctions.sol"); +const Promisify = (inner) => + new Promise((resolve, reject) => + inner((err, res) => { + if (err) { + reject(err); + } else { + resolve(res); + } + }) + ); const owner = web3.eth.accounts[0]; const user1 = web3.eth.accounts[1]; @@ -35,7 +45,7 @@ contract('AssetGovernance', async() => { let api; let hash; let govToken; - let burnToken; + let platformToken; let governance; let methodID; @@ -45,6 +55,7 @@ contract('AssetGovernance', async() => { let operatorID; let assetID; let assetURI = 'https://alocationforassetdetails'; + let totalSupply; it('Deploy HashFunctions', async() => { hash = await HashFunctions.new(); @@ -66,13 +77,16 @@ contract('AssetGovernance', async() => { }); it("Deploy standard token", async() => { - burnToken = await PlatformToken.new('MyB', 180000000*ETH); + platformToken = await PlatformToken.new('MyB', 180000000*ETH); }); - it("Transfer token to assetManager", async() => { - await burnToken.transfer(assetManager, 100*ETH); - assetManagerBalance = await burnToken.balanceOf(assetManager); + it("Transfer token to assetManagers", async() => { + await platformToken.transfer(assetManager, 100*ETH); + assetManagerBalance = await platformToken.balanceOf(assetManager); assert.equal(assetManagerBalance, 100*ETH); + await platformToken.transfer(newAssetManager, 100*ETH); + newAssetManagerBalance = await platformToken.balanceOf(newAssetManager); + assert.equal(newAssetManagerBalance, 100*ETH); }); it('Deploy api', async() => { @@ -84,7 +98,7 @@ contract('AssetGovernance', async() => { platform = await Platform.new(db.address); await cm.addContract('PlatformFunds', platform.address); await platform.setPlatformWallet(owner); - await platform.setPlatformToken(burnToken.address); + await platform.setPlatformToken(platformToken.address); }); it('Deploy assetManager escrow', async() => { @@ -109,11 +123,11 @@ contract('AssetGovernance', async() => { }); it("Lock escrow", async() => { - let balanceBefore = await burnToken.balanceOf(assetManager); - await burnToken.approve(escrow.address, 2*ETH, {from:assetManager}); + let balanceBefore = await platformToken.balanceOf(assetManager); + await platformToken.approve(escrow.address, 2*ETH, {from:assetManager}); tx = await escrow.lockEscrow(assetID, 2*ETH, {from:assetManager}); assetManagerEscrowID = tx.logs[0].args._assetManagerEscrowID; - let balanceAfter = await burnToken.balanceOf(assetManager); + let balanceAfter = await platformToken.balanceOf(assetManager); let diff = bn(balanceBefore).minus(balanceAfter); assert.equal(diff, 2*ETH); }); @@ -143,17 +157,22 @@ contract('AssetGovernance', async() => { await db.setAddress(operatorHash, operator); }); + // Each token holder has 25% of total supply (assetmanager has 25%) it("Spread tokens to users", async() => { let userBalance; - let totalSupply = bn(8).times(ETH); + let totalSupply = 999999999999999999999999999999999999; + let supplyCheck; tokenPerAccount = totalSupply / tokenHolders.length; // TODO: getting error with bignumber.js here for (var i = 0; i < tokenHolders.length; i++) { //console.log(web3.eth.accounts[i]); await govToken.mint(tokenHolders[i], tokenPerAccount); + supplyCheck += tokenPerAccount; userBalance = await govToken.balanceOf(tokenHolders[i]); assert.equal(userBalance, tokenPerAccount); } assert.equal(await govToken.balanceOf(owner), 0); + console.log("each user has a potential vote percentage of ", (tokenPerAccount * 100) / await govToken.totalSupply()); + // assert.equal(supplyCheck, await govToken.totalSupply()); }); it("Transfer token to assetManager assets", async() => { @@ -163,12 +182,20 @@ contract('AssetGovernance', async() => { }); it("Vote for AssetManager to be fired", async() => { - let methodString = "becomeAssetManager(bytes32, address, uint256, uint256)"; + let methodString = "becomeAssetManager(bytes32,address,uint256,bool)"; methodID = await api.getMethodID(methodString); + // set the new asset manager with a requirement of 10 token escrow and burn old managers escrow parameterHash = await api.getAssetManagerParameterHash(assetID, assetManager, newAssetManager, 10*ETH, true); executionID = await api.getExecutionID(escrow.address, assetID, methodID, parameterHash); await governance.voteForExecution(escrow.address, assetID, methodID, parameterHash, tokenPerAccount, {from: user1}); - await govToken.approve(escrow.address, 10*ETH, {from: newAssetManager}); + let consensusProgress = await api.getCurrentConsensus(executionID, govToken.address); + console.log("First vote received, consensus is : " , Number(consensusProgress)); + console.log("First user voted with : ", tokenPerAccount); + console.log("Votes for execution from user1 is : ", Number(await api.getInvestorVotes(executionID, user1))); + console.log("Total votes for execution are: ", Number(await api.getTotalVotes(executionID))); + console.log("Total token supply is: ", Number(await govToken.totalSupply())); + assert.equal(consensusProgress, 25); + }); it("Try to transfer tokens", async() => { @@ -199,7 +226,8 @@ contract('AssetGovernance', async() => { it("Fail executing new assetManager", async() => { let err; let consensusProgress = await api.getCurrentConsensus(executionID, govToken.address); - assert.equal(bn(consensusProgress).lt(50), true); + console.log("fail executing new asset manager, consensus is : " , Number(consensusProgress)); + assert.equal(bn(consensusProgress).lt(66), true); // assert.equal(await govToken.allowance(newAssetManager, escrow.address), 10*ETH); //Fail because consensus is not yet reached try{ @@ -210,14 +238,41 @@ contract('AssetGovernance', async() => { assert.notEqual(err, undefined); }); - it("Vote for AssetManager to be fired with half of tokens", async() => { - await govToken.approve(escrow.address, 10*ETH, {from: newAssetManager}); - let methodString = "becomeAssetManager(bytes32, address, uint256, uint256)"; - methodID = await api.getMethodID(methodString); - parameterHash = await api.getAssetManagerParameterHash(assetID, assetManager, newAssetManager, 10*ETH, true); - assert.equal(tokenPerAccount, ( (tokenPerAccount / 2) + (tokenPerAccount / 2) )); - await governance.voteForExecution(escrow.address, assetID, methodID, parameterHash, tokenPerAccount / 2, {from: user2}); - await governance.voteForExecution(escrow.address, assetID, methodID, parameterHash, tokenPerAccount / 2, {from: user2}); + it("Vote for AssetManager with 2nd token holder ", async() => { + await governance.voteForExecution(escrow.address, assetID, methodID, parameterHash, tokenPerAccount, {from: user2}); + let consensusProgress = await api.getCurrentConsensus(executionID, govToken.address); + console.log("Second vote received, consensus is : " , Number(consensusProgress)); + console.log("Second user voted with : ", tokenPerAccount); + console.log("Votes for execution from user2 is : ", Number(await api.getInvestorVotes(executionID, user2))); + console.log("Total votes for execution are: ", Number(await api.getTotalVotes(executionID))); + console.log("Total token supply is: ", Number(await govToken.totalSupply())); + assert.equal(consensusProgress, 50); + }); + + it("Vote for AssetManager with 3rd token holder ", async() => { + await governance.voteForExecution(escrow.address, assetID, methodID, parameterHash, tokenPerAccount, {from: user3}); + let consensusProgress = await api.getCurrentConsensus(executionID, govToken.address); + console.log("Third vote received, consensus is : " , Number(consensusProgress)); + console.log("Third user voted with : ", tokenPerAccount); + console.log("Votes for execution from user3 is : ", Number(await api.getInvestorVotes(executionID, user3))); + console.log("Total votes for execution are: ", Number(await api.getTotalVotes(executionID))); + console.log("Total token supply is: ", Number(await govToken.totalSupply())); + assert.equal(bn(consensusProgress).gt(66), true); + }); + + + it("Change AssetManager", async() => { + await platformToken.approve(escrow.address, 10*ETH, {from: newAssetManager}); + let consensus = await governance.isConsensusReached(escrow.address, assetID, methodID, parameterHash); + console.log("consensus is reached? ", consensus); + // let e = await governance.LogConsensus({}, {fromBlock: 0, toBlock: 'latest'}); + // let logs = await Promisify(callback => e.get(callback)); + // console.log('Consensus: ', consensus); + // console.log(logs[0].args); + await escrow.becomeAssetManager(assetID, assetManager, 10*ETH, true, {from:newAssetManager}); + let e2 = await escrow.LogConsensus({}, {fromBlock: 0, toBlock: 'latest'}); + let logs2 = await Promisify(callback => e2.get(callback)); + console.log(logs2[0].args); }); }); diff --git a/test/accounts.json b/test/accounts.json index 1954395e..ff9763a5 100644 --- a/test/accounts.json +++ b/test/accounts.json @@ -1,12 +1,12 @@ [ - "0xeed17b217b1e0c63b1b525d8d2e59cad0546432d", - "0x0ec0e59bd4faf0a136c2ee638f3fcff19972a304", - "0xe273d3d13d69f82b8071365e110e13c0fbde0c59", - "0x4cbe9306228ff003fe5a47fe66f2e3d3162f0f37", - "0x0dcea99d96046de44f1ab2a4bf9b3e21f3ac2924", - "0x8bd581cca82af7cfff8ab46591803fe2f2061218", - "0xd6a41e3da4bdc4a27d5707b08612925347f5934f", - "0xd0702a4258c574ff15df4e65000dbb16843cbd24", - "0xc3dda1fc00ba83300b9ad2d00faa30166fabc657", - "0x45543e02e26442e6c95e3145f7d30a53b284f418" + "0x83ab44a76fc2e7238fca811e38e41845ed1a9fb3", + "0xbcccfb280ff402bc5a593dfce2b3dc736e17e7ba", + "0x6d929ebae40bbf96f52e3f82bd831c2891a0d75d", + "0x9916ebeef94abca7564ce7dabcbacd434f4015cd", + "0xf89f0b05980fb8c7b3d985206707f20a6189c5de", + "0x87460046866e93e99273a9f8a94d1e5764774dc9", + "0x65a67881065abe61de49c13c44f55a7916c252ae", + "0x557f883a3a7b4609ca1251c60253c79e275ba1a6", + "0x310ddb0d62b77fb195dcaebfadcebaf3978c198f", + "0x4449f9fcc41cf2275fd3631e044e3cf9d603efc2" ] \ No newline at end of file diff --git a/test/addresses.json b/test/addresses.json index 1e9ab1ef..c4941f10 100644 --- a/test/addresses.json +++ b/test/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x23f5dcdf9c431c467de788fb14bf5caf7966f812", - "ERC20Burner": "0x5aa75318a3b08c25ceb13cc8e808b97a6e5efc67", - "Database": "0x404823e6d5e3c99d8309295c7b243f554e7bffd7", - "ContractManager": "0x0ed1e38239b493cb78f1509ff5f6c31629939ab7", - "API": "0xe5f48145db52f521375f7cb1c71b73b207ead88b", - "SingleOwned": "0x341be03c73b3788116fa061b5bdf338b10f90460", - "Pausible": "0x75830c46ea8f42ddb9b4de81e575f9bb09ba8245", - "AccessHierarchy": "0x8266ddfd5824d4e3e773c2722a7d102de4dd732d", - "PlatformFunds": "0x03824910f1b9c17fb44b40897972fbd792792ee1", - "Operators": "0x91e698c250a486d30db5e39c659ad7cbfa12ca67", - "AssetManagerEscrow": "0xb1c6598b8fa70aeadccbda89aeb4b1d3b75410d8", - "CrowdsaleETH": "0xcb25d6fe4fc09e9cc3412df95baa90fb7fee471c", - "CrowdsaleGeneratorETH": "0x661c62ace83f7fe8c96ac6e88cacd52cb156801a", - "CrowdsaleERC20": "0x2678490ccf890c681c946ef7e25cad427fa217c8", - "CrowdsaleGeneratorERC20": "0x182eda13a88499cf7652d9091fc4337bf64ac7cb", - "AssetExchange": "0xfce2dd5b092dd362c9cb9cece545676966be27d5" + "MyBit": "0xe358ea7a05daa9276d9adb06ca34b382d981b0c2", + "ERC20Burner": "0xd9fe81dc41b60b546748e25636575e5013ca0a2c", + "Database": "0x796d96f13481a333f474700a13f55db648f69dcb", + "ContractManager": "0xa3efa08399a355bccefd89d58e0572464e23b7bd", + "API": "0xb2a1c103fcf1a8a52d03281e8084160d182a0ef6", + "SingleOwned": "0x2a2c9551f9fa00f96272d1ac96bb02aa78b8ef10", + "Pausible": "0x2ccd557c83fea42412f314e0ee1e000593a70b3b", + "AccessHierarchy": "0xa4443513ba8362350a49554a908f1c70c1c4350c", + "PlatformFunds": "0xc38ec3e982efe56ae55fe98f74d1635b4838580a", + "Operators": "0x0deb614055a4da85983f3219cad77bf9bf83091e", + "AssetManagerEscrow": "0xdbc841d3e3f8e8d9512e1ad9c8b4140f959426be", + "CrowdsaleETH": "0x80bf6328695a47b33e1daaa9bc86a381ae1851db", + "CrowdsaleGeneratorETH": "0xf636c78b42bd1df77e0fafcc647bb0fa188a4459", + "CrowdsaleERC20": "0xb0678df3d9d2dee346f8c7692f0c5f83a3cbe62d", + "CrowdsaleGeneratorERC20": "0xe111740d7f16920510c411b0a0875e63c4e7dbeb", + "AssetExchange": "0xbca439609a7d0e0ae1a3f36502c4c3a2419048d8" } \ No newline at end of file