From ceaccaa024e49e117666c0e8ce7233e470c2a882 Mon Sep 17 00:00:00 2001 From: Iggy Grey Date: Wed, 17 Oct 2018 21:29:46 -0700 Subject: [PATCH 01/21] Added test for AssetManagerFunds --- accounts.json | 20 ++++----- addresses.json | 32 +++++++------- contracts/roles/AssetManagerFunds.sol | 4 +- test/AssetManagerFunds.js | 62 +++++++++++++++++++++++++-- 4 files changed, 87 insertions(+), 31 deletions(-) diff --git a/accounts.json b/accounts.json index c0ddd8c5..d97d2925 100644 --- a/accounts.json +++ b/accounts.json @@ -1,12 +1,12 @@ [ - "0x34b4c0cf65a762f3042070a03425ab4bffe0170c", - "0x44067107f06443e6d125352bbf95de0c133456f8", - "0x02c4039e7d59b00e20f0f1dade6265c5a27ea715", - "0x9d01aafb060b3b76dc8e546b0550b68e8d7c529b", - "0xb220118ca37c21717fd09d9fc01fbb98d9b1f930", - "0x2fd989874137f24325474df1a3aacae508e3e2ce", - "0x6925b5a5cc617e466437a39ffb9c82a56c89e0a9", - "0xe42cd23ef408bf91042f3bb643db512c36d7a42e", - "0xee3cc3822bfeb1567ded5c507eba3a9c680988e7", - "0x20a698e36ae9bce21d5a00f87a98876a0e21af4e" + "0x590f94438c6b8df412a09f25f5292aac01b4fa09", + "0x32ff587b8ca6300294d622098915b1afb8982829", + "0xdae8399289fd74bda66fa98bd1859c68134e2567", + "0x0ba2ee5b570ff955d927925cd1a6c31c1909e246", + "0xfd6133bf620f2dbdb8c45a922f740da3b357302e", + "0xe81747b29b6633578c02f487c965096bf6a73565", + "0x1670bc8b5229b651340a24ef6799c3a9f46e89c5", + "0xbc28f186d3114c1387f4b1839731773b656f5f93", + "0x75aef1f5dadbad74ec778a84d729ee30c2cd46b1", + "0x6f47a67f1374c49ce6392a668c049a63e340ff8b" ] \ No newline at end of file diff --git a/addresses.json b/addresses.json index bcbaeeb0..1d9f2a01 100644 --- a/addresses.json +++ b/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x1251954ebb35a93414c4fdd6eb572f9292f79bcf", - "ERC20Burner": "0xc263fabff96e5b4a11704478816c874fda9c4177", - "Database": "0x3f4c458f7adc3ce2300cd9fa7ab2c218d04ea18d", - "ContractManager": "0x346505e54761981543be0cd304d3c123887c6e99", - "API": "0xa12d771ffb785ad139dbe082be83259b7a0da142", - "SingleOwned": "0x5bb4c507e7a64c7db50f3a398dc80f399e9c968a", - "Pausible": "0x23ecf8d2811058b790f97fe3c307c16b8e41649e", - "AccessHierarchy": "0x24d2a3416e8b073dfc557fcf0b72cd73c4ae12c1", - "PlatformFunds": "0x6bbb45d95ddbb7a015d10257f66d13936212e64d", - "Operators": "0xbc135c1965c54aca5777aa750bf7863f23e074b3", - "AssetManagerEscrow": "0x172a12d553dd2a57a4227005972340dafcfcf14d", - "CrowdsaleETH": "0xdcf1b48d5bacfd16be0d03f68e0c748e08c79fb1", - "CrowdsaleGeneratorETH": "0x0ff213559567c2787abd8fb42ff46777fe978307", - "CrowdsaleERC20": "0xd5b03029ad72aa013cbcd5a8dd31f6a5cca04f45", - "CrowdsaleGeneratorERC20": "0xa1a8c7e4c9b1cb580428f3326dec41fc1b53391f", - "AssetExchange": "0x75fcdea05c36b0bdcbf1cd341b6cb7b846a885a3" + "MyBit": "0xf45b23cc62e941291481ef5dafcf8a9cde30bf70", + "ERC20Burner": "0xfcaf6c14dc7c9cf79d4db58e6c94c942ae3ad1e1", + "Database": "0x938fae37294e9709121314777dd8ab487867336d", + "ContractManager": "0xfbc85e780ebc7b734796c8688c0bcb97af1fcfc6", + "API": "0xcfc57b6f5c0ff77665a1967bd076e2112dff29ae", + "SingleOwned": "0x509e5492e7566093b5e6a06f191427219499229b", + "Pausible": "0x431be519376d1208740889e169a7cbd008d1fb5a", + "AccessHierarchy": "0x784e5c7357b7c29742e82786adcf7867084f50b3", + "PlatformFunds": "0x35f62aab3aea258cb0f5032b142aa2e28241e44c", + "Operators": "0x341e584c03d74547183c81a48a0314aea7fa054c", + "AssetManagerEscrow": "0xe322c30cf0f108d8136dfbb787f12b7242f137c1", + "CrowdsaleETH": "0xcaaf3d9c402344575dc92b2abd6046fed1cc044d", + "CrowdsaleGeneratorETH": "0xff249a1623a06d475f84d443e67871199e21ab05", + "CrowdsaleERC20": "0xbbbfa52d199804e73838ba2dcae1fc8672defbd5", + "CrowdsaleGeneratorERC20": "0x42084420c41e2e51af12f53530b777ffc3181da3", + "AssetExchange": "0x28c3b5fec46958f8cef0a3bae757f77fbf071d6c" } \ No newline at end of file diff --git a/contracts/roles/AssetManagerFunds.sol b/contracts/roles/AssetManagerFunds.sol index f72b910e..aff6945e 100644 --- a/contracts/roles/AssetManagerFunds.sol +++ b/contracts/roles/AssetManagerFunds.sol @@ -56,7 +56,7 @@ contract AssetManagerFunds { function retrieveAssetManagerTokens(bytes32[] _assetID) external returns (bool) { - require(_assetID.length < 50); + require(_assetID.length <= 42); uint[] memory payoutAmounts = new uint[](_assetID.length); address[] memory tokenAddresses = new address[](_assetID.length); uint8 numEntries; @@ -89,7 +89,7 @@ contract AssetManagerFunds { function retrieveAssetManagerETH(bytes32[] _assetID) external returns (bool) { - require(_assetID.length < 50); + require(_assetID.length <= 93); uint weiOwed; for(uint8 i = 0; i < _assetID.length; i++){ require(msg.sender == database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID[i])))); diff --git a/test/AssetManagerFunds.js b/test/AssetManagerFunds.js index c963745d..763c42cd 100644 --- a/test/AssetManagerFunds.js +++ b/test/AssetManagerFunds.js @@ -117,6 +117,34 @@ contract('AssetManagerFunds', async() => { await db.setAddress(assetManagerHash, assetManager); await db.setAddress(operatorHash, operator); }); +/* + it("Add multiple assets", async() => { + var number = 92; //We can test multiple assets to find the limit, the limit is 93 (92 + 1 from 'Generate assetID') + for(var i=0; i { //await web3.eth.sendTransaction({from:operator, to:divToken.address, value:10*ETH}); @@ -140,7 +168,7 @@ contract('AssetManagerFunds', async() => { let balanceBefore = await web3.eth.getBalance(assetManager); let amountOwed = await divToken.getAmountOwed(assetManagerFunds.address); assert.notEqual(amountOwed, 0); - let tx = await assetManagerFunds.retrieveAssetManagerETH(assetsETH, {from:assetManager}); + let tx = await assetManagerFunds.retrieveAssetManagerETH(assetsETH, {from:assetManager, gas:6721975}); //console.log(tx); let balanceAfter = await web3.eth.getBalance(assetManager); assert.equal(bn(balanceAfter).isGreaterThan(balanceBefore), true); @@ -192,6 +220,35 @@ contract('AssetManagerFunds', async() => { assert.equal(await burnToken.balanceOf(divTokenERC20.address), 5*ETH); }); + it("Add multiple assets", async() => { + var number = 41; //We can test multiple assets to find the limit, the limit is 42 (41 + 1 from 'Generate assetID') + for(var i=0; i { let balanceBefore = await burnToken.balanceOf(user1); let amountOwed = await divTokenERC20.getAmountOwed(user1); @@ -211,12 +268,11 @@ contract('AssetManagerFunds', async() => { assert.equal(await divTokenERC20.balanceOf(assetManagerFunds.address), tokenPerAccount); console.log("amount owed"); console.log(amountOwed); - let tx = await assetManagerFunds.retrieveAssetManagerTokens(assetsERC, {from:assetManager}); + let tx = await assetManagerFunds.retrieveAssetManagerTokens(assetsERC, {from:assetManager, gas:6721975}); //console.log(tx); let balanceAfter = await burnToken.balanceOf(assetManager); console.log(balanceAfter); console.log(balanceBefore); assert.equal(balanceBefore.plus(amountOwed).eq(balanceAfter), true); }); - }); From 2c32da394e3cd0991272f780e3026664db6fae2b Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Thu, 18 Oct 2018 16:05:10 +0200 Subject: [PATCH 02/21] added crowdsale tests. --- accounts.json | 20 ++-- addresses.json | 32 +++--- contracts/crowdsale/CrowdsaleERC20.sol | 1 - .../crowdsale/CrowdsaleGeneratorERC20.sol | 11 +- contracts/crowdsale/CrowdsaleGeneratorETH.sol | 13 +-- contracts/roles/AssetManagerFunds.sol | 20 +++- contracts/tokens/erc20/MintableToken.sol | 2 +- migrations/2_deploy_protocol.js | 9 +- test/AssetGenerator.js | 2 +- test/ERC20Crowdsale.js | 45 +++++++- test/EthCrowdsale.js | 105 +++++++++++++++++- test/accounts.json | 20 ++-- test/addresses.json | 34 +++--- 13 files changed, 237 insertions(+), 77 deletions(-) diff --git a/accounts.json b/accounts.json index d41cb65d..61c5f312 100644 --- a/accounts.json +++ b/accounts.json @@ -1,12 +1,12 @@ [ - "0x13c1cb47836fd4875e4fb0b44627a1ed0babf0b8", - "0xf76f915ae32ad19fd4359b0d1a56328f7beef8be", - "0x0dfb69ce3123487acdd8c6e3ab2e4ce8655b6a6c", - "0xb798b6b56024329e03b211db4c47007a3005eb68", - "0x14a89c951a59131d3e61339501f4a95cf1190efd", - "0x62bcf293e78716718bb79db862dae9ad918e0069", - "0xd72eb39df4b7d974c114f152c90c1919deed3fcc", - "0xc1334b27495bd3edba0815a2b96cab50d4abc3a1", - "0xc513d4bfd54602a931ed0ac7b160c694316e7ec8", - "0x4e8eaf8efa38c6ee6dd0fb1f11def4e6b89c3415" + "0xb60ff3a9b592f2e253c09105bd3bfb30b3a31b82", + "0x081e6792435824de0f305c20e2ec4d8909104f12", + "0x9e48310c94cf753f69339f87a935e7e88e5517fb", + "0x7454d490a99cff50e648bb2766a4b44faa02559e", + "0xd540205de226b091e124a5cae147ee7c0bf6de2d", + "0x7c3962ff10de0ae69384aada12dea0d999d61774", + "0xa5dc6960de49ac2cb08fd464bafcd176599f1a31", + "0xdcb5b8885bf0e485057ca83cfa6526fddb83136a", + "0x11e965d05991c9fe76f9fef57c393f2d8f471d7d", + "0x1bdcd2e21917f56cdbf1338aa52578a1c74d779e" ] \ No newline at end of file diff --git a/addresses.json b/addresses.json index 57af20c0..dd5227d1 100644 --- a/addresses.json +++ b/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x0c57ca00b9b0f2aff3e1c5113a7c1e51287112af", - "ERC20Burner": "0xecd561c23e5c92a4d26cbd27f287e5ba473f09e9", - "Database": "0x723d5ff1e50cc8dcec5a1e2971f5094f5887b048", - "ContractManager": "0x85e0c4b687c0c618ff662b17b89673b17b462fa0", - "API": "0x73b0545e6d872b4c904079eb1d8e9cc6c8f89773", - "SingleOwned": "0x6e79eb19081f2af35f05acf824f2bc9de34fb343", - "Pausible": "0x55a76d119817552795f74d3605508d8c36297696", - "AccessHierarchy": "0x63d36c6b8f53309c93b6c53966be526aa0ebec0e", - "PlatformFunds": "0xc1aa884796ace39a79ee275f9e2e06f9a33534c2", - "Operators": "0xf8762a3c840716a208d384de93211b16bcc7492b", - "AssetManagerEscrow": "0xf2ed6113851c6a8ad781d1af4044616d8c0f8c57", - "CrowdsaleETH": "0x25ec303b7e9a8aa5f2817ddb4cf13969bf785a7e", - "CrowdsaleGeneratorETH": "0x0df14b00baeab8428e7488c37f8154281704df73", - "CrowdsaleERC20": "0x85ce610be8878cc1c18a9c7cd3188f2b012f231c", - "CrowdsaleGeneratorERC20": "0xcea1a56634b6879f2ec6592375c1b29cbe237437", - "AssetExchange": "0x311224c4cf2ac2acd4009cf72d74fca5242a0987" + "MyBit": "0x4ec519da46c5a9c2c522ad2cf8db68fdd35b5c8c", + "ERC20Burner": "0xce6dfc17b443e4c3283157ad7e4fc1dc9485e7ae", + "Database": "0x5821c16ad953abeebd3ca699ef85366535dbed15", + "ContractManager": "0x78b1cc3aaf3027aa0ecd19f905ace655422ccdf8", + "API": "0x4717c1b4c7b199b21ebe2400c14ee4fe1dd4aabc", + "SingleOwned": "0x96b71320ffdcf889ed7e0bd087303eaf7f060014", + "Pausible": "0x83323ac7e72953db81908958cf34d91be5e5158a", + "AccessHierarchy": "0xa3477449c53fbb4c75949833c591cf8898a12db4", + "PlatformFunds": "0x4bf05b4c30d1e9b40d518ba0cc1a56bbada4ad70", + "Operators": "0x8c3e8f0f645ede22ef2a99306b2c19700ce70af9", + "AssetManagerEscrow": "0x2284d48536a6c914ae133c1d55710e1cd3c91fcd", + "CrowdsaleETH": "0x913aa08a287e3b4d92333abcad5bd0558981035e", + "CrowdsaleGeneratorETH": "0x790f7a9105cff89b671fcfdb0cc257054bd56f1b", + "CrowdsaleERC20": "0x0fe3be7209fb5f3cef0c6111facfebb93812fa85", + "CrowdsaleGeneratorERC20": "0x540652d7f1e0535e4ca2299ec052728793410c17", + "AssetExchange": "0xe12c424ba8eab79b79be00f9d253e36237ba28e4" } \ No newline at end of file diff --git a/contracts/crowdsale/CrowdsaleERC20.sol b/contracts/crowdsale/CrowdsaleERC20.sol index cc01716b..3f65c26c 100644 --- a/contracts/crowdsale/CrowdsaleERC20.sol +++ b/contracts/crowdsale/CrowdsaleERC20.sol @@ -45,7 +45,6 @@ contract CrowdsaleERC20{ require(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID))) )); require(finalizeCrowdsale(_assetID)); require(assetToken.mint(msg.sender, tokensRemaining)); // Send remaining asset tokens to investor - // Give assetManager his portion of tokens require(assetToken.finishMinting()); require(payoutERC20(_assetID, amountToRaise)); // 1 token = 1 wei } diff --git a/contracts/crowdsale/CrowdsaleGeneratorERC20.sol b/contracts/crowdsale/CrowdsaleGeneratorERC20.sol index f8ecdf3f..cd58c8e7 100644 --- a/contracts/crowdsale/CrowdsaleGeneratorERC20.sol +++ b/contracts/crowdsale/CrowdsaleGeneratorERC20.sol @@ -34,9 +34,10 @@ contract CrowdsaleGeneratorERC20 { // @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 - isTrue(_assetManagerPerc < 100) - isTrue(database.boolStorage(keccak256(abi.encodePacked("acceptsToken", _operatorID, _fundingToken)))) burnRequired { + require(_amountToRaise > 0); + require(_assetManagerPerc < 100); + require(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); @@ -58,12 +59,6 @@ contract CrowdsaleGeneratorERC20 { // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // @notice reverts if _conditional isn't true - modifier isTrue(bool _conditional){ - require(_conditional); - _; - } - // @notice reverts if AssetManager hasn't approved burner to burn platform token modifier burnRequired { //emit LogSig(msg.sig); diff --git a/contracts/crowdsale/CrowdsaleGeneratorETH.sol b/contracts/crowdsale/CrowdsaleGeneratorETH.sol index 2e92a9a8..87eab960 100644 --- a/contracts/crowdsale/CrowdsaleGeneratorETH.sol +++ b/contracts/crowdsale/CrowdsaleGeneratorETH.sol @@ -33,10 +33,11 @@ contract CrowdsaleGeneratorETH { // @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 - isTrue(_assetManagerPerc < 100) - isTrue(database.boolStorage(keccak256(abi.encodePacked("acceptsEther", _operatorID)))) burnRequired returns (bool) { + require(_amountToRaise > 0); + require(_assetManagerPerc < 100); + require(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); @@ -47,7 +48,7 @@ contract CrowdsaleGeneratorETH { 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); // Make this a require() if want to enforce escrow + 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; @@ -57,12 +58,8 @@ contract CrowdsaleGeneratorETH { // Modifiers ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - modifier isTrue(bool _conditional){ - require(_conditional); - _; - } - + // @notice reverts if asset manager is unable to burn pp modifier burnRequired { //emit LogSig(msg.sig); require(burner.burn(msg.sender, database.uintStorage(keccak256(abi.encodePacked(msg.sig, address(this)))))); diff --git a/contracts/roles/AssetManagerFunds.sol b/contracts/roles/AssetManagerFunds.sol index f72b910e..e9409f30 100644 --- a/contracts/roles/AssetManagerFunds.sol +++ b/contracts/roles/AssetManagerFunds.sol @@ -14,19 +14,25 @@ interface DToken { // @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 -// @dev Tokens +// @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)))); @@ -55,6 +61,7 @@ contract AssetManagerFunds { function retrieveAssetManagerTokens(bytes32[] _assetID) external + nonReentrant returns (bool) { require(_assetID.length < 50); uint[] memory payoutAmounts = new uint[](_assetID.length); @@ -88,6 +95,7 @@ contract AssetManagerFunds { function retrieveAssetManagerETH(bytes32[] _assetID) external + nonReentrant returns (bool) { require(_assetID.length < 50); uint weiOwed; @@ -106,6 +114,7 @@ contract AssetManagerFunds { 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 @@ -116,6 +125,15 @@ contract AssetManagerFunds { return uint8(_addressList.length + 1); } + + // @notice prevents calls from re-entering contract + modifier nonReentrant() { + transactionNumber += 1; + uint256 localCounter = transactionNumber; + _; + require(localCounter == transactionNumber); + } + function () payable public {} diff --git a/contracts/tokens/erc20/MintableToken.sol b/contracts/tokens/erc20/MintableToken.sol index c13aa107..f853b35f 100644 --- a/contracts/tokens/erc20/MintableToken.sol +++ b/contracts/tokens/erc20/MintableToken.sol @@ -10,7 +10,7 @@ import "./StandardToken.sol"; */ contract MintableToken is StandardToken { - bool internal mintingFinished; + bool public mintingFinished; address internal minter; string internal tokenURI; // A reference to a URI containing further token information diff --git a/migrations/2_deploy_protocol.js b/migrations/2_deploy_protocol.js index f43dc45c..dca9c756 100644 --- a/migrations/2_deploy_protocol.js +++ b/migrations/2_deploy_protocol.js @@ -11,6 +11,7 @@ var AccessHierarchy = artifacts.require("./access/AccessHierarchy.sol"); var PlatformFunds = artifacts.require("./ecosystem/PlatformFunds.sol"); var Operators = artifacts.require("./roles/Operators.sol"); var AssetManagerEscrow = artifacts.require("./roles/AssetManagerEscrow.sol"); +var AssetManagerFunds = artifacts.require("./roles/AssetManagerFunds.sol"); var CrowdsaleGeneratorETH = artifacts.require("./crowdsale/CrowdsaleGeneratorETH.sol"); var CrowdsaleETH = artifacts.require("./crowdsale/CrowdsaleETH.sol"); var CrowdsaleGeneratorERC20 = artifacts.require("./crowdsale/CrowdsaleGeneratorERC20.sol"); @@ -145,8 +146,14 @@ module.exports = function(deployer, network, accounts) { console.log('AssetManagerEscrow.sol: ' + escrow.address); cm.addContract('AssetManagerEscrow', escrow.address); - return CrowdsaleGeneratorETH.new(db.address); + return AssetManagerFunds.new(db.address); + + }).then(function(instance) { + var managerFunds = instance; + cm.addContract('AssetManagerFunds', managerFunds.address); + return CrowdsaleGeneratorETH.new(db.address); + }).then(function(instance) { crowdsaleGeneratorETH = instance; diff --git a/test/AssetGenerator.js b/test/AssetGenerator.js index a8cb83ee..d30a9de2 100644 --- a/test/AssetGenerator.js +++ b/test/AssetGenerator.js @@ -91,7 +91,7 @@ contract('Asset Generator', async() => { await burner.setFee('0x4e38c7f4', assetGen.address, 250); }); - it('Give platform burning permission', async() => { + it('Give permission to contract state', async() => { for(var i=1; i { let db; let cm; let hash; + let api; let platform; let assetManagerFee; let operators; @@ -58,6 +60,10 @@ contract('ERC20 Crowdsale', async() => { hash = await HashFunctions.new(db.address); }); + it('Deploy api contract', async() => { + api = await API.new(db.address); + }); + it('Deploy MyB token', async() => { platformToken = await BurnableToken.new('MyBit', tokenSupply); }); @@ -360,8 +366,45 @@ contract('ERC20 Crowdsale', async() => { assert.notEqual(err, undefined); }); + // start funding with 0 assetmanager fee + it('Start funding with no fee', async() => { + assetURI = 'ipfs.io/F3b285ABA9'; + assetManagerFee = 0; + let tx = await crowdsaleGen.createAssetOrderERC20(assetURI, operatorID, 100, 2*ETH, assetManagerFee, erc20.address, {from:assetManager}); + assetID = tx.logs[0].args._assetID; + assetTokenAddress = tx.logs[0].args._tokenAddress; + console.log('Token Address: ' + tokenAddress); + assetToken = await AssetToken.at(assetTokenAddress); + }); - + it('Fully fund no fee asset', async() => { + await erc20.approve(crowdsale.address, 2*ETH, {from:user1}); + let platformWalletBalance = await erc20.balanceOf(owner); + let tx = await crowdsale.buyAssetOrderERC20(assetID, 2*ETH, {from:user1}); + let user1AssetTokens = await assetToken.balanceOf(user1); + let assetTokenSupply = await assetToken.totalSupply() + assert.equal(assetTokenSupply.eq(user1AssetTokens), true); + assert.equal(user1AssetTokens, 2*ETH); + assert.equal(await assetToken.mintingFinished(), true); + assert.equal(await assetToken.balanceOf(assetManager), 0); + assert.equal(await api.crowdsaleFinalized(assetID), true); + // Check payout to platform and operator + console.log(platformWalletBalance); + console.log(await erc20.balanceOf(owner)); + // assert.equal(bn(platformWalletBalance).gt(await erc20.balanceOf(owner)), true); + }); + + it('Fail to create asset with 0 amount to raise', async() => { + let err; + assetURI = 'ipfs.io/F3b285ABCA9'; + assetManagerFee = 12; + try{ + await await crowdsaleGen.createAssetOrderERC20(assetURI, operatorID, 100, 0, assetManagerFee, erc20.address, {from:assetManager}); + } catch(e){ + err = e; + } + assert.notEqual(err, undefined); + }); /* it('Fail to destroy', async() => { diff --git a/test/EthCrowdsale.js b/test/EthCrowdsale.js index 8fb48f75..8c772176 100644 --- a/test/EthCrowdsale.js +++ b/test/EthCrowdsale.js @@ -11,6 +11,7 @@ const Operators = artifacts.require("./roles/Operators.sol"); const HashFunctions = artifacts.require("./test/HashFunctions.sol"); const Pausible = artifacts.require("./ownership/Pausible.sol"); const Platform = artifacts.require("./ecosystem/PlatformFunds.sol"); +const API = artifacts.require("./database/API.sol"); const owner = web3.eth.accounts[0]; @@ -26,7 +27,7 @@ const ETH = 1000000000000000000; const scaling = 1000000000000000000000000000000000000; const tokenSupply = 180000000000000000000000000; const tokenPerAccount = 1000000000000000000000; -const assetManagerFee = 5; +let assetManagerFee = 5; contract('Ether Crowdsale', async() => { @@ -37,6 +38,7 @@ contract('Ether Crowdsale', async() => { let db; let cm; let hash; + let api; let platform; let operators; let operatorID; @@ -59,6 +61,10 @@ contract('Ether Crowdsale', async() => { await db.enableContractManagement(cm.address); }); + it('Deploy api contract', async() => { + api = await API.new(db.address); + }); + it('Deploy MyB token', async() => { platformToken = await PlatformToken.new('MyBit', tokenSupply); }); @@ -325,7 +331,102 @@ contract('Ether Crowdsale', async() => { assert.equal(bn(user3BalanceAfter).isGreaterThan(user3BalanceBefore), true); }); - // TODO: try to create asset with assetManager fee = 0 + //Start successful funding with no manager fee + it('Start funding', async() => { + assetURI = 'Free Management'; + assetManagerFee = 0; + let tx = await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 1, 2*ETH, assetManagerFee, {from:assetManager}); + //console.log(tx.logs[0].args._assetID); + assetID = tx.logs[0].args._assetID; + tokenAddress = tx.logs[0].args._tokenAddress; + token = await Token.at(tokenAddress); + }); + + it('User1 funding', async() => { + let tokenSupply = await token.totalSupply() + console.log('Token Supply: ' + tokenSupply); + let tx = await crowdsale.buyAssetOrderETH(assetID, {from:user1, value:2*ETH}); + let user1Tokens = await token.balanceOf(user1); + console.log(user1Tokens); + console.log(2*ETH); + assert.equal(user1Tokens.eq(2*ETH), true); + assert.equal(await token.mintingFinished(), true); + assert.equal(await token.balanceOf(assetManager), 0); + assert.equal(await api.crowdsaleFinalized(assetID), true); + }); + + + it('Fail funding with 100% manager fee', async() => { + assetURI = 'Free Management'; + assetManagerFee = 100; + let err; + try { let tx = await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 1, 2*ETH, assetManagerFee, {from:assetManager}); } + catch(e) { + err = e; + } + assert.notEqual(err, undefined); + }); + + //Start successful funding with 99% manager fee + it('Start funding', async() => { + assetURI = '99%managementfee.com'; + assetManagerFee = 99; + let tx = await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 10, 2*ETH, assetManagerFee, {from:assetManager}); + //console.log(tx.logs[0].args._assetID); + assetID = tx.logs[0].args._assetID; + tokenAddress = tx.logs[0].args._tokenAddress; + token = await Token.at(tokenAddress); + }); + + + it('user2 funding ', async() => { + let tx = await crowdsale.buyAssetOrderETH(assetID, {from:user2, value:2*ETH}); + let user2Tokens = await token.balanceOf(user2); + let tokenSupply = await token.totalSupply() + assert.equal(user2Tokens.eq(2*ETH), true); + assert.equal(await token.mintingFinished(), true); + assert.equal(await api.crowdsaleFinalized(assetID), true); + }); + + it('Fail asset crowdsale with 0 amount to raise', async() => { + assetURI = 'raisenothing.com'; + assetManagerFee = 42; + let err; + try{ + await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 10, 0, assetManagerFee, {from:assetManager}); + } catch(e){ + err = e; + } + assert.notEqual(err, undefined); + }); + + // amountToRaise == 1 + it('Start funding with small amount to raise', async() => { + assetURI = 'lowgoals.com'; + assetManagerFee = 10; + let tx = await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 10, 1, assetManagerFee, {from:assetManager}); + //console.log(tx.logs[0].args._assetID); + assetID = tx.logs[0].args._assetID; + tokenAddress = tx.logs[0].args._tokenAddress; + token = await Token.at(tokenAddress); + }); + + + it('user3 funding', async() => { + let balanceBefore = web3.eth.getBalance(user3); + let tx = await crowdsale.buyAssetOrderETH(assetID, {from:user3, value:2*ETH, gas: 300000, gasPrice: 1}); + let balanceAfter = web3.eth.getBalance(user3); + console.log(balanceBefore); + console.log(balanceAfter); + let user3Tokens = await token.balanceOf(user3); + let tokenSupply = await token.totalSupply() + assert.equal(user3Tokens.eq(1), true); + assert.equal(await token.mintingFinished(), true); + assert.equal(await api.crowdsaleFinalized(assetID), true); + }); + + + // TODO: try to force integer rounding it('Fail to send money to contract', async() => { let err; diff --git a/test/accounts.json b/test/accounts.json index d41cb65d..61c5f312 100644 --- a/test/accounts.json +++ b/test/accounts.json @@ -1,12 +1,12 @@ [ - "0x13c1cb47836fd4875e4fb0b44627a1ed0babf0b8", - "0xf76f915ae32ad19fd4359b0d1a56328f7beef8be", - "0x0dfb69ce3123487acdd8c6e3ab2e4ce8655b6a6c", - "0xb798b6b56024329e03b211db4c47007a3005eb68", - "0x14a89c951a59131d3e61339501f4a95cf1190efd", - "0x62bcf293e78716718bb79db862dae9ad918e0069", - "0xd72eb39df4b7d974c114f152c90c1919deed3fcc", - "0xc1334b27495bd3edba0815a2b96cab50d4abc3a1", - "0xc513d4bfd54602a931ed0ac7b160c694316e7ec8", - "0x4e8eaf8efa38c6ee6dd0fb1f11def4e6b89c3415" + "0xb60ff3a9b592f2e253c09105bd3bfb30b3a31b82", + "0x081e6792435824de0f305c20e2ec4d8909104f12", + "0x9e48310c94cf753f69339f87a935e7e88e5517fb", + "0x7454d490a99cff50e648bb2766a4b44faa02559e", + "0xd540205de226b091e124a5cae147ee7c0bf6de2d", + "0x7c3962ff10de0ae69384aada12dea0d999d61774", + "0xa5dc6960de49ac2cb08fd464bafcd176599f1a31", + "0xdcb5b8885bf0e485057ca83cfa6526fddb83136a", + "0x11e965d05991c9fe76f9fef57c393f2d8f471d7d", + "0x1bdcd2e21917f56cdbf1338aa52578a1c74d779e" ] \ No newline at end of file diff --git a/test/addresses.json b/test/addresses.json index 2af7b1e8..dfd1d60d 100644 --- a/test/addresses.json +++ b/test/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x5ae411b9e357844d14b294eb7b048c8354352fe5", - "ERC20Burner": "0xf005908c936489fa048b57de05e73d506e6847d9", - "Database": "0x4338b044b042abef639b7b2ee7d55ca9d80a99a8", - "ContractManager": "0x79bae86c52a8f133c557381e9414249b3c901f5c", - "API": "0x56e32cc14dfdf2487d2a9508a2604e132bf40777", - "SingleOwned": "0xee3a88b3f9fa7fdc2754a03575a8095afde95358", - "Pausible": "0xe662b9a79186ef6514231d74b2fa5c47fcadcfb3", - "AccessHierarchy": "0xda46bd6f8f08dd39b90ab4d9f2021567f682f027", - "PlatformFunds": "0xd5c1ef521a285978cfa0e03557587ef1b8a903c8", - "Operators": "0xcdb9de3fbdaa901f6527bab64a9241a3449962dc", - "BrokerEscrow": "0xbb250e9020ba67249a3b97f7cfe5707adc229a0f", - "CrowdsaleETH": "0x38ef661c39a4a2d032694e444764ce480badb7ba", - "CrowdsaleGeneratorETH": "0xa5fe63d97497530da91d45ef502cefe2b7727e14", - "CrowdsaleERC20": "0x362eb4b6cf0e7e3c7f7d9ad673e7814307065979", - "CrowdsaleGeneratorERC20": "0x644a878583340ab68ac895d0432e87ea24729e4e", - "AssetExchange": "0x27c9d6c6843e6a33d347416177cc27f252f8ac3a" -} + "MyBit": "0x485345528a16223ca1e7941e708517d673231f34", + "ERC20Burner": "0x683d96dae5369fd5a939477943cd240593d056dd", + "Database": "0xca6f02942dbd30adc399fd43693069eec08474c9", + "ContractManager": "0x638d9dac81139c5747623ac3f30ae4a672c835f6", + "API": "0x0e8b1e1c96e307da7d985c6fbd9787553339a62b", + "SingleOwned": "0x834e1b4ea85ecc542bf6922dbbb8e98d35bbee10", + "Pausible": "0x2f3117ff50caaedaa2e3d112c93ac71750f40e24", + "AccessHierarchy": "0x1316666fac08997de7f045f3543704b3f5999f37", + "PlatformFunds": "0x3af15375c6f7937c8a65b7730470601a1c1b978b", + "Operators": "0xded6f4f49cbd5db306fe48306002d17b5e362933", + "AssetManagerEscrow": "0x4e663f67c1c87cd50847a19c0b29930a6abd3768", + "CrowdsaleETH": "0x8d07e661c8b8217b3b2ad5ce4b473fddfabf341c", + "CrowdsaleGeneratorETH": "0x5409262bd4c722461df0a087286300e170cee2a9", + "CrowdsaleERC20": "0x00904b61208cc92c3d93e7dd0c7345dfc7883385", + "CrowdsaleGeneratorERC20": "0x9d3ba2880d87796a9681613f24307a1ca4cf66be", + "AssetExchange": "0x5a8d65a59b76917164f8dcf7d9864a856d5acf52" +} \ No newline at end of file From 853e63537148922f890e5ad5fad506cf9be44e87 Mon Sep 17 00:00:00 2001 From: Iggy Grey Date: Thu, 18 Oct 2018 07:13:34 -0700 Subject: [PATCH 03/21] Commented out section in assetmanagerfunds --- test/AssetManagerFunds.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/AssetManagerFunds.js b/test/AssetManagerFunds.js index 763c42cd..af31dcce 100644 --- a/test/AssetManagerFunds.js +++ b/test/AssetManagerFunds.js @@ -219,7 +219,7 @@ contract('AssetManagerFunds', async() => { assert.equal(await divTokenERC20.assetIncome(), 5*ETH); assert.equal(await burnToken.balanceOf(divTokenERC20.address), 5*ETH); }); - +/* it("Add multiple assets", async() => { var number = 41; //We can test multiple assets to find the limit, the limit is 42 (41 + 1 from 'Generate assetID') for(var i=0; i { await testToken.issueDividends(0.1*ETH, {from:operator}); } }); - +*/ it("Withdraw dividends ERC20", async() => { let balanceBefore = await burnToken.balanceOf(user1); let amountOwed = await divTokenERC20.getAmountOwed(user1); From ea2f86d3097645307908c8c05609bf9aec4ff231 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Thu, 18 Oct 2018 16:52:17 +0200 Subject: [PATCH 04/21] migration --- accounts.json | 23 +++++++++++------------ addresses.json | 34 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/accounts.json b/accounts.json index 421dc1cf..1954395e 100644 --- a/accounts.json +++ b/accounts.json @@ -1,13 +1,12 @@ [ - "0x590f94438c6b8df412a09f25f5292aac01b4fa09", - "0x32ff587b8ca6300294d622098915b1afb8982829", - "0xdae8399289fd74bda66fa98bd1859c68134e2567", - "0x0ba2ee5b570ff955d927925cd1a6c31c1909e246", - "0xfd6133bf620f2dbdb8c45a922f740da3b357302e", - "0xe81747b29b6633578c02f487c965096bf6a73565", - "0x1670bc8b5229b651340a24ef6799c3a9f46e89c5", - "0xbc28f186d3114c1387f4b1839731773b656f5f93", - "0x75aef1f5dadbad74ec778a84d729ee30c2cd46b1", - "0x6f47a67f1374c49ce6392a668c049a63e340ff8b" - -] + "0xeed17b217b1e0c63b1b525d8d2e59cad0546432d", + "0x0ec0e59bd4faf0a136c2ee638f3fcff19972a304", + "0xe273d3d13d69f82b8071365e110e13c0fbde0c59", + "0x4cbe9306228ff003fe5a47fe66f2e3d3162f0f37", + "0x0dcea99d96046de44f1ab2a4bf9b3e21f3ac2924", + "0x8bd581cca82af7cfff8ab46591803fe2f2061218", + "0xd6a41e3da4bdc4a27d5707b08612925347f5934f", + "0xd0702a4258c574ff15df4e65000dbb16843cbd24", + "0xc3dda1fc00ba83300b9ad2d00faa30166fabc657", + "0x45543e02e26442e6c95e3145f7d30a53b284f418" +] \ No newline at end of file diff --git a/addresses.json b/addresses.json index 677fa184..34cf0b5a 100644 --- a/addresses.json +++ b/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0xf45b23cc62e941291481ef5dafcf8a9cde30bf70", - "ERC20Burner": "0xfcaf6c14dc7c9cf79d4db58e6c94c942ae3ad1e1", - "Database": "0x938fae37294e9709121314777dd8ab487867336d", - "ContractManager": "0xfbc85e780ebc7b734796c8688c0bcb97af1fcfc6", - "API": "0xcfc57b6f5c0ff77665a1967bd076e2112dff29ae", - "SingleOwned": "0x509e5492e7566093b5e6a06f191427219499229b", - "Pausible": "0x431be519376d1208740889e169a7cbd008d1fb5a", - "AccessHierarchy": "0x784e5c7357b7c29742e82786adcf7867084f50b3", - "PlatformFunds": "0x35f62aab3aea258cb0f5032b142aa2e28241e44c", - "Operators": "0x341e584c03d74547183c81a48a0314aea7fa054c", - "AssetManagerEscrow": "0xe322c30cf0f108d8136dfbb787f12b7242f137c1", - "CrowdsaleETH": "0xcaaf3d9c402344575dc92b2abd6046fed1cc044d", - "CrowdsaleGeneratorETH": "0xff249a1623a06d475f84d443e67871199e21ab05", - "CrowdsaleERC20": "0xbbbfa52d199804e73838ba2dcae1fc8672defbd5", - "CrowdsaleGeneratorERC20": "0x42084420c41e2e51af12f53530b777ffc3181da3", - "AssetExchange": "0x28c3b5fec46958f8cef0a3bae757f77fbf071d6c" -} + "MyBit": "0x78fc5dc1ee5287444c14a34642bdc451af8178be", + "ERC20Burner": "0xc9a3d6b7d226cee2363492d19937bbb3a3e05b82", + "Database": "0x2286170f0cb3c60ad6a8b88fabb8987b25ec7a1e", + "ContractManager": "0x0e60eb60587de94f4306582fedede4e3503191d6", + "API": "0xecada972a11566e3ac6988ffb57fe446bddca632", + "SingleOwned": "0x8a256c599907f33d9ca834a594d427659731db6f", + "Pausible": "0x8c30d3f48b77b9d739d6feb45713290b32106365", + "AccessHierarchy": "0xd41207d796bf974c91d47e08a86ec1821bb87e20", + "PlatformFunds": "0xf4aac32eb060384d10b6026ade4dbf6a9baa8d32", + "Operators": "0x9d15092f7bf08119532307789495b71d7f2544db", + "AssetManagerEscrow": "0xd0f18fa6eb024bef888e42528e347241f4cf86ab", + "CrowdsaleETH": "0xafc92204765903d1ceb77b7fe9639841526b71b4", + "CrowdsaleGeneratorETH": "0x74680eb658ea7c25ac7289ccebc90108c29cd099", + "CrowdsaleERC20": "0x8c63d34588b0ca236598072b8bc09da7266b8030", + "CrowdsaleGeneratorERC20": "0x5cd47accdd35ccd22e2124e54021b735b022a197", + "AssetExchange": "0xa6377c5b1372a97863453c7b2727c011b83ce889" +} \ No newline at end of file From e9b362fe58eb78bae6f2a282ad5303200218734e Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Thu, 18 Oct 2018 16:54:57 +0200 Subject: [PATCH 05/21] added address.json and accounts.json to gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e13c8ee0..922a7a38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules build -dist \ No newline at end of file +dist +accounts.json +addresses.json From 6a849d7e1458281d5ba8bd0933207e13903c413e Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Thu, 18 Oct 2018 17:25:40 +0200 Subject: [PATCH 06/21] minor change on test --- addresses.json | 32 ++++++++++++++++---------------- test/EthCrowdsale.js | 11 ++++++----- test/accounts.json | 20 ++++++++++---------- test/addresses.json | 32 ++++++++++++++++---------------- 4 files changed, 48 insertions(+), 47 deletions(-) diff --git a/addresses.json b/addresses.json index 34cf0b5a..de12e952 100644 --- a/addresses.json +++ b/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x78fc5dc1ee5287444c14a34642bdc451af8178be", - "ERC20Burner": "0xc9a3d6b7d226cee2363492d19937bbb3a3e05b82", - "Database": "0x2286170f0cb3c60ad6a8b88fabb8987b25ec7a1e", - "ContractManager": "0x0e60eb60587de94f4306582fedede4e3503191d6", - "API": "0xecada972a11566e3ac6988ffb57fe446bddca632", - "SingleOwned": "0x8a256c599907f33d9ca834a594d427659731db6f", - "Pausible": "0x8c30d3f48b77b9d739d6feb45713290b32106365", - "AccessHierarchy": "0xd41207d796bf974c91d47e08a86ec1821bb87e20", - "PlatformFunds": "0xf4aac32eb060384d10b6026ade4dbf6a9baa8d32", - "Operators": "0x9d15092f7bf08119532307789495b71d7f2544db", - "AssetManagerEscrow": "0xd0f18fa6eb024bef888e42528e347241f4cf86ab", - "CrowdsaleETH": "0xafc92204765903d1ceb77b7fe9639841526b71b4", - "CrowdsaleGeneratorETH": "0x74680eb658ea7c25ac7289ccebc90108c29cd099", - "CrowdsaleERC20": "0x8c63d34588b0ca236598072b8bc09da7266b8030", - "CrowdsaleGeneratorERC20": "0x5cd47accdd35ccd22e2124e54021b735b022a197", - "AssetExchange": "0xa6377c5b1372a97863453c7b2727c011b83ce889" + "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" } \ No newline at end of file diff --git a/test/EthCrowdsale.js b/test/EthCrowdsale.js index 8c772176..5e22b5c4 100644 --- a/test/EthCrowdsale.js +++ b/test/EthCrowdsale.js @@ -403,7 +403,7 @@ contract('Ether Crowdsale', async() => { // amountToRaise == 1 it('Start funding with small amount to raise', async() => { assetURI = 'lowgoals.com'; - assetManagerFee = 10; + assetManagerFee = 50; let tx = await crowdsaleGen.createAssetOrderETH(assetURI, operatorID, 10, 1, assetManagerFee, {from:assetManager}); //console.log(tx.logs[0].args._assetID); assetID = tx.logs[0].args._assetID; @@ -412,15 +412,16 @@ contract('Ether Crowdsale', async() => { }); - it('user3 funding', async() => { + // Note it's possible for asset-token supply to be larger than wei received due to rounding error + // This example makes 2 asset tokens, but only receives 1 WEI as it mints a token for the assetmanager + it('user3 funding 1 wei', async() => { let balanceBefore = web3.eth.getBalance(user3); - let tx = await crowdsale.buyAssetOrderETH(assetID, {from:user3, value:2*ETH, gas: 300000, gasPrice: 1}); + let tx = await crowdsale.buyAssetOrderETH(assetID, {from:user3, value:2*ETH}); let balanceAfter = web3.eth.getBalance(user3); - console.log(balanceBefore); - console.log(balanceAfter); let user3Tokens = await token.balanceOf(user3); let tokenSupply = await token.totalSupply() assert.equal(user3Tokens.eq(1), true); + assert.equal(await token.balanceOf(assetManager), 1); assert.equal(await token.mintingFinished(), true); assert.equal(await api.crowdsaleFinalized(assetID), true); }); diff --git a/test/accounts.json b/test/accounts.json index 61c5f312..1954395e 100644 --- a/test/accounts.json +++ b/test/accounts.json @@ -1,12 +1,12 @@ [ - "0xb60ff3a9b592f2e253c09105bd3bfb30b3a31b82", - "0x081e6792435824de0f305c20e2ec4d8909104f12", - "0x9e48310c94cf753f69339f87a935e7e88e5517fb", - "0x7454d490a99cff50e648bb2766a4b44faa02559e", - "0xd540205de226b091e124a5cae147ee7c0bf6de2d", - "0x7c3962ff10de0ae69384aada12dea0d999d61774", - "0xa5dc6960de49ac2cb08fd464bafcd176599f1a31", - "0xdcb5b8885bf0e485057ca83cfa6526fddb83136a", - "0x11e965d05991c9fe76f9fef57c393f2d8f471d7d", - "0x1bdcd2e21917f56cdbf1338aa52578a1c74d779e" + "0xeed17b217b1e0c63b1b525d8d2e59cad0546432d", + "0x0ec0e59bd4faf0a136c2ee638f3fcff19972a304", + "0xe273d3d13d69f82b8071365e110e13c0fbde0c59", + "0x4cbe9306228ff003fe5a47fe66f2e3d3162f0f37", + "0x0dcea99d96046de44f1ab2a4bf9b3e21f3ac2924", + "0x8bd581cca82af7cfff8ab46591803fe2f2061218", + "0xd6a41e3da4bdc4a27d5707b08612925347f5934f", + "0xd0702a4258c574ff15df4e65000dbb16843cbd24", + "0xc3dda1fc00ba83300b9ad2d00faa30166fabc657", + "0x45543e02e26442e6c95e3145f7d30a53b284f418" ] \ No newline at end of file diff --git a/test/addresses.json b/test/addresses.json index dfd1d60d..1e9ab1ef 100644 --- a/test/addresses.json +++ b/test/addresses.json @@ -1,18 +1,18 @@ { - "MyBit": "0x485345528a16223ca1e7941e708517d673231f34", - "ERC20Burner": "0x683d96dae5369fd5a939477943cd240593d056dd", - "Database": "0xca6f02942dbd30adc399fd43693069eec08474c9", - "ContractManager": "0x638d9dac81139c5747623ac3f30ae4a672c835f6", - "API": "0x0e8b1e1c96e307da7d985c6fbd9787553339a62b", - "SingleOwned": "0x834e1b4ea85ecc542bf6922dbbb8e98d35bbee10", - "Pausible": "0x2f3117ff50caaedaa2e3d112c93ac71750f40e24", - "AccessHierarchy": "0x1316666fac08997de7f045f3543704b3f5999f37", - "PlatformFunds": "0x3af15375c6f7937c8a65b7730470601a1c1b978b", - "Operators": "0xded6f4f49cbd5db306fe48306002d17b5e362933", - "AssetManagerEscrow": "0x4e663f67c1c87cd50847a19c0b29930a6abd3768", - "CrowdsaleETH": "0x8d07e661c8b8217b3b2ad5ce4b473fddfabf341c", - "CrowdsaleGeneratorETH": "0x5409262bd4c722461df0a087286300e170cee2a9", - "CrowdsaleERC20": "0x00904b61208cc92c3d93e7dd0c7345dfc7883385", - "CrowdsaleGeneratorERC20": "0x9d3ba2880d87796a9681613f24307a1ca4cf66be", - "AssetExchange": "0x5a8d65a59b76917164f8dcf7d9864a856d5acf52" + "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" } \ No newline at end of file From 7c75a30c3cffee3b17d94deaa73fa36ebd1c92e6 Mon Sep 17 00:00:00 2001 From: Peter Phillips <19808076+PeterMPhillips@users.noreply.github.com> Date: Thu, 18 Oct 2018 11:51:25 -0700 Subject: [PATCH 07/21] Create UpdateProcess.md --- UpdateProcess.md | 151 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 UpdateProcess.md diff --git a/UpdateProcess.md b/UpdateProcess.md new file mode 100644 index 00000000..88dce6e8 --- /dev/null +++ b/UpdateProcess.md @@ -0,0 +1,151 @@ +# Process for updating git repositories and npm packages + +When contracts are added/changed we have to make the following changes to these repositories: +- MyBit-Network.tech +- MyBit-Chain.tech +- network.js +- hello-network + +## 1) Update migrations/export chain: +- Make sure any contracts that need to be deployed on the + local chain are included in *migrations/2_deploy_protocol.js*. + This includes importing the contract, setting a contract variable, + deploying it inside the chain of promises, and exporting the address + into addresses.json + +- In terminal, run: + +```bash +./export_chain ../MyBit-Chain.tech +``` +*substitute ../MyBit-Chain.tech with whataver directory the chain is in* + +- This will also push the changes to the respository if a .git file is present + +## 2) Update lib/index.js and lib/js/: +- If there are any new contracts we need to update the files that export the ABI's + for use by network.js + +- In terminal, run: + +```bash +scripts/prepare_lib.sh +``` + +- This will generate the js files and index.js that will be used in the npm package. + +## 3) Update git: +```bash +git add -u +git add contracts/. +git commit -m "New update description" +git push origin master +``` + +## 4) Publish to NPM: + - If the package is ready to be published, run the following: + +```bash +npm version patch +npm publish --access=public +``` + +## 5) Move to MyBit-Chain.tech directory, and publish to NPM: +```bash +npm version patch +npm publish --access=public +``` +*the chain should already have been pushed to the repository* + +## 6) Move to network.js, update API: +- If you want the new contracts to be exposed by the API you'll need to update + index.js. + +- First you must set up your contract artifacts. Under the section commented + as *//Setup contracts*, create your contract object, e.g.: + +```javascript +var exampleContract = contract(ContractArtifacts.Example); +``` + +- Where 'exampleContract' is the name you'll be referencing when instatiating + contracts in your functions and 'ContractArtifacts.Example' is the variable + exported by @mybit/contracts. 'ContractArtifacts' is what we call @mybit/contracts + when it is imported, and 'Example' is just the file name of the contract + without the file type ('.sol'). + +- Next you'll want to build functions that expose the contract in the API. One + option is to simply instatiate the contract and the return the object. This + will expose all the contract's functions to the end user. For example: + +```javascript +example: async () => { + return await exampleContract.at(Chain.Example()); +} +``` + +- In this example we are just instatiating the contract that exists at Chain.Example(), + which is the address that is generated in *migrations/2_deploy_protocol.js*, which + we ran at the very beginning of this guide. Since we are returning the whole + contract we can call any function inside Example.sol. So if we import network.js + into a script as 'Network' we can call our function like so: + +```javascript +example = await Network.example(); +result = await example.function(parameter); +``` + +- Alternatively, one can expose functions directly in our API. If we go back to + *network.js/index.js* we can make the following function: + +```javascript +someFunction: async (parameter) => { + instance = await exampleContract.at(Chain.Example()); + result = await instance.function(parameter); + return result; +} +``` + +- Now we can access the function directly in our scripts: + +```javascript +result = await Network.someFunction(parameter); +``` + +## 7) Update package.json and publish to NPM: +- Since we are using new npm packages, we need to update the version numbers in + package.json. You can update @mybit/contracts and @mybit/chain to the most recent + versions. + +- Update network.js to git: +```bash +git add -u +git commit -m "Added example function" +git push origin master +``` + +- Now publish on npm: +```bash +npm version patch +npm publish --access=public +``` + +## 8) Update examples in hello-network: +- If you want to show examples and use cases for the new functions you wrote + in the API, you can add them here. + +- After creating examples, update package.json to reference the newest version + of network.js. + +- Then update git: +```bash +git add . +git commit -m "New stuff" +git push origin master +``` + +- Then publish to npm: +```bash +npm version patch +npm publish --access=public +``` From 852c815859548012a938a6d40b13dc743d35761e Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 12:11:11 +0200 Subject: [PATCH 08/21] updating README, removed old documentation --- README.md | 128 +- contracts/README.md | 6 +- contracts/roles/README.md | 17 +- docgen/docs-examples-from-docusaurus/doc1.md | 29 - docgen/docs-examples-from-docusaurus/doc2.md | 7 - docgen/docs-examples-from-docusaurus/doc3.md | 13 - .../exampledoc4.md | 6 - .../exampledoc5.md | 6 - docgen/docs/api_Migrations.md | 6 - docgen/docs/api_access_AccessHierarchy.md | 6 - docgen/docs/api_access_Expirable.md | 6 - docgen/docs/api_access_KYC.md | 6 - .../api_access_UserAccess_AccessHierarchy.md | 6 - .../docs/api_alphacontracts_contracts_API.md | 6 - .../api_alphacontracts_contracts_Asset.md | 6 - .../api_alphacontracts_contracts_AssetBank.md | 6 - ..._alphacontracts_contracts_AssetCreation.md | 6 - ..._alphacontracts_contracts_AssetExchange.md | 6 - ...i_alphacontracts_contracts_AssetManager.md | 6 - ...api_alphacontracts_contracts_AssetToken.md | 6 - ...racts_AssetToken_ApproveAndCallFallBack.md | 6 - ...cts_contracts_AssetToken_ERC20Interface.md | 6 - ...lphacontracts_contracts_ContractManager.md | 6 - .../api_alphacontracts_contracts_Database.md | 6 - ...api_alphacontracts_contracts_FundingHub.md | 6 - ..._alphacontracts_contracts_HashFunctions.md | 6 - ...phacontracts_contracts_InitialVariables.md | 6 - ...api_alphacontracts_contracts_Migrations.md | 6 - ...api_alphacontracts_contracts_MyBitToken.md | 6 - ...racts_MyBitToken_ApproveAndCallFallBack.md | 6 - ...cts_contracts_MyBitToken_ERC20Interface.md | 6 - .../api_alphacontracts_contracts_Owned.md | 6 - .../api_alphacontracts_contracts_SafeMath.md | 6 - .../api_alphacontracts_contracts_Staking.md | 6 - .../docs/api_alphacontracts_contracts_Test.md | 6 - .../api_alphacontracts_contracts_TokenBurn.md | 6 - ...pi_alphacontracts_contracts_TokenEscrow.md | 6 - ...pi_alphacontracts_contracts_TokenFaucet.md | 6 - ...api_alphacontracts_contracts_UserAccess.md | 6 - .../api_alphacontracts_interfaces_Database.md | 6 - ...pi_alphacontracts_interfaces_MyBitToken.md | 6 - ...es_oraclizeAPI_05_OraclizeAddrResolverI.md | 6 - ...cts_interfaces_oraclizeAPI_05_OraclizeI.md | 6 - ...interfaces_oraclizeAPI_05_usingOraclize.md | 6 - ...pi_crowdsale_AssetManager_AssetCreation.md | 6 - docgen/docs/api_crowdsale_CrowdsaleERC20.md | 6 - docgen/docs/api_crowdsale_CrowdsaleEther.md | 6 - docgen/docs/api_database_ContractManager.md | 6 - docgen/docs/api_database_Database.md | 6 - docgen/docs/api_database_Events.md | 6 - .../api_distribution_EqualDistribution.md | 6 - .../api_distribution_PlatformDistribution.md | 6 - docgen/docs/api_ecosystem_AssetManager.md | 6 - docgen/docs/api_ecosystem_Manufacturers.md | 6 - docgen/docs/api_interfaces_BurnableERC20.md | 6 - docgen/docs/api_interfaces_Crowdsale.md | 6 - docgen/docs/api_interfaces_Database.md | 6 - docgen/docs/api_interfaces_ERC20.md | 6 - docgen/docs/api_interfaces_PullPayment.md | 6 - docgen/docs/api_math_SafeMath.md | 6 - docgen/docs/api_ownership_MultiOwned.md | 6 - docgen/docs/api_ownership_Pausible.md | 6 - docgen/docs/api_ownership_SingleOwned.md | 6 - .../api_ownership_SingleOwnedClaimable.md | 6 - docgen/docs/api_tokens_ERC20_DetailedERC20.md | 6 - docgen/docs/api_tokens_ERC20_DividendToken.md | 6 - ...20_DividendToken_ApproveAndCallFallBack.md | 6 - docgen/docs/api_tokens_ERC20_MintableToken.md | 6 - docgen/docs/api_tokens_ERC20_SafeERC20.md | 6 - docgen/docs/api_tokens_ERC20_StandardToken.md | 6 - .../api_tokens_ecosystem_CanReclaimToken.md | 6 - .../docs/api_tokens_ecosystem_ERC20Burner.md | 6 - .../docs/api_tokens_ecosystem_RejectTokens.md | 6 - package-lock.json | 1696 ++++++++++++++++- package.json | 3 +- yarn.lock | 136 +- 76 files changed, 1946 insertions(+), 491 deletions(-) delete mode 100644 docgen/docs-examples-from-docusaurus/doc1.md delete mode 100644 docgen/docs-examples-from-docusaurus/doc2.md delete mode 100644 docgen/docs-examples-from-docusaurus/doc3.md delete mode 100644 docgen/docs-examples-from-docusaurus/exampledoc4.md delete mode 100644 docgen/docs-examples-from-docusaurus/exampledoc5.md delete mode 100644 docgen/docs/api_Migrations.md delete mode 100644 docgen/docs/api_access_AccessHierarchy.md delete mode 100644 docgen/docs/api_access_Expirable.md delete mode 100644 docgen/docs/api_access_KYC.md delete mode 100644 docgen/docs/api_access_UserAccess_AccessHierarchy.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_API.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Asset.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetBank.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetCreation.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetExchange.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetManager.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetToken.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetToken_ApproveAndCallFallBack.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_AssetToken_ERC20Interface.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_ContractManager.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Database.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_FundingHub.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_HashFunctions.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_InitialVariables.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Migrations.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_MyBitToken.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_MyBitToken_ApproveAndCallFallBack.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_MyBitToken_ERC20Interface.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Owned.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_SafeMath.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Staking.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_Test.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_TokenBurn.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_TokenEscrow.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_TokenFaucet.md delete mode 100644 docgen/docs/api_alphacontracts_contracts_UserAccess.md delete mode 100644 docgen/docs/api_alphacontracts_interfaces_Database.md delete mode 100644 docgen/docs/api_alphacontracts_interfaces_MyBitToken.md delete mode 100644 docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_OraclizeAddrResolverI.md delete mode 100644 docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.md delete mode 100644 docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.md delete mode 100644 docgen/docs/api_crowdsale_AssetManager_AssetCreation.md delete mode 100644 docgen/docs/api_crowdsale_CrowdsaleERC20.md delete mode 100644 docgen/docs/api_crowdsale_CrowdsaleEther.md delete mode 100644 docgen/docs/api_database_ContractManager.md delete mode 100644 docgen/docs/api_database_Database.md delete mode 100644 docgen/docs/api_database_Events.md delete mode 100644 docgen/docs/api_distribution_EqualDistribution.md delete mode 100644 docgen/docs/api_distribution_PlatformDistribution.md delete mode 100644 docgen/docs/api_ecosystem_AssetManager.md delete mode 100644 docgen/docs/api_ecosystem_Manufacturers.md delete mode 100644 docgen/docs/api_interfaces_BurnableERC20.md delete mode 100644 docgen/docs/api_interfaces_Crowdsale.md delete mode 100644 docgen/docs/api_interfaces_Database.md delete mode 100644 docgen/docs/api_interfaces_ERC20.md delete mode 100644 docgen/docs/api_interfaces_PullPayment.md delete mode 100644 docgen/docs/api_math_SafeMath.md delete mode 100644 docgen/docs/api_ownership_MultiOwned.md delete mode 100644 docgen/docs/api_ownership_Pausible.md delete mode 100644 docgen/docs/api_ownership_SingleOwned.md delete mode 100644 docgen/docs/api_ownership_SingleOwnedClaimable.md delete mode 100644 docgen/docs/api_tokens_ERC20_DetailedERC20.md delete mode 100644 docgen/docs/api_tokens_ERC20_DividendToken.md delete mode 100644 docgen/docs/api_tokens_ERC20_DividendToken_ApproveAndCallFallBack.md delete mode 100644 docgen/docs/api_tokens_ERC20_MintableToken.md delete mode 100644 docgen/docs/api_tokens_ERC20_SafeERC20.md delete mode 100644 docgen/docs/api_tokens_ERC20_StandardToken.md delete mode 100644 docgen/docs/api_tokens_ecosystem_CanReclaimToken.md delete mode 100644 docgen/docs/api_tokens_ecosystem_ERC20Burner.md delete mode 100644 docgen/docs/api_tokens_ecosystem_RejectTokens.md diff --git a/README.md b/README.md index 4b478704..8ac27933 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- MyBit Logo + MyBit Logo

@@ -11,62 +11,130 @@ A software development kit for the automated machine economy. -The SDK's contain a local blockchain and smart-contracts for developers to run and deploy dapps that allow for the funding and distribution of virtual assets represented by ERC tokens on the Ethereum blockchain. The contracts can be combined in different ways to customize the crowdfunding and re-distribution details, or plug into a local MyBitChain to test already operating assets. +The SDK's contain contracts that can be deployed to create varied decentralized asset management platforms. The contracts enable for the crowdsale of digital assets, which are represented as ERC20 dividend tokens. Crowdsales can receive ETH or ERC20 tokens, depending on the preferences of the operator and asset dividends can be paid in ETH or ERC20 tokens depending on the preferences of the investors. + ## Getting Started +First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable): -## Roles -The tokenized asset management structure is made up of different actors who have specific incentives to participate in the creation and management of tokenized assets within the ecosystem. The assets are managed by the AssetManager, who receives a fee for his work and escrows tokens as collateral to investors. The tokens remain in escrow until the asset tokens returns sufficient income. The platform owners can choose how assets are governed, whether by asset token holders or designated ownership roles. +```bash +yarn +``` -AssetManagers interact with the AssetManagerEscrow, AssetManagerFunds and Crowdsale Generators contracts, while Investors interact with the Crowdsale and DividendTokens contracts. +You should see an output similar to below: -#### Platform Owner(s) -The owners of the platform are in charge of deciding high level upgrades and authorization changes made in the platform. Ownership can be decided by one owner, a multi-sig, or token holders themselves. +``` +[1/4] Resolving packages... +[2/4] Fetching packages... +[3/4] Linking dependencies... +[4/4] Building fresh packages... +Done in 0.66s. +``` -#### Investor -The investor is any user that holds asset tokens through participating in an asset crowdsale or by means of purchasing them on an exchange. +Then get a local test blockchain running using [Ganache](https://truffleframework.com/ganache) -#### AssetManager -The AssetManager is a user that initiates a crowdfunding period for an asset. After the funding period, the AssetManager is in charge of handling real world operations between the asset operator and the investors. The role of the AssetManager varies depending on the type of asset, but they are responsible for the asset operating properly if the conditions allow it. The AssetManager can put down tokens in escrow, which is at stake to get burned if the owners of the asset find negligence. +```bash +yarn blockchain +```` -#### Operator -The operator is the producer of the asset, physical or digital. They are in charge of receiving the crowdfunding funds and producing, delivering and installing the asset. AssetManagers will deal with Operators to ensure continued functioning of the asset. +You should see 20 accounts load up and see the local chain info: +``` +HD Wallet +================== +Mnemonic: fetch detect turtle medal cabin desk dish quality swap call shaft curtain +Base HD Path: m/44'/60'/0'/0/{account_index} -✏️ All contracts are written in [Solidity](https://solidity.readthedocs.io/en/v0.4.24/) version 0.4.24. +Gas Price +================== +20000000000 +Gas Limit +================== +6721975 -## Setup +Listening on 127.0.0.1:8545 +``` -Install dependencies. -`yarn` +If you see this error: -## Testing +``` +Error: listen EADDRINUSE 127.0.0.1:8545 + at Server.setupListenHandle [as _listen2] (net.js:1360:14) + at listenInCluster (net.js:1401:12) + at doListen (net.js:1510:7) + at _combinedTickCallback (internal/process/next_tick.js:142:11) + at process._tickCallback (internal/process/next_tick.js:181:9) + at Function.Module.runMain (module.js:696:11) + at startup (bootstrap_node.js:204:16) + at bootstrap_node.js:625:3 +error Command failed with exit code 1. +``` +You need to first close any other processes that are using this port and start (ie. Geth, Parity, Ganache-cli, TestRPC etc..) -Bootstrap [Ganache](https://truffleframework.com/ganache) -`yarn blockchain` +You can now run the tests: +``` +yarn tests +``` -Run tests +You can run code-coverage tests: +``` +yarn coverage +``` -`yarn test` +## [Contracts](contracts) +The contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the [erc20 burner](contracts/access/ERC20Burner.sol) -## Compiling +### [Database](contracts/database) +Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: -`yarn compile` +Storing an unsigned integer looks like this: +```javascript + database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), 20000000); +``` + +The database then stores this with the function. `key = sha3("fundingDeadline", assetID)`, `value = tokenAddress` +```javascript +function setUint(bytes32 _key, address _value) +onlyApprovedContract +external { + uintStorage[_key] = _value; +} +``` + +The [API](contracts/database/API.sol) can be used to easily fetch variables from the database +```javascript + function getAssetFundingDeadline(bytes32 _assetID) + public + view + returns(uint) { + uint fundingDeadline = database.uintStorage(keccak256(abi.encodePacked("fundingDeadline", _assetID))); + return fundingDeadline; + } +``` + +### [Access](contracts/access) -## Code Coverage -Download solidity-coverage locally +## [Roles](contracts/roles) +The MYB SDK's have 4 fundamental roles: + +* Investor +* AssetManager +* Operator +* Platform Owner(s) + +Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. + + + +✏️ All contracts are written in [Solidity](https://solidity.readthedocs.io/en/v0.4.24/) version 0.4.24. -`npm install --save-dev solidity-coverage` -Run solidity-coverage -`./node_modules/.bin/solidity-coverage` -Coverage reports can be accessed at 'coverage/index.html' ## Documentation diff --git a/contracts/README.md b/contracts/README.md index 12254d73..04ed183e 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -7,10 +7,10 @@ MyBit SDK allows developers to create personalized platforms which create and di ## Contract Categories -### Access -Access is where user access is managed. KYC restrictions can be applied across the platform using KYC.sol. Requirements can be set here, restricting access to users who can probably burn platform tokens, or pay for a time-based subscription. +### [Access](access) +Access is where user access is managed. KYC access restriction can be applied to users who can probably burn platform tokens, or pay for a time-based subscription. -### Crowdsale +### [Crowdsale](crowdsale) In the crowdsale folder you can find all the contracts involved in funding new assets. Funds can be received in either Ether or any ERC20 token the operator agrees to accept. Each base unit of the received tokens or Wei represent 1 share of the asset. The total supply of each asset is determined by the amount raised plus the Asset Managers fee. ### Database diff --git a/contracts/roles/README.md b/contracts/roles/README.md index bf65aac9..fc8e9572 100644 --- a/contracts/roles/README.md +++ b/contracts/roles/README.md @@ -9,4 +9,19 @@ THe AssetManagerFunds are where the dividends belonging to the AssetManager are The AssetManagerEscrow contract accepts MYB tokens to be held in escrow in order to align the assetManager's incentives with investors. If an asset is not distributing returns, investors can vote to burn the assetManager's MYB placed in escrow. If the asset does give ROI, the assetManager's escrow funds are returned relative to the ROI earned. If the asset is governed, the owners of the asset-tokens can vote to change the AssetManager here. ### Operators -This contract is used the platform owner to onboard new operators. An operator ID is needed for any new asset crowdsales to be created. Operators can choose if they wish to receive Ether and/or ERC20 tokens of their choosing. +This contract is used the platform owner to onboard new operators. An operator ID is needed for any new asset crowdsales to be created. Operators can choose if they wish to receive Ether and/or ERC20 tokens of their choosing. + + +## General roles + +#### Platform Owner(s) +The owners of the platform are in charge of deciding high level upgrades and authorization changes made in the platform. Ownership can be decided by one owner, a multi-sig, or token holders themselves. + +#### Investor +The investor is any user that holds asset tokens through participating in an asset crowdsale or by means of purchasing them on an exchange. + +#### AssetManager +The AssetManager is a user that initiates a crowdfunding period for an asset. After the funding period, the AssetManager is in charge of handling real world operations between the asset operator and the investors. The role of the AssetManager varies depending on the type of asset, but they are responsible for the asset operating properly if the conditions allow it. The AssetManager can put down tokens in escrow, which is at stake to get burned if the owners of the asset find negligence. + +#### Operator +The operator is the producer of the asset, physical or digital. They are in charge of receiving the crowdfunding funds and producing, delivering and installing the asset. AssetManagers will deal with Operators to ensure continued functioning of the asset. diff --git a/docgen/docs-examples-from-docusaurus/doc1.md b/docgen/docs-examples-from-docusaurus/doc1.md deleted file mode 100644 index 37fa73f8..00000000 --- a/docgen/docs-examples-from-docusaurus/doc1.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -id: doc1 -title: Latin-ish -sidebar_label: Example Page ---- - -Check the [documentation](https://docusaurus.io) for how to use Docusaurus. - -## Lorem - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus elementum massa eget nulla aliquet sagittis. Proin odio tortor, vulputate ut odio in, ultrices ultricies augue. Cras ornare ultrices lorem malesuada iaculis. Etiam sit amet libero tempor, pulvinar mauris sed, sollicitudin sapien. - -## Mauris In Code - -``` -Mauris vestibulum ullamcorper nibh, ut semper purus pulvinar ut. Donec volutpat orci sit amet mauris malesuada, non pulvinar augue aliquam. Vestibulum ultricies at urna ut suscipit. Morbi iaculis, erat at imperdiet semper, ipsum nulla sodales erat, eget tincidunt justo dui quis justo. Pellentesque dictum bibendum diam at aliquet. Sed pulvinar, dolor quis finibus ornare, eros odio facilisis erat, eu rhoncus nunc dui sed ex. Nunc gravida dui massa, sed ornare arcu tincidunt sit amet. Maecenas efficitur sapien neque, a laoreet libero feugiat ut. -``` - -## Nulla - -Nulla facilisi. Maecenas sodales nec purus eget posuere. Sed sapien quam, pretium a risus in, porttitor dapibus erat. Sed sit amet fringilla ipsum, eget iaculis augue. Integer sollicitudin tortor quis ultricies aliquam. Suspendisse fringilla nunc in tellus cursus, at placerat tellus scelerisque. Sed tempus elit a sollicitudin rhoncus. Nulla facilisi. Morbi nec dolor dolor. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras et aliquet lectus. Pellentesque sit amet eros nisi. Quisque ac sapien in sapien congue accumsan. Nullam in posuere ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin lacinia leo a nibh fringilla pharetra. - -## Orci - -Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin venenatis lectus dui, vel ultrices ante bibendum hendrerit. Aenean egestas feugiat dui id hendrerit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur in tellus laoreet, eleifend nunc id, viverra leo. Proin vulputate non dolor vel vulputate. Curabitur pretium lobortis felis, sit amet finibus lorem suscipit ut. Sed non mollis risus. Duis sagittis, mi in euismod tincidunt, nunc mauris vestibulum urna, at euismod est elit quis erat. Phasellus accumsan vitae neque eu placerat. In elementum arcu nec tellus imperdiet, eget maximus nulla sodales. Curabitur eu sapien eget nisl sodales fermentum. - -## Phasellus - -Phasellus pulvinar ex id commodo imperdiet. Praesent odio nibh, sollicitudin sit amet faucibus id, placerat at metus. Donec vitae eros vitae tortor hendrerit finibus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Quisque vitae purus dolor. Duis suscipit ac nulla et finibus. Phasellus ac sem sed dui dictum gravida. Phasellus eleifend vestibulum facilisis. Integer pharetra nec enim vitae mattis. Duis auctor, lectus quis condimentum bibendum, nunc dolor aliquam massa, id bibendum orci velit quis magna. Ut volutpat nulla nunc, sed interdum magna condimentum non. Sed urna metus, scelerisque vitae consectetur a, feugiat quis magna. Donec dignissim ornare nisl, eget tempor risus malesuada quis. diff --git a/docgen/docs-examples-from-docusaurus/doc2.md b/docgen/docs-examples-from-docusaurus/doc2.md deleted file mode 100644 index 20c0c95a..00000000 --- a/docgen/docs-examples-from-docusaurus/doc2.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -id: doc2 -title: document number 2 ---- - -This is a link to [another document.](doc3.md) -This is a link to an [external page.](http://www.example.com) diff --git a/docgen/docs-examples-from-docusaurus/doc3.md b/docgen/docs-examples-from-docusaurus/doc3.md deleted file mode 100644 index bcb9054f..00000000 --- a/docgen/docs-examples-from-docusaurus/doc3.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -id: doc3 -title: This is document number 3 ---- -Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit. - -Duis et egestas libero, imperdiet faucibus ipsum. Sed posuere eget urna vel feugiat. Vivamus a arcu sagittis, fermentum urna dapibus, congue lectus. Fusce vulputate porttitor nisl, ac cursus elit volutpat vitae. Nullam vitae ipsum egestas, convallis quam non, porta nibh. Morbi gravida erat nec neque bibendum, eu pellentesque velit posuere. Fusce aliquam erat eu massa eleifend tristique. - -Sed consequat sollicitudin ipsum eget tempus. Integer a aliquet velit. In justo nibh, pellentesque non suscipit eget, gravida vel lacus. Donec odio ante, malesuada in massa quis, pharetra tristique ligula. Donec eros est, tristique eget finibus quis, semper non nisl. Vivamus et elit nec enim ornare placerat. Sed posuere odio a elit cursus sagittis. - -Phasellus feugiat purus eu tortor ultrices finibus. Ut libero nibh, lobortis et libero nec, dapibus posuere eros. Sed sagittis euismod justo at consectetur. Nulla finibus libero placerat, cursus sapien at, eleifend ligula. Vivamus elit nisl, hendrerit ac nibh eu, ultrices tempus dui. Nam tellus neque, commodo non rhoncus eu, gravida in risus. Nullam id iaculis tortor. - -Nullam at odio in sem varius tempor sit amet vel lorem. Etiam eu hendrerit nisl. Fusce nibh mauris, vulputate sit amet ex vitae, congue rhoncus nisl. Sed eget tellus purus. Nullam tempus commodo erat ut tristique. Cras accumsan massa sit amet justo consequat eleifend. Integer scelerisque vitae tellus id consectetur. diff --git a/docgen/docs-examples-from-docusaurus/exampledoc4.md b/docgen/docs-examples-from-docusaurus/exampledoc4.md deleted file mode 100644 index 6f94ffe9..00000000 --- a/docgen/docs-examples-from-docusaurus/exampledoc4.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: doc4 -title: Other Document ---- - -this is another document diff --git a/docgen/docs-examples-from-docusaurus/exampledoc5.md b/docgen/docs-examples-from-docusaurus/exampledoc5.md deleted file mode 100644 index 92e2d0d5..00000000 --- a/docgen/docs-examples-from-docusaurus/exampledoc5.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: doc5 -title: Fifth Document ---- - -Another one diff --git a/docgen/docs/api_Migrations.md b/docgen/docs/api_Migrations.md deleted file mode 100644 index f395aca2..00000000 --- a/docgen/docs/api_Migrations.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: Migrations -title: Migrations ---- - -

contract Migrations

Reference

Modifiers

  • restricted

    modifier restricted() 

Functions

  • fallback

    function () public 
  • setCompleted

    function setCompleted(uint completed) public 
    Modifiers:
    restricted 
    Parameters:
    completed - uint
  • upgrade

    function upgrade(address new_address) public 
    Modifiers:
    restricted 
    Parameters:
    new_address - address
diff --git a/docgen/docs/api_access_AccessHierarchy.md b/docgen/docs/api_access_AccessHierarchy.md deleted file mode 100644 index d8fca9d3..00000000 --- a/docgen/docs/api_access_AccessHierarchy.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: access_AccessHierarchy -title: AccessHierarchy ---- - -

contract AccessHierarchy

Reference

Events

  • 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

  • noEmptyAddress

    modifier noEmptyAddress(address _param) 
    Parameters:
    _param - address
  • onlyOwner

    modifier onlyOwner() 
  • onlyPlatform

    modifier onlyPlatform() 

Functions

  • approveUser

    function approveUser(address _newUser, uint _accessLevel) public returns  (bool) 
    Modifiers:
    onlyPlatform noEmptyAddress 
    Parameters:
    _newUser - address
    _accessLevel - uint
    Returns:
    bool
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • removeUser

    function removeUser(address _user) public returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
  • setUpperAccessLevel

    function setUpperAccessLevel(uint8 _newUpperLimit) public 
    Modifiers:
    onlyOwner 
    Parameters:
    _newUpperLimit - uint8
diff --git a/docgen/docs/api_access_Expirable.md b/docgen/docs/api_access_Expirable.md deleted file mode 100644 index 8afd8756..00000000 --- a/docgen/docs/api_access_Expirable.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: access_Expirable -title: Expirable ---- - -

contract Expirable

is AccessHierarchy

Reference

Events

  • LogExpirationLengthChanged

    event LogExpirationLengthChanged(uint _oldExpirationLength, uint _newExpirationLength) 
    Parameters:
    _oldExpirationLength - uint
    _newExpirationLength - uint

Functions

  • approveTemporaryUser

    function approveTemporaryUser(address _newUser, uint _accessLevel) public returns  (bool) 
    Modifiers:
    onlyOwner noEmptyAddress 
    Parameters:
    _newUser - address
    _accessLevel - uint
    Returns:
    bool
  • changeExpirationLength

    function changeExpirationLength(uint _newExpirationLength) external 
    Modifiers:
    onlyOwner 
    Parameters:
    _newExpirationLength - uint
  • removeTemporaryUser

    function removeTemporaryUser(address _user) public returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
diff --git a/docgen/docs/api_access_KYC.md b/docgen/docs/api_access_KYC.md deleted file mode 100644 index b8886f99..00000000 --- a/docgen/docs/api_access_KYC.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: access_KYC -title: KYC ---- - -

contract KYC

is AccessHierarchy

Reference

Events

  • LogKYCApproved

    event LogKYCApproved(address _owner, address _user) 
    Parameters:
    _owner - address
    _user - address

Functions

  • approveKYC

    function approveKYC(address _user) external returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
  • revokeKYC

    function revokeKYC(address _user) external returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
diff --git a/docgen/docs/api_access_UserAccess_AccessHierarchy.md b/docgen/docs/api_access_UserAccess_AccessHierarchy.md deleted file mode 100644 index a835d4ef..00000000 --- a/docgen/docs/api_access_UserAccess_AccessHierarchy.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: access_UserAccess_AccessHierarchy -title: AccessHierarchy ---- - -

contract AccessHierarchy

is SingleOwned

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

  • noEmptyAddress

    modifier noEmptyAddress(address _param) 
    Parameters:
    _param - address

Functions

  • approveKYC

    function approveKYC(address _user) external returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
  • approveUser

    function approveUser(address _newUser, uint _accessLevel) external returns  (bool) 
    Modifiers:
    onlyOwner noEmptyAddress 
    Parameters:
    _newUser - address
    _accessLevel - uint
    Returns:
    bool
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • removeUser

    function removeUser(address _user) external returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _user - address
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_API.md b/docgen/docs/api_alphacontracts_contracts_API.md deleted file mode 100644 index 50ef7187..00000000 --- a/docgen/docs/api_alphacontracts_contracts_API.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_API -title: API ---- - -

contract API

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 - uint
    Returns:
    uint
  • amountRaised

    function amountRaised(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • amountToBeRaised

    function amountToBeRaised(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • assetIncome

    function assetIncome(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • assetManager

    function assetManager(bytes32 _assetID) public view returns  (address) 
    Parameters:
    _assetID - bytes32
    Returns:
    address
  • assetStaker

    function assetStaker(bytes32 _assetID) public view returns  (address) 
    Parameters:
    _assetID - bytes32
    Returns:
    address
  • contractAddress

    function contractAddress(string _name) public view returns  (address) 
    Parameters:
    _name - string
    Returns:
    address
  • contractExists

    function contractExists(address _contractAddress) public view returns  (bool) 
    Parameters:
    _contractAddress - address
    Returns:
    bool
  • depositedMYB

    function depositedMYB(address _manager) public view returns  (uint) 
    Parameters:
    _manager - address
    Returns:
    uint
  • escrowExpiration

    function escrowExpiration(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • escrowedForAsset

    function escrowedForAsset(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • escrowedMYB

    function escrowedMYB(address _manager) public view returns  (uint) 
    Parameters:
    _manager - address
    Returns:
    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 - bytes32
    Returns:
    uint
  • fundingStage

    function fundingStage(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • getAmountOwed

    function getAmountOwed(bytes32 _assetID, address _user) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    _user - address
    Returns:
    uint
  • getFunctionAuthorizationHash

    function getFunctionAuthorizationHash(address _contractAddress, address _signer, string _functionName, bytes32 _agreedParameter) public pure returns  (bytes32) 
    Parameters:
    _contractAddress - address
    _signer - address
    _functionName - string
    _agreedParameter - bytes32
    Returns:
    bytes32
  • installerPercentage

    function installerPercentage() public view returns  (uint) 
    Returns:
    uint
  • isFunctionAuthorized

    function isFunctionAuthorized(bytes32 _functionAuthorizationHash) public view returns  (bool) 
    Parameters:
    _functionAuthorizationHash - bytes32
    Returns:
    bool
  • isOwner

    function isOwner(address _user) public view returns  (bool) 
    Parameters:
    _user - address
    Returns:
    bool
  • isPaused

    function isPaused(address _contractAddress) public view returns  (bool) 
    Parameters:
    _contractAddress - address
    Returns:
    bool
  • lockedForAsset

    function lockedForAsset(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • managerIncome

    function managerIncome(address _manager) public view returns  (uint) 
    Parameters:
    _manager - address
    Returns:
    uint
  • managerPercentage

    function managerPercentage(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    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 - address
    Returns:
    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 - bytes32
    Returns:
    uint
  • stakingExpiration

    function stakingExpiration(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • totalPaidToFunder

    function totalPaidToFunder(bytes32 _assetID, address _funder) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    _funder - address
    Returns:
    uint
  • totalPaidToFunders

    function totalPaidToFunders(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • totalReceived

    function totalReceived(bytes32 _assetID) public view returns  (uint) 
    Parameters:
    _assetID - bytes32
    Returns:
    uint
  • userAccess

    function userAccess(address _user) public view returns  (uint) 
    Parameters:
    _user - address
    Returns:
    uint
diff --git a/docgen/docs/api_alphacontracts_contracts_Asset.md b/docgen/docs/api_alphacontracts_contracts_Asset.md deleted file mode 100644 index 11e89f47..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Asset.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Asset -title: Asset ---- - -

contract Asset

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 
    Parameters:
    _assetIDs - bytes32[]
    Returns:
    bool
  • destroy

    function destroy(address _functionInitiator, address _holdingAddress) public 
    Modifiers:
    anyOwner 
    Parameters:
    _functionInitiator - address
    _holdingAddress - address
  • distributeStakingShare

    function distributeStakingShare(bytes32 _assetID, uint _managerAmount) internal returns  (bool) 
    Parameters:
    _assetID - bytes32
    _managerAmount - uint
    Returns:
    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 atStage 
    Parameters:
    _assetID - bytes32
    _note - bytes32
    Returns:
    bool
  • setManagerIncome

    function setManagerIncome(address _manager, uint _managerAmount) internal returns  (bool) 
    Parameters:
    _manager - address
    _managerAmount - uint
    Returns:
    bool
  • withdraw

    function withdraw(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    whenNotPaused 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • withdrawManagerIncome

    function withdrawManagerIncome(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    atStage 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_AssetBank.md b/docgen/docs/api_alphacontracts_contracts_AssetBank.md deleted file mode 100644 index 4bc59ea7..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetBank.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetBank -title: AssetBank ---- - -

contract AssetBank

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 
    Parameters:
    _assetIDs - bytes32[]
    Returns:
    bool
  • destroy

    function destroy(address _functionInitiator, address _holdingAddress) public 
    Modifiers:
    anyOwner 
    Parameters:
    _functionInitiator - address
    _holdingAddress - address
  • distributeStakingShare

    function distributeStakingShare(bytes32 _assetID, uint _managerAmount) internal returns  (bool) 
    Parameters:
    _assetID - bytes32
    _managerAmount - uint
    Returns:
    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 atStage 
    Parameters:
    _assetID - bytes32
    _note - bytes32
    Returns:
    bool
  • setManagerIncome

    function setManagerIncome(address _manager, uint _managerAmount) internal returns  (bool) 
    Parameters:
    _manager - address
    _managerAmount - uint
    Returns:
    bool
  • withdraw

    function withdraw(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    whenNotPaused 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • withdrawManagerIncome

    function withdrawManagerIncome(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    atStage 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_AssetCreation.md b/docgen/docs/api_alphacontracts_contracts_AssetCreation.md deleted file mode 100644 index 0bcfa45e..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetCreation.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetCreation -title: AssetCreation ---- - -

contract AssetCreation

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 notZero notZero 
    Parameters:
    _myBitFoundationPercentage - uint
    _installerPercentage - uint
    _functionSigner - address
    Returns:
    bool
  • changeFundingTime

    function changeFundingTime(uint _newTimeGivenForFunding) external returns  (bool) 
    Modifiers:
    anyOwner notZero 
    Parameters:
    _newTimeGivenForFunding - uint
    Returns:
    bool
  • destroy

    function destroy(address _functionInitiator, address _holdingAddress) public 
    Modifiers:
    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 - address
    Returns:
    bool
  • newAsset

    function newAsset(uint _amountToBeRaised, uint _managerPercentage, uint _amountToEscrow, bytes32 _installerID, bytes32 _assetType, uint _blockAtCreation, bytes32 _ipfsHash) external returns  (bool) 
    Modifiers:
    whenNotPaused noEmptyBytes noEmptyBytes noEmptyBytes 
    Parameters:
    _amountToBeRaised - uint
    _managerPercentage - uint
    _amountToEscrow - uint
    _installerID - bytes32
    _assetType - bytes32
    _blockAtCreation - uint
    _ipfsHash - bytes32
    Returns:
    bool
  • removeAsset

    function removeAsset(bytes32 _assetID, address _functionSigner) external returns  (bool) 
    Modifiers:
    anyOwner noEmptyBytes whenNotPaused 
    Parameters:
    _assetID - bytes32
    _functionSigner - address
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_AssetExchange.md b/docgen/docs/api_alphacontracts_contracts_AssetExchange.md deleted file mode 100644 index 3f41e72e..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetExchange.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetExchange -title: AssetExchange ---- - -

contract AssetExchange

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 onlyApproved 
    Parameters:
    _assetID - bytes32
    _seller - address
    _amount - uint
    _price - uint
    Returns:
    bool
  • createBuyOrder

    function createBuyOrder(bytes32 _assetID, uint _amount, uint _price) external payable returns  (bool) 
    Modifiers:
    onlyApproved requiresEther aboveZero validAsset 
    Parameters:
    _assetID - bytes32
    _amount - uint
    _price - uint
    Returns:
    bool
  • createSellOrder

    function createSellOrder(bytes32 _assetID, uint _amount, uint _price) external returns  (bool) 
    Modifiers:
    onlyApproved aboveZero validAsset hasEnoughOwnership 
    Parameters:
    _assetID - bytes32
    _amount - uint
    _price - uint
    Returns:
    bool
  • deleteOrder

    function deleteOrder(bytes32 _assetID, uint _amount, uint _price, bool _buyOrder) external returns  (bool) 
    Modifiers:
    onlyApproved 
    Parameters:
    _assetID - bytes32
    _amount - uint
    _price - uint
    _buyOrder - bool
    Returns:
    bool
  • destroy

    function destroy(address _functionInitiator, address _holdingAddress) public 
    Modifiers:
    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 - address
    Returns:
    uint
  • sellAsset

    function sellAsset(bytes32 _assetID, address _buyer, uint _amount, uint _price) public returns  (bool) 
    Modifiers:
    onlyApproved whenNotPaused 
    Parameters:
    _assetID - bytes32
    _buyer - address
    _amount - uint
    _price - uint
    Returns:
    bool
  • tradeOwnershipUnits

    function tradeOwnershipUnits(bytes32 _assetID, address _from, address _to, uint _amount) internal returns  (bool) 
    Parameters:
    _assetID - bytes32
    _from - address
    _to - address
    _amount - uint
    Returns:
    bool
  • withdraw

    function withdraw() external returns  (bool) 
    Modifiers:
    onlyApproved 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 5afe7ba3..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetManager.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetManager -title: AssetManager ---- - -

contract AssetManager

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 
    Parameters:
    _newManager - address
    _assetID - bytes32
    Returns:
    bool
  • unlockEscrow

    function unlockEscrow(bytes32 _assetID) external 
    Modifiers:
    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 6b1e2539..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken -title: AssetToken ---- - -

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 - address
    Returns:
    uint
  • approve

    function approve(address _spender, uint _amount) public returns  (bool) 
    Parameters:
    _spender - address
    _amount - uint
    Returns:
    bool
  • approveAndCall

    function approveAndCall(address _spender, uint _amount, bytes _data) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _spender - address
    _amount - uint
    _data - bytes
    Returns:
    bool
  • balanceOf

    function balanceOf(address _tokenHolder) public view returns  (uint) 
    Parameters:
    _tokenHolder - address
    Returns:
    uint
  • fallback

    function () public payable 
    Modifiers:
    requiresEther 
  • fallback

    function (uint _initialAmount, string _id) public 
    Parameters:
    _initialAmount - uint
    _id - string
  • getOwedDividends

    function getOwedDividends(address _user) public view returns  (uint) 
    Parameters:
    _user - address
    Returns:
    uint
  • totalSupply

    function totalSupply() public view returns  (uint) 
    Returns:
    uint
  • transfer

    function transfer(address _to, uint _amount) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _to - address
    _amount - uint
    Returns:
    bool
  • transferFrom

    function transferFrom(address _from, address _to, uint _amount) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _from - address
    _to - address
    _amount - uint
    Returns:
    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 0e5c2f3e..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetToken_ApproveAndCallFallBack.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken_ApproveAndCallFallBack -title: ApproveAndCallFallBack ---- - -

contract ApproveAndCallFallBack

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 4787d4a8..00000000 --- a/docgen/docs/api_alphacontracts_contracts_AssetToken_ERC20Interface.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_AssetToken_ERC20Interface -title: ERC20Interface ---- - -

contract ERC20Interface

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 - address
    Returns:
    uint
  • approve

    abstract function approve(address spender, uint tokens) public returns  (bool) 
    Parameters:
    spender - address
    tokens - uint
    Returns:
    bool
  • balanceOf

    abstract function balanceOf(address tokenOwner) public view returns  (uint) 
    Parameters:
    tokenOwner - address
    Returns:
    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 - uint
    Returns:
    bool
  • transferFrom

    abstract function transferFrom(address from, address to, uint tokens) public returns  (bool) 
    Parameters:
    from - address
    to - address
    tokens - uint
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_ContractManager.md b/docgen/docs/api_alphacontracts_contracts_ContractManager.md deleted file mode 100644 index 8a6236e0..00000000 --- a/docgen/docs/api_alphacontracts_contracts_ContractManager.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_ContractManager -title: ContractManager ---- - -

contract ContractManager

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 noEmptyString anyOwner 
    Parameters:
    _name - string
    _contractAddress - address
    _functionSigner - address
  • contractExists

    function contractExists(address _contract) public view returns  (bool) 
    Parameters:
    _contract - address
    Returns:
    bool
  • fallback

    function (address _database) public 
    Modifiers:
    noEmptyAddress 
    Parameters:
    _database - address
  • removeContract

    function removeContract(string _name, address _functionSigner) external 
    Modifiers:
    noEmptyString anyOwner 
    Parameters:
    _name - string
    _functionSigner - address
  • updateContract

    function updateContract(string _name, address _newContractAddress, address _functionSigner) external 
    Modifiers:
    noEmptyAddress 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 b44e45f2..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Database.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Database -title: Database ---- - -

contract Database

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 
    Parameters:
    _key - bytes32
  • deleteBool

    function deleteBool(bytes32 _key) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
  • deleteBytes

    function deleteBytes(bytes32 _key) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
  • deleteBytes32

    function deleteBytes32(bytes32 _key) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
  • deleteInt

    function deleteInt(bytes32 _key) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
  • deleteString

    function deleteString(bytes32 _key) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
  • deleteUint

    function deleteUint(bytes32 _key) external 
    Modifiers:
    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 
    Parameters:
    _key - bytes32
    _value - address
  • setBool

    function setBool(bytes32 _key, bool _value) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
    _value - bool
  • setBytes

    function setBytes(bytes32 _key, bytes _value) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
    _value - bytes
  • setBytes32

    function setBytes32(bytes32 _key, bytes32 _value) external 
    Modifiers:
    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 
    Parameters:
    _key - bytes32
    _value - int
  • setString

    function setString(bytes32 _key, string _value) external 
    Modifiers:
    onlyMyBitContract 
    Parameters:
    _key - bytes32
    _value - string
  • setUint

    function setUint(bytes32 _key, uint _value) external 
    Modifiers:
    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 84f2eeac..00000000 --- a/docgen/docs/api_alphacontracts_contracts_FundingHub.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_FundingHub -title: FundingHub ---- - -

contract FundingHub

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 
    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 whenNotPaused atStage priceUpdated fundingLimit 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • initiateRefund

    function initiateRefund(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    fundingPeriodOver atStage 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • payout

    function payout(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    nonReentrant whenNotPaused atStage 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • refund

    function refund(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    nonReentrant whenNotPaused atStage 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_HashFunctions.md b/docgen/docs/api_alphacontracts_contracts_HashFunctions.md deleted file mode 100644 index 20926533..00000000 --- a/docgen/docs/api_alphacontracts_contracts_HashFunctions.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_HashFunctions -title: HashFunctions ---- - -

contract HashFunctions

Reference

Functions

  • addressHash

    function addressHash(address _param) external pure returns  (bytes32) 
    Parameters:
    _param - address
    Returns:
    bytes32
  • addressUintUint

    function addressUintUint(address _param, uint _paramTwo, uint _paramThree) external pure returns  (bytes32) 
    Parameters:
    _param - address
    _paramTwo - uint
    _paramThree - uint
    Returns:
    bytes32
  • contractHash

    function contractHash(string _name) external pure returns  (bytes32) 
    Parameters:
    _name - string
    Returns:
    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 - bytes32
    Returns:
    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 - bool
    Returns:
    bytes32
  • getStakingID

    function getStakingID(address _staker, uint256 _blockNumber, uint256 _amount) external pure returns  (bytes32) 
    Parameters:
    _staker - address
    _blockNumber - uint256
    _amount - uint256
    Returns:
    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 - address
    Returns:
    bytes32
  • stringBytes

    function stringBytes(string _param, bytes32 _paramTwo) external pure returns  (bytes32) 
    Parameters:
    _param - string
    _paramTwo - bytes32
    Returns:
    bytes32
  • stringBytesAddress

    function stringBytesAddress(string _param, bytes32 _paramTwo, address _paramThree) external pure returns  (bytes32) 
    Parameters:
    _param - string
    _paramTwo - bytes32
    _paramThree - address
    Returns:
    bytes32
  • stringHash

    function stringHash(string _name) external pure returns  (bytes32) 
    Parameters:
    _name - string
    Returns:
    bytes32
  • stringString

    function stringString(string _param, string _paramTwo) external pure returns  (bytes32) 
    Parameters:
    _param - string
    _paramTwo - string
    Returns:
    bytes32
  • stringUint

    function stringUint(string _param, uint _paramTwo) external pure returns  (bytes32) 
    Parameters:
    _param - string
    _paramTwo - uint
    Returns:
    bytes32
  • toBytes

    function toBytes(uint x) external pure returns  (bytes) 
    Parameters:
    x - uint
    Returns:
    bytes
  • uintHash

    function uintHash(uint _param) external pure returns  (bytes32) 
    Parameters:
    _param - uint
    Returns:
    bytes32
  • uintUint

    function uintUint(uint _paramOne, uint _paramTwo) external pure returns  (bytes32) 
    Parameters:
    _paramOne - uint
    _paramTwo - uint
    Returns:
    bytes32
  • uintUintUint

    function uintUintUint(uint _paramOne, uint _paramTwo, uint _paramThree) external pure returns  (bytes32) 
    Parameters:
    _paramOne - uint
    _paramTwo - uint
    _paramThree - uint
    Returns:
    bytes32
diff --git a/docgen/docs/api_alphacontracts_contracts_InitialVariables.md b/docgen/docs/api_alphacontracts_contracts_InitialVariables.md deleted file mode 100644 index d7092ef9..00000000 --- a/docgen/docs/api_alphacontracts_contracts_InitialVariables.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_InitialVariables -title: InitialVariables ---- - -

contract InitialVariables

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 multiSigRequired 
    Parameters:
    _signer - address
    _functionName - string
    _accessLevel - uint
    _newPrice - uint
    Returns:
    bool
  • changeFoundationAddress

    function changeFoundationAddress(address _signer, string _functionName, address _newAddress) external returns  (bool) 
    Modifiers:
    noEmptyAddress anyOwner multiSigRequired 
    Parameters:
    _signer - address
    _functionName - string
    _newAddress - address
    Returns:
    bool
  • changeInstallerEscrowAddress

    function changeInstallerEscrowAddress(address _signer, string _functionName, address _newAddress) external returns  (bool) 
    Modifiers:
    noEmptyAddress anyOwner multiSigRequired 
    Parameters:
    _signer - address
    _functionName - string
    _newAddress - address
    Returns:
    bool
  • changePriceUpdateTimeline

    function changePriceUpdateTimeline(uint _newPriceExpiration) external returns  (bool) 
    Modifiers:
    anyOwner 
    Parameters:
    _newPriceExpiration - uint
    Returns:
    bool
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • setDailyPrices

    function setDailyPrices(uint _ethPrice, uint _mybPrice) external returns  (bool) 
    Modifiers:
    anyOwner 
    Parameters:
    _ethPrice - uint
    _mybPrice - uint
    Returns:
    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 0875fbf7..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Migrations.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Migrations -title: Migrations ---- - -

contract Migrations

Reference

Modifiers

  • restricted

    modifier restricted() 

Functions

  • fallback

    function () public 
  • setCompleted

    function setCompleted(uint completed) public 
    Modifiers:
    restricted 
    Parameters:
    completed - uint
  • upgrade

    function upgrade(address new_address) public 
    Modifiers:
    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 1963ef6b..00000000 --- a/docgen/docs/api_alphacontracts_contracts_MyBitToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken -title: MyBitToken ---- - -

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 - address
    Returns:
    uint
  • approve

    function approve(address _spender, uint _amount) public returns  (bool) 
    Parameters:
    _spender - address
    _amount - uint
    Returns:
    bool
  • approveAndCall

    function approveAndCall(address _spender, uint _amount, bytes _data) public returns  (bool) 
    Parameters:
    _spender - address
    _amount - uint
    _data - bytes
    Returns:
    bool
  • balanceOf

    function balanceOf(address _tokenHolder) public view returns  (uint) 
    Parameters:
    _tokenHolder - address
    Returns:
    uint
  • burn

    function burn(uint _amount) public returns  (bool) 
    Parameters:
    _amount - uint
    Returns:
    bool
  • burnFrom

    function burnFrom(address _from, uint _amount) public returns  (bool) 
    Parameters:
    _from - address
    _amount - uint
    Returns:
    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 - uint
    Returns:
    bool
  • transferFrom

    function transferFrom(address _from, address _to, uint _amount) public returns  (bool) 
    Parameters:
    _from - address
    _to - address
    _amount - uint
    Returns:
    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 ec586a01..00000000 --- a/docgen/docs/api_alphacontracts_contracts_MyBitToken_ApproveAndCallFallBack.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken_ApproveAndCallFallBack -title: ApproveAndCallFallBack ---- - -

contract ApproveAndCallFallBack

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 b41d6167..00000000 --- a/docgen/docs/api_alphacontracts_contracts_MyBitToken_ERC20Interface.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_MyBitToken_ERC20Interface -title: ERC20Interface ---- - -

contract ERC20Interface

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 - address
    Returns:
    uint
  • approve

    abstract function approve(address spender, uint tokens) public returns  (bool) 
    Parameters:
    spender - address
    tokens - uint
    Returns:
    bool
  • balanceOf

    abstract function balanceOf(address tokenOwner) public view returns  (uint) 
    Parameters:
    tokenOwner - address
    Returns:
    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 - uint
    Returns:
    bool
  • transferFrom

    abstract function transferFrom(address from, address to, uint tokens) public returns  (bool) 
    Parameters:
    from - address
    to - address
    tokens - uint
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_Owned.md b/docgen/docs/api_alphacontracts_contracts_Owned.md deleted file mode 100644 index 7e072a41..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Owned.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Owned -title: Owned ---- - -

contract Owned

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 noZeroAddress noZeroAddress 
    Parameters:
    _newOwner - address
    _oldOwner - address
    _functionSigner - address
  • fallback

    function (address _database) public 
    Modifiers:
    noZeroAddress 
    Parameters:
    _database - address
  • pause

    function pause(address _contract) public 
    Modifiers:
    anyOwner noZeroAddress 
    Parameters:
    _contract - address
  • setFunctionAuthorized

    function setFunctionAuthorized(address _contractAddress, string _functionName, bytes32 _beneficiary) external returns  (bool) 
    Modifiers:
    anyOwner 
    Parameters:
    _contractAddress - address
    _functionName - string
    _beneficiary - bytes32
    Returns:
    bool
  • unpause

    function unpause(address _contract) public 
    Modifiers:
    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 667620b9..00000000 --- a/docgen/docs/api_alphacontracts_contracts_SafeMath.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_SafeMath -title: SafeMath ---- - -

library SafeMath

Reference

Functions

  • add

    function add(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • bytesToUint

    function bytesToUint(bytes b) internal pure returns  (uint256) 
    Parameters:
    b - bytes
    Returns:
    uint256
  • div

    function div(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • getFractionalAmount

    function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns  (uint256) 
    Parameters:
    _amount - uint256
    _percentage - uint256
    Returns:
    uint256
  • mul

    function mul(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • sub

    function sub(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
diff --git a/docgen/docs/api_alphacontracts_contracts_Staking.md b/docgen/docs/api_alphacontracts_contracts_Staking.md deleted file mode 100644 index f63278f9..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Staking.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Staking -title: Staking ---- - -

contract Staking

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 
    Parameters:
    _requester - address
    _amount - uint
    _incomeShare - uint
    _managerPercentage - uint
    _amountToBeRaised - uint
    _installerID - bytes32
    _assetType - bytes32
    _blockAtCreation - uint256
    Returns:
    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 - address
    Returns:
    bool
  • requestEscrowLending

    function requestEscrowLending(uint _amount, uint _incomeShare, uint _managerPercentage, uint _amountToBeRaised, bytes32 _installerID, bytes32 _assetType) external returns  (bool) 
    Modifiers:
    accessApproved noEmptyBytes noEmptyBytes 
    Parameters:
    _amount - uint
    _incomeShare - uint
    _managerPercentage - uint
    _amountToBeRaised - uint
    _installerID - bytes32
    _assetType - bytes32
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_Test.md b/docgen/docs/api_alphacontracts_contracts_Test.md deleted file mode 100644 index 692cace5..00000000 --- a/docgen/docs/api_alphacontracts_contracts_Test.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_Test -title: Test ---- - -

contract Test

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 - string
    Returns:
    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 26e982c4..00000000 --- a/docgen/docs/api_alphacontracts_contracts_TokenBurn.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_TokenBurn -title: TokenBurn ---- - -

contract TokenBurn

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 priceUpdated basicVerification 
    Parameters:
    _accessLevelDesired - uint
    Returns:
    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 priceUpdated 
    Parameters:
    _from - address
    _amount - uint
    _token - address
    _accessLevelDesired - bytes
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_TokenEscrow.md b/docgen/docs/api_alphacontracts_contracts_TokenEscrow.md deleted file mode 100644 index 5cb9ac3c..00000000 --- a/docgen/docs/api_alphacontracts_contracts_TokenEscrow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_TokenEscrow -title: TokenEscrow ---- - -

contract TokenEscrow

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 
    Parameters:
    _amount - uint
    Returns:
    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 - bytes
    Returns:
    bool
  • withdraw

    function withdraw(uint _amount) external returns  (bool) 
    Modifiers:
    accessApproved 
    Parameters:
    _amount - uint
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_contracts_TokenFaucet.md b/docgen/docs/api_alphacontracts_contracts_TokenFaucet.md deleted file mode 100644 index c3213dba..00000000 --- a/docgen/docs/api_alphacontracts_contracts_TokenFaucet.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_TokenFaucet -title: TokenFaucet ---- - -

contract TokenFaucet

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 
    Parameters:
    _newPass - bytes32
    Returns:
    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 70211ed5..00000000 --- a/docgen/docs/api_alphacontracts_contracts_UserAccess.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_contracts_UserAccess -title: UserAccess ---- - -

contract UserAccess

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 
    Parameters:
    _user - address
    Returns:
    bool
  • approveUser

    function approveUser(address _newUser, uint _accessLevel) external returns  (bool) 
    Modifiers:
    noEmptyAddress 
    Parameters:
    _newUser - address
    _accessLevel - uint
    Returns:
    bool
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • removeUser

    function removeUser(address _user) external returns  (bool) 
    Modifiers:
    anyOwner 
    Parameters:
    _user - address
    Returns:
    bool
diff --git a/docgen/docs/api_alphacontracts_interfaces_Database.md b/docgen/docs/api_alphacontracts_interfaces_Database.md deleted file mode 100644 index c35d5081..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_Database.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_interfaces_Database -title: Database ---- - -

interface Database

Reference

Functions

  • addressStorage

    abstract function addressStorage(bytes32 _key) external returns  (address) 
    Parameters:
    _key - bytes32
    Returns:
    address
  • boolStorage

    abstract function boolStorage(bytes32 _key) external returns  (bool) 
    Parameters:
    _key - bytes32
    Returns:
    bool
  • bytes32Storage

    abstract function bytes32Storage(bytes32 _key) external returns  (bytes32) 
    Parameters:
    _key - bytes32
    Returns:
    bytes32
  • bytesStorage

    abstract function bytesStorage(bytes32 _key) external returns  (bytes) 
    Parameters:
    _key - bytes32
    Returns:
    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 - bytes32
    Returns:
    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 - bytes32
    Returns:
    string
  • uintStorage

    abstract function uintStorage(bytes32 _key) external returns  (uint) 
    Parameters:
    _key - bytes32
    Returns:
    uint
diff --git a/docgen/docs/api_alphacontracts_interfaces_MyBitToken.md b/docgen/docs/api_alphacontracts_interfaces_MyBitToken.md deleted file mode 100644 index 9821c7c1..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_MyBitToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_interfaces_MyBitToken -title: MyBitToken ---- - -

interface MyBitToken

Reference

Functions

  • allowance

    abstract function allowance(address _owner, address _spender) external returns  (uint) 
    Parameters:
    _owner - address
    _spender - address
    Returns:
    uint
  • approve

    abstract function approve(address _spender, uint _value) external returns  (bool) 
    Parameters:
    _spender - address
    _value - uint
    Returns:
    bool
  • balanceOf

    abstract function balanceOf(address _owner) external returns  (uint) 
    Parameters:
    _owner - address
    Returns:
    uint
  • burn

    abstract function burn(uint _amount) external returns  (bool) 
    Parameters:
    _amount - uint
    Returns:
    bool
  • burnFrom

    abstract function burnFrom(address _from, uint _amount) external returns  (bool) 
    Parameters:
    _from - address
    _amount - uint
    Returns:
    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 - uint
    Returns:
    bool
  • transferFrom

    abstract function transferFrom(address _from, address _to, uint _value) external returns  (bool) 
    Parameters:
    _from - address
    _to - address
    _value - uint
    Returns:
    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 764517b2..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_OraclizeAddrResolverI.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_OraclizeAddrResolverI -title: OraclizeAddrResolverI ---- - -

contract OraclizeAddrResolverI

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 fcae1be3..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_OraclizeI.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_OraclizeI -title: OraclizeI ---- - -

Reference

Functions

  • getPrice

    abstract function getPrice(string _datasource, uint gaslimit) public returns  (uint) 
    Parameters:
    _datasource - string
    gaslimit - uint
    Returns:
    uint
  • getPrice

    abstract function getPrice(string _datasource) public returns  (uint) 
    Parameters:
    _datasource - string
    Returns:
    uint
  • query

    abstract function query(uint _timestamp, string _datasource, string _arg) external payable returns  (bytes32) 
    Parameters:
    _timestamp - uint
    _datasource - string
    _arg - string
    Returns:
    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 - string
    Returns:
    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 - uint
    Returns:
    bytes32
  • queryN

    abstract function queryN(uint _timestamp, string _datasource, bytes _argN) public payable returns  (bytes32) 
    Parameters:
    _timestamp - uint
    _datasource - string
    _argN - bytes
    Returns:
    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 - uint
    Returns:
    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 - uint
    Returns:
    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 f8674bd3..00000000 --- a/docgen/docs/api_alphacontracts_interfaces_oraclizeAPI_05_usingOraclize.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: alphacontracts_interfaces_oraclizeAPI_05_usingOraclize -title: usingOraclize ---- - -

contract usingOraclize

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 - address
    Returns:
    uint
  • indexOf

    function indexOf(string _haystack, string _needle) internal pure returns  (int) 
    Parameters:
    _haystack - string
    _needle - string
    Returns:
    int
  • oraclize_cbAddress

    function oraclize_cbAddress() internal returns  (address) 
    Modifiers:
    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 
    Parameters:
    datasource - string
    gaslimit - uint
    Returns:
    uint
  • oraclize_getPrice

    function oraclize_getPrice(string datasource) internal returns  (uint) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    Returns:
    uint
  • oraclize_query

    function oraclize_query(string datasource, string arg, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    arg - string
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string arg1, string arg2) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    arg1 - string
    arg2 - string
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    timestamp - uint
    datasource - string
    arg1 - string
    arg2 - string
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string arg1, string arg2, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    timestamp - uint
    datasource - string
    arg1 - string
    arg2 - string
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string arg1, string arg2, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    arg1 - string
    arg2 - string
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] argN) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    argN - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] argN) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    argN - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] argN, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    argN - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - string[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] argN) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    argN - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] argN) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    argN - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] argN, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    argN - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, bytes[] args) internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    timestamp - uint
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, bytes[] args, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    args - bytes[]
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(string datasource, string arg) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    datasource - string
    arg - string
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string arg) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    timestamp - uint
    datasource - string
    arg - string
    Returns:
    bytes32
  • oraclize_query

    function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) internal returns  (bytes32) 
    Modifiers:
    oraclizeAPI 
    Parameters:
    timestamp - uint
    datasource - string
    arg - string
    gaslimit - uint
    Returns:
    bytes32
  • oraclize_randomDS_getSessionPubKeyHash

    function oraclize_randomDS_getSessionPubKeyHash() internal returns  (bytes32) 
    Modifiers:
    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 
    Parameters:
    gasPrice - uint
  • oraclize_setNetwork

    function oraclize_setNetwork(uint8 networkID) internal returns  (bool) 
    Parameters:
    networkID - uint8
    Returns:
    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 
    Parameters:
    proofP - byte
  • parseAddr

    function parseAddr(string _a) internal pure returns  (address) 
    Parameters:
    _a - string
    Returns:
    address
  • parseInt

    function parseInt(string _a) internal pure returns  (uint) 
    Parameters:
    _a - string
    Returns:
    uint
  • parseInt

    function parseInt(string _a, uint _b) internal pure returns  (uint) 
    Parameters:
    _a - string
    _b - uint
    Returns:
    uint
  • strCompare

    function strCompare(string _a, string _b) internal pure returns  (int) 
    Parameters:
    _a - string
    _b - string
    Returns:
    int
  • strConcat

    function strConcat(string _a, string _b, string _c) internal pure returns  (string) 
    Parameters:
    _a - string
    _b - string
    _c - string
    Returns:
    string
  • strConcat

    function strConcat(string _a, string _b, string _c, string _d) internal pure returns  (string) 
    Parameters:
    _a - string
    _b - string
    _c - string
    _d - string
    Returns:
    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 - string
    Returns:
    string
  • strConcat

    function strConcat(string _a, string _b) internal pure returns  (string) 
    Parameters:
    _a - string
    _b - string
    Returns:
    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 - uint
    Returns:
    string
diff --git a/docgen/docs/api_crowdsale_AssetManager_AssetCreation.md b/docgen/docs/api_crowdsale_AssetManager_AssetCreation.md deleted file mode 100644 index a85ebb30..00000000 --- a/docgen/docs/api_crowdsale_AssetManager_AssetCreation.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: crowdsale_AssetManager_AssetCreation -title: AssetCreation ---- - -

contract AssetCreation

Reference

Events

  • LogAssetFundingStarted

    event LogAssetFundingStarted(bytes32 _assetID, bytes32 _manufacturerID, bytes32 _assetType, bytes32 _ipfsHash) 
    Parameters:
    _assetID - bytes32
    _manufacturerID - bytes32
    _assetType - bytes32
    _ipfsHash - bytes32
  • LogAssetRemoved

    event LogAssetRemoved(bytes32 _assetID, address _remover) 
    Parameters:
    _assetID - bytes32
    _remover - address
  • 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

  • onlyOwner

    modifier onlyOwner() 
  • whenNotPaused

    modifier whenNotPaused() 

Functions

  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • removeAsset

    function removeAsset(bytes32 _assetID, address _functionSigner) external returns  (bool) 
    Modifiers:
    onlyOwner whenNotPaused 
    Parameters:
    _assetID - bytes32
    _functionSigner - address
    Returns:
    bool
diff --git a/docgen/docs/api_crowdsale_CrowdsaleERC20.md b/docgen/docs/api_crowdsale_CrowdsaleERC20.md deleted file mode 100644 index bd79a03e..00000000 --- a/docgen/docs/api_crowdsale_CrowdsaleERC20.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: crowdsale_CrowdsaleERC20 -title: CrowdsaleERC20 ---- - -

contract CrowdsaleERC20

is Crowdsale

Reference

Events

  • LogAssetFundingStarted

    event LogAssetFundingStarted(bytes32 _assetID, address _broker, string _tokenURI) 
    Parameters:
    _assetID - bytes32
    _broker - address
    _tokenURI - string
  • LogAssetPayout

    event LogAssetPayout(bytes32 _assetID, address _distributionContract, uint _amount) 
    Parameters:
    _assetID - bytes32
    _distributionContract - address
    _amount - uint
  • LogAssetPurchased

    event LogAssetPurchased(bytes32 _assetID, address _sender, uint _amount) 
    Parameters:
    _assetID - bytes32
    _sender - address
    _amount - uint
  • LogDestruction

    event LogDestruction(uint _amountSent, address _caller) 
    Parameters:
    _amountSent - uint
    _caller - address
  • LogRefund

    event LogRefund(bytes32 _assetID, address _funder, uint _amount) 
    Parameters:
    _assetID - bytes32
    _funder - address
    _amount - uint

Modifiers

  • afterDeadline

    modifier afterDeadline(bytes32 _assetID) 
    Parameters:
    _assetID - bytes32
  • beforeDeadline

    modifier beforeDeadline(bytes32 _assetID) 
    Parameters:
    _assetID - bytes32
  • onlyOwner

    modifier onlyOwner() 
  • requiresEther

    modifier requiresEther() 
  • whenNotPaused

    modifier whenNotPaused() 

Functions

  • buyAsset

    function buyAsset(bytes32 _assetID) external payable returns  (bool) 
    Modifiers:
    requiresEther beforeDeadline 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • destroy

    function destroy() public 
    Modifiers:
    onlyOwner 
  • fallback

    function () public payable 
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • payout

    function payout(bytes32 _assetID, uint _amount) internal returns  (bool) 
    Modifiers:
    whenNotPaused 
    Parameters:
    _assetID - bytes32
    _amount - uint
    Returns:
    bool
  • refund

    function refund(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    whenNotPaused afterDeadline 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • startFundingPeriod

    function startFundingPeriod(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise) external returns  (bool) 
    Parameters:
    _assetURI - string
    _operatorID - bytes32
    _fundingLength - uint
    _amountToRaise - uint
    Returns:
    bool
diff --git a/docgen/docs/api_crowdsale_CrowdsaleEther.md b/docgen/docs/api_crowdsale_CrowdsaleEther.md deleted file mode 100644 index 32cef9ab..00000000 --- a/docgen/docs/api_crowdsale_CrowdsaleEther.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: crowdsale_CrowdsaleEther -title: CrowdsaleEther ---- - -

contract CrowdsaleEther

is Crowdsale

Reference

Events

  • LogAssetFundingStarted

    event LogAssetFundingStarted(bytes32 _assetID, address _broker, string _tokenURI) 
    Parameters:
    _assetID - bytes32
    _broker - address
    _tokenURI - string
  • LogAssetPayout

    event LogAssetPayout(bytes32 _assetID, address _distributionContract, uint _amount) 
    Parameters:
    _assetID - bytes32
    _distributionContract - address
    _amount - uint
  • LogAssetPurchased

    event LogAssetPurchased(bytes32 _assetID, address _sender, uint _amount) 
    Parameters:
    _assetID - bytes32
    _sender - address
    _amount - uint
  • LogDestruction

    event LogDestruction(uint _amountSent, address _caller) 
    Parameters:
    _amountSent - uint
    _caller - address
  • LogRefund

    event LogRefund(bytes32 _assetID, address _funder, uint _amount) 
    Parameters:
    _assetID - bytes32
    _funder - address
    _amount - uint

Modifiers

  • afterDeadline

    modifier afterDeadline(bytes32 _assetID) 
    Parameters:
    _assetID - bytes32
  • beforeDeadline

    modifier beforeDeadline(bytes32 _assetID) 
    Parameters:
    _assetID - bytes32
  • onlyOwner

    modifier onlyOwner() 
  • requiresEther

    modifier requiresEther() 
  • whenNotPaused

    modifier whenNotPaused() 

Functions

  • buyAsset

    function buyAsset(bytes32 _assetID) external payable returns  (bool) 
    Modifiers:
    requiresEther beforeDeadline 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • destroy

    function destroy() public 
    Modifiers:
    onlyOwner 
  • fallback

    function () public payable 
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • payout

    function payout(bytes32 _assetID, uint _amount) internal returns  (bool) 
    Modifiers:
    whenNotPaused 
    Parameters:
    _assetID - bytes32
    _amount - uint
    Returns:
    bool
  • refund

    function refund(bytes32 _assetID) external returns  (bool) 
    Modifiers:
    whenNotPaused afterDeadline 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • startFundingPeriod

    function startFundingPeriod(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise) external returns  (bool) 
    Parameters:
    _assetURI - string
    _operatorID - bytes32
    _fundingLength - uint
    _amountToRaise - uint
    Returns:
    bool
diff --git a/docgen/docs/api_database_ContractManager.md b/docgen/docs/api_database_ContractManager.md deleted file mode 100644 index 4b760360..00000000 --- a/docgen/docs/api_database_ContractManager.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: database_ContractManager -title: ContractManager ---- - -

contract ContractManager

Reference

Events

  • LogContractAdded

    event LogContractAdded(address _contractAddress, string _name, uint _blockNumber) 
    Parameters:
    _contractAddress - address
    _name - string
    _blockNumber - uint
  • LogContractRemoved

    event LogContractRemoved(address contractToDelete, string _name, uint _blockNumber) 
    Parameters:
    contractToDelete - address
    _name - string
    _blockNumber - uint
  • LogContractUpdated

    event LogContractUpdated(address oldAddress, string _name, uint _blockNumber) 
    Parameters:
    oldAddress - address
    _name - string
    _blockNumber - uint
  • LogNewContractLocation

    event LogNewContractLocation(address _contractAddress, string _name, uint _blockNumber) 
    Parameters:
    _contractAddress - address
    _name - string
    _blockNumber - uint

Modifiers

  • anyOwner

    modifier anyOwner() 
  • noEmptyAddress

    modifier noEmptyAddress(address _contract) 
    Parameters:
    _contract - address
  • noEmptyString

    modifier noEmptyString(string _name) 
    Parameters:
    _name - string

Functions

  • addContract

    function addContract(string _name, address _contractAddress) external 
    Modifiers:
    noEmptyAddress noEmptyString anyOwner 
    Parameters:
    _name - string
    _contractAddress - address
  • contractExists

    function contractExists(address _contract) public view returns  (bool) 
    Parameters:
    _contract - address
    Returns:
    bool
  • fallback

    function (address _database) public 
    Modifiers:
    noEmptyAddress 
    Parameters:
    _database - address
  • removeContract

    function removeContract(string _name) external 
    Modifiers:
    noEmptyString anyOwner 
    Parameters:
    _name - string
  • updateContract

    function updateContract(string _name, address _newContractAddress) external 
    Modifiers:
    noEmptyAddress anyOwner 
    Parameters:
    _name - string
    _newContractAddress - address
diff --git a/docgen/docs/api_database_Database.md b/docgen/docs/api_database_Database.md deleted file mode 100644 index effe399d..00000000 --- a/docgen/docs/api_database_Database.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: database_Database -title: Database ---- - -

contract Database

Reference

Events

  • LogInitialized

    event LogInitialized(address _owner, bool _upgradeable) 
    Parameters:
    _owner - address
    _upgradeable - bool

Modifiers

  • onlyApprovedContract

    modifier onlyApprovedContract() 

Functions

  • deleteAddress

    function deleteAddress(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteBool

    function deleteBool(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteBytes

    function deleteBytes(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteBytes32

    function deleteBytes32(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteInt

    function deleteInt(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteString

    function deleteString(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • deleteUint

    function deleteUint(bytes32 _key) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
  • enableContractManagement

    function enableContractManagement(address _contractManager) external 
    Parameters:
    _contractManager - address
  • fallback

    function (address[] _owners, bool _upgradeable) public 
    Parameters:
    _owners - address[]
    _upgradeable - bool
  • setAddress

    function setAddress(bytes32 _key, address _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - address
  • setBool

    function setBool(bytes32 _key, bool _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - bool
  • setBytes

    function setBytes(bytes32 _key, bytes _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - bytes
  • setBytes32

    function setBytes32(bytes32 _key, bytes32 _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - bytes32
  • setInt

    function setInt(bytes32 _key, int _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - int
  • setString

    function setString(bytes32 _key, string _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - string
  • setUint

    function setUint(bytes32 _key, uint _value) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _key - bytes32
    _value - uint
diff --git a/docgen/docs/api_database_Events.md b/docgen/docs/api_database_Events.md deleted file mode 100644 index bf6c2077..00000000 --- a/docgen/docs/api_database_Events.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: database_Events -title: Events ---- - -

contract Events

Reference

Events

  • LogFavoriteNumberAdded

    event LogFavoriteNumberAdded(address _sender, uint _number) 
    Parameters:
    _sender - address
    _number - uint

Modifiers

  • onlyApprovedContract

    modifier onlyApprovedContract() 

Functions

  • numberStored

    function numberStored(address _sender, uint _number) external 
    Modifiers:
    onlyApprovedContract 
    Parameters:
    _sender - address
    _number - uint
diff --git a/docgen/docs/api_distribution_EqualDistribution.md b/docgen/docs/api_distribution_EqualDistribution.md deleted file mode 100644 index 1bf385c2..00000000 --- a/docgen/docs/api_distribution_EqualDistribution.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: distribution_EqualDistribution -title: EqualDistribution ---- - -

contract EqualDistribution

Reference

Events

  • LogPayment

    event LogPayment(address _sender, uint _amount) 

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.

    Parameters:
    _sender - address
    _amount - uint
  • LogWithdraw

    event LogWithdraw(address _beneficiary, uint _amount) 
    Parameters:
    _beneficiary - address
    _amount - uint

Functions

  • fallback

    function (address[] _beneficiaries) public 
    Parameters:
    _beneficiaries - address[]
  • fallback

    function () public payable 
  • getFunds

    function getFunds(address _contractAddress) external returns  (bool) 
    Parameters:
    _contractAddress - address
    Returns:
    bool
  • isBeneficiary

    function isBeneficiary(address _user) public view returns  (bool) 

    /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.

    Parameters:
    _user - address
    Returns:
    bool
  • withdraw

    function withdraw() external returns  (bool) 
    Returns:
    bool
diff --git a/docgen/docs/api_distribution_PlatformDistribution.md b/docgen/docs/api_distribution_PlatformDistribution.md deleted file mode 100644 index 149f3b2f..00000000 --- a/docgen/docs/api_distribution_PlatformDistribution.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: distribution_PlatformDistribution -title: PlatformDistribution ---- - -

contract PlatformDistribution

diff --git a/docgen/docs/api_ecosystem_AssetManager.md b/docgen/docs/api_ecosystem_AssetManager.md deleted file mode 100644 index c8e76e7c..00000000 --- a/docgen/docs/api_ecosystem_AssetManager.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ecosystem_AssetManager -title: AssetManager ---- - -

contract AssetManager

is Pausible

Reference

Events

  • LogAssetFundingStarted

    event LogAssetFundingStarted(bytes32 _assetID, bytes32 _manufacturerID, bytes32 _assetType, bytes32 _ipfsHash) 
    Parameters:
    _assetID - bytes32
    _manufacturerID - bytes32
    _assetType - bytes32
    _ipfsHash - bytes32
  • LogAssetRemoved

    event LogAssetRemoved(bytes32 _assetID, address _remover) 
    Parameters:
    _assetID - bytes32
    _remover - address
  • 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 _bytes32) 
    Parameters:
    _bytes32 - bytes32

Functions

  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • removeAsset

    function removeAsset(bytes32 _assetID, address _functionSigner) external returns  (bool) 
    Modifiers:
    anyOwner noEmptyBytes whenNotPaused 
    Parameters:
    _assetID - bytes32
    _functionSigner - address
    Returns:
    bool
diff --git a/docgen/docs/api_ecosystem_Manufacturers.md b/docgen/docs/api_ecosystem_Manufacturers.md deleted file mode 100644 index 2836b781..00000000 --- a/docgen/docs/api_ecosystem_Manufacturers.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ecosystem_Manufacturers -title: Manufacturers ---- - -

contract Manufacturers

diff --git a/docgen/docs/api_interfaces_BurnableERC20.md b/docgen/docs/api_interfaces_BurnableERC20.md deleted file mode 100644 index 14d25920..00000000 --- a/docgen/docs/api_interfaces_BurnableERC20.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: interfaces_BurnableERC20 -title: BurnableERC20 ---- - -

interface BurnableERC20

Reference

Events

  • Approval

    event Approval(address owner, address spender, uint256 value) 
    Parameters:
    owner - address
    spender - address
    value - uint256
  • LogBurn

    event LogBurn(address _spender, uint256 _value) 
    Parameters:
    _spender - address
    _value - uint256
  • Transfer

    event Transfer(address from, address to, uint256 value) 
    Parameters:
    from - address
    to - address
    value - uint256

Functions

  • allowance

    abstract function allowance(address tokenOwner, address spender) external view returns  (uint) 
    Parameters:
    tokenOwner - address
    spender - address
    Returns:
    uint
  • approve

    abstract function approve(address _spender, uint256 _value) external returns  (bool) 
    Parameters:
    _spender - address
    _value - uint256
    Returns:
    bool
  • balanceOf

    abstract function balanceOf(address _who) external view returns  (uint256) 
    Parameters:
    _who - address
    Returns:
    uint256
  • burnFrom

    abstract function burnFrom(address _tokenHolder, uint _amount) external returns  (bool) 
    Parameters:
    _tokenHolder - address
    _amount - uint
    Returns:
    bool
  • totalSupply

    abstract function totalSupply() external view returns  (uint256) 
    Returns:
    uint256
  • transfer

    abstract function transfer(address _to, uint256 _value) external returns  (bool) 
    Parameters:
    _to - address
    _value - uint256
    Returns:
    bool
  • transferFrom

    abstract function transferFrom(address _from, address _to, uint256 _value) external returns  (bool) 
    Parameters:
    _from - address
    _to - address
    _value - uint256
    Returns:
    bool
diff --git a/docgen/docs/api_interfaces_Crowdsale.md b/docgen/docs/api_interfaces_Crowdsale.md deleted file mode 100644 index 3e4c9f2c..00000000 --- a/docgen/docs/api_interfaces_Crowdsale.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: interfaces_Crowdsale -title: Crowdsale ---- - -

interface Crowdsale

Reference

Functions

  • buyAsset

    abstract function buyAsset(bytes32 _assetID, uint _amount) external returns  (bool) 
    Parameters:
    _assetID - bytes32
    _amount - uint
    Returns:
    bool
  • destroy

    abstract function destroy(address _functionInitiator, address _holdingAddress) external 
    Parameters:
    _functionInitiator - address
    _holdingAddress - address
  • refund

    abstract function refund(bytes32 _assetID) external returns  (bool) 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
  • startFundingPeriod

    abstract function startFundingPeriod(bytes32 _assetID, address _assetToken, address _creator, uint _amountToRaise) external returns  (bool) 
    Parameters:
    _assetID - bytes32
    _assetToken - address
    _creator - address
    _amountToRaise - uint
    Returns:
    bool
diff --git a/docgen/docs/api_interfaces_Database.md b/docgen/docs/api_interfaces_Database.md deleted file mode 100644 index 22166b44..00000000 --- a/docgen/docs/api_interfaces_Database.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: interfaces_Database -title: Database ---- - -

interface Database

Reference

Functions

  • addressStorage

    abstract function addressStorage(bytes32 _key) external returns  (address) 
    Parameters:
    _key - bytes32
    Returns:
    address
  • boolStorage

    abstract function boolStorage(bytes32 _key) external returns  (bool) 
    Parameters:
    _key - bytes32
    Returns:
    bool
  • bytes32Storage

    abstract function bytes32Storage(bytes32 _key) external returns  (bytes32) 
    Parameters:
    _key - bytes32
    Returns:
    bytes32
  • bytesStorage

    abstract function bytesStorage(bytes32 _key) external returns  (bytes) 
    Parameters:
    _key - bytes32
    Returns:
    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 - bytes32
    Returns:
    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 - bytes32
    Returns:
    string
  • uintStorage

    abstract function uintStorage(bytes32 _key) external returns  (uint) 
    Parameters:
    _key - bytes32
    Returns:
    uint
diff --git a/docgen/docs/api_interfaces_ERC20.md b/docgen/docs/api_interfaces_ERC20.md deleted file mode 100644 index bf6c2390..00000000 --- a/docgen/docs/api_interfaces_ERC20.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: interfaces_ERC20 -title: ERC20 ---- - -

contract ERC20

See https://github.com/ethereum/EIPs/issues/20.

Reference

Events

  • Approval

    event Approval(address owner, address spender, uint256 value) 
    Parameters:
    owner - address
    spender - address
    value - uint256
  • Transfer

    event Transfer(address from, address to, uint256 value) 
    Parameters:
    from - address
    to - address
    value - uint256

Functions

  • allowance

    abstract function allowance(address _owner, address _spender) public view returns  (uint256) 
    Parameters:
    _owner - address
    _spender - address
    Returns:
    uint256
  • approve

    abstract function approve(address _spender, uint256 _value) public returns  (bool) 
    Parameters:
    _spender - address
    _value - uint256
    Returns:
    bool
  • balanceOf

    abstract function balanceOf(address _who) public view returns  (uint256) 
    Parameters:
    _who - address
    Returns:
    uint256
  • totalSupply

    abstract function totalSupply() public view returns  (uint256) 
    Returns:
    uint256
  • transfer

    abstract function transfer(address _to, uint256 _value) public returns  (bool) 
    Parameters:
    _to - address
    _value - uint256
    Returns:
    bool
  • transferFrom

    abstract function transferFrom(address _from, address _to, uint256 _value) public returns  (bool) 
    Parameters:
    _from - address
    _to - address
    _value - uint256
    Returns:
    bool
diff --git a/docgen/docs/api_interfaces_PullPayment.md b/docgen/docs/api_interfaces_PullPayment.md deleted file mode 100644 index 2cb6b668..00000000 --- a/docgen/docs/api_interfaces_PullPayment.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: interfaces_PullPayment -title: PullPayment ---- - -

interface PullPayment

Reference

Functions

  • withdraw

    abstract function withdraw() external returns  (bool) 
    Returns:
    bool
  • withdrawManagerIncome

    abstract function withdrawManagerIncome(bytes32 _assetID) external returns  (bool) 
    Parameters:
    _assetID - bytes32
    Returns:
    bool
diff --git a/docgen/docs/api_math_SafeMath.md b/docgen/docs/api_math_SafeMath.md deleted file mode 100644 index bea90fb1..00000000 --- a/docgen/docs/api_math_SafeMath.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: math_SafeMath -title: SafeMath ---- - -

library SafeMath

Reference

Functions

  • add

    function add(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • bytesToUint

    function bytesToUint(bytes b) internal pure returns  (uint256) 
    Parameters:
    b - bytes
    Returns:
    uint256
  • div

    function div(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • getFractionalAmount

    function getFractionalAmount(uint256 _amount, uint256 _percentage) internal pure returns  (uint256) 
    Parameters:
    _amount - uint256
    _percentage - uint256
    Returns:
    uint256
  • mul

    function mul(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
  • sub

    function sub(uint256 a, uint256 b) internal pure returns  (uint256) 
    Parameters:
    a - uint256
    b - uint256
    Returns:
    uint256
diff --git a/docgen/docs/api_ownership_MultiOwned.md b/docgen/docs/api_ownership_MultiOwned.md deleted file mode 100644 index 0de4ff10..00000000 --- a/docgen/docs/api_ownership_MultiOwned.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ownership_MultiOwned -title: MultiOwned ---- - -

contract MultiOwned

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

Modifiers

  • anyOwner

    modifier anyOwner() 
  • noZeroAddress

    modifier noZeroAddress(address _param) 
    Parameters:
    _param - address

Functions

  • addOwner

    function addOwner(address _newOwner) external 
    Modifiers:
    anyOwner 
    Parameters:
    _newOwner - address
  • callAuthorizedFunction

    function callAuthorizedFunction(bytes4 _methodID) external 
    Modifiers:
    anyOwner 
    Parameters:
    _methodID - bytes4
  • removeOwner

    function removeOwner() external 
    Modifiers:
    anyOwner 
  • signForFunctionCall

    function signForFunctionCall(bytes4 _methodID) external 
    Modifiers:
    anyOwner 
    Parameters:
    _methodID - bytes4
diff --git a/docgen/docs/api_ownership_Pausible.md b/docgen/docs/api_ownership_Pausible.md deleted file mode 100644 index 82e7b82d..00000000 --- a/docgen/docs/api_ownership_Pausible.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ownership_Pausible -title: Pausible ---- - -

contract Pausible

is MultiOwned

Reference

Events

  • LogPaused

    event LogPaused(address _contract, address _owner) 
    Parameters:
    _contract - address
    _owner - address
  • LogUnpaused

    event LogUnpaused(address _contract, address _owner) 
    Parameters:
    _contract - address
    _owner - address

Modifiers

  • noZeroAddress

    modifier noZeroAddress(address _address) 
    Parameters:
    _address - address
  • whenNotPaused

    modifier whenNotPaused(address _contract) 
    Parameters:
    _contract - address

Functions

  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • pause

    function pause(address _contract) public 
    Modifiers:
    anyOwner 
    Parameters:
    _contract - address
  • unpause

    function unpause(address _contract) public 
    Modifiers:
    anyOwner 
    Parameters:
    _contract - address
diff --git a/docgen/docs/api_ownership_SingleOwned.md b/docgen/docs/api_ownership_SingleOwned.md deleted file mode 100644 index 621208aa..00000000 --- a/docgen/docs/api_ownership_SingleOwned.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ownership_SingleOwned -title: SingleOwned ---- - -

contract SingleOwned

Reference

Events

  • OwnershipTransferred

    event OwnershipTransferred(address owner, address pendingOwner) 
    Parameters:
    owner - address
    pendingOwner - address

Modifiers

  • onlyOwner

    modifier onlyOwner() 

Functions

  • changeOwner

    function changeOwner(address _newOwner) public 
    Modifiers:
    onlyOwner 
    Parameters:
    _newOwner - address
  • fallback

    function (address _database, address _owner) public 
    Parameters:
    _database - address
    _owner - address
diff --git a/docgen/docs/api_ownership_SingleOwnedClaimable.md b/docgen/docs/api_ownership_SingleOwnedClaimable.md deleted file mode 100644 index d5ff4a96..00000000 --- a/docgen/docs/api_ownership_SingleOwnedClaimable.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: ownership_SingleOwnedClaimable -title: SingleOwnedClaimable ---- - -

contract SingleOwnedClaimable

Reference

Events

  • OwnershipTransferred

    event OwnershipTransferred(address owner, address pendingOwner) 
    Parameters:
    owner - address
    pendingOwner - address

Modifiers

  • noZeroAddress

    modifier noZeroAddress(address _address) 
    Parameters:
    _address - address
  • onlyOwner

    modifier onlyOwner() 
  • onlyPendingOwner

    modifier onlyPendingOwner() 

    Modifier throws if called by any account other than the pendingOwner.

Functions

  • claimOwnership

    function claimOwnership() public 
    Modifiers:
    onlyPendingOwner 
  • fallback

    function (address _database) public 
    Parameters:
    _database - address
  • transferOwnership

    function transferOwnership(address _newOwner) public 
    Modifiers:
    onlyOwner noZeroAddress 
    Parameters:
    _newOwner - address
diff --git a/docgen/docs/api_tokens_ERC20_DetailedERC20.md b/docgen/docs/api_tokens_ERC20_DetailedERC20.md deleted file mode 100644 index 77cf8a99..00000000 --- a/docgen/docs/api_tokens_ERC20_DetailedERC20.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_DetailedERC20 -title: DetailedERC20 ---- - -

contract DetailedERC20

is ERC20

The decimals are only for visualization purposes. All the operations are done using the smallest and indivisible token unit, just as on Ethereum all the operations are done in wei.

Reference

Functions

  • fallback

    function (string _name, string _symbol, uint8 _decimals) public 
    Parameters:
    _name - string
    _symbol - string
    _decimals - uint8
diff --git a/docgen/docs/api_tokens_ERC20_DividendToken.md b/docgen/docs/api_tokens_ERC20_DividendToken.md deleted file mode 100644 index b5fcc057..00000000 --- a/docgen/docs/api_tokens_ERC20_DividendToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_DividendToken -title: DividendToken ---- - -

contract DividendToken

is BurnableERC20

Reference

Events

  • LogIncomeCollected

    event LogIncomeCollected(uint _block, address _address, uint _amount) 
    Parameters:
    _block - uint
    _address - address
    _amount - uint
  • 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

  • _burn

    function _burn(uint256 _value) public 
    Parameters:
    _value - uint256
  • allowance

    function allowance(address _tokenHolder, address _spender) public view returns  (uint) 
    Parameters:
    _tokenHolder - address
    _spender - address
    Returns:
    uint
  • approve

    function approve(address _spender, uint _amount) public returns  (bool) 
    Parameters:
    _spender - address
    _amount - uint
    Returns:
    bool
  • approveAndCall

    function approveAndCall(address _spender, uint _amount, bytes _data) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _spender - address
    _amount - uint
    _data - bytes
    Returns:
    bool
  • balanceOf

    function balanceOf(address _tokenHolder) public view returns  (uint) 
    Parameters:
    _tokenHolder - address
    Returns:
    uint
  • burnFrom

    function burnFrom(address _from, uint256 _value) external returns  (bool) 
    Parameters:
    _from - address
    _value - uint256
    Returns:
    bool
  • collectOwedDividends

    function collectOwedDividends() public returns  (uint) 
    Modifiers:
    updateIncomeClaimed 
    Returns:
    uint
  • fallback

    function () public payable 
    Modifiers:
    requiresEther 
  • fallback

    function (string _tokenURI, uint _totalSupply, address _creator, address _database) public 
    Parameters:
    _tokenURI - string
    _totalSupply - uint
    _creator - address
    _database - address
  • getOwedDividends

    function getOwedDividends(address _user) public view returns  (uint) 
    Parameters:
    _user - address
    Returns:
    uint
  • tokenURI

    function tokenURI() external view returns  (string) 
    Returns:
    string
  • totalSupply

    function totalSupply() public view returns  (uint) 
    Returns:
    uint
  • transfer

    function transfer(address _to, uint _amount) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _to - address
    _amount - uint
    Returns:
    bool
  • transferFrom

    function transferFrom(address _from, address _to, uint _amount) public returns  (bool) 
    Modifiers:
    updateIncomeClaimed updateIncomeClaimed 
    Parameters:
    _from - address
    _to - address
    _amount - uint
    Returns:
    bool
diff --git a/docgen/docs/api_tokens_ERC20_DividendToken_ApproveAndCallFallBack.md b/docgen/docs/api_tokens_ERC20_DividendToken_ApproveAndCallFallBack.md deleted file mode 100644 index 2bcbda62..00000000 --- a/docgen/docs/api_tokens_ERC20_DividendToken_ApproveAndCallFallBack.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_DividendToken_ApproveAndCallFallBack -title: ApproveAndCallFallBack ---- - -

contract ApproveAndCallFallBack

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_tokens_ERC20_MintableToken.md b/docgen/docs/api_tokens_ERC20_MintableToken.md deleted file mode 100644 index 26462f3b..00000000 --- a/docgen/docs/api_tokens_ERC20_MintableToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_MintableToken -title: MintableToken ---- - -

contract MintableToken

is StandardToken

Simple ERC20 Token example, with mintable token creation Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol.

Reference

Events

  • Mint

    event Mint(address to, uint256 amount) 
    Parameters:
    to - address
    amount - uint256
  • MintFinished

    event MintFinished() 

Modifiers

  • canMint

    modifier canMint() 

Functions

  • finishMinting

    function finishMinting() public returns  (bool) 
    Modifiers:
    canMint 
    Returns:
    bool
  • mint

    function mint(address _to, uint256 _amount) public returns  (bool) 
    Modifiers:
    canMint 
    Parameters:
    _to - address
    _amount - uint256
    Returns:
    bool
diff --git a/docgen/docs/api_tokens_ERC20_SafeERC20.md b/docgen/docs/api_tokens_ERC20_SafeERC20.md deleted file mode 100644 index 9de849db..00000000 --- a/docgen/docs/api_tokens_ERC20_SafeERC20.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_SafeERC20 -title: SafeERC20 ---- - -

library SafeERC20

Wrappers around ERC20 operations that throw on failure. To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.

Reference

Functions

  • safeApprove

    function safeApprove(ERC20 _token, address _spender, uint256 _value) internal 
    Parameters:
    _token - ERC20
    _spender - address
    _value - uint256
  • safeTransfer

    function safeTransfer(ERC20 _token, address _to, uint256 _value) internal 
    Parameters:
    _token - ERC20
    _to - address
    _value - uint256
  • safeTransferFrom

    function safeTransferFrom(ERC20 _token, address _from, address _to, uint256 _value) internal 
    Parameters:
    _token - ERC20
    _from - address
    _to - address
    _value - uint256
diff --git a/docgen/docs/api_tokens_ERC20_StandardToken.md b/docgen/docs/api_tokens_ERC20_StandardToken.md deleted file mode 100644 index beeb1d3f..00000000 --- a/docgen/docs/api_tokens_ERC20_StandardToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ERC20_StandardToken -title: StandardToken ---- - -

contract StandardToken

is ERC20

Reference

Functions

  • allowance

    function allowance(address _owner, address _spender) public view returns  (uint256) 

    Function to check the amount of tokens that an owner allowed to a spender.

    Parameters:
    _owner - address The address which owns the funds.
    _spender - address The address which will spend the funds.
    Returns:
    A uint256 specifying the amount of tokens still available for the spender.
  • approve

    function approve(address _spender, uint256 _value) public returns  (bool) 

    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.

    Parameters:
    _spender - The address which will spend the funds.
    _value - The amount of tokens to be spent.
    Returns:
    bool
  • balanceOf

    function balanceOf(address _owner) public view returns  (uint256) 

    Gets the balance of the specified address.

    Parameters:
    _owner - The address to query the the balance of.
    Returns:
    An uint256 representing the amount owned by the passed address.
  • decreaseApproval

    function decreaseApproval(address _spender, uint256 _subtractedValue) public returns  (bool) 

    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.

    Parameters:
    _spender - The address which will spend the funds.
    _subtractedValue - The amount of tokens to decrease the allowance by.
    Returns:
    bool
  • increaseApproval

    function increaseApproval(address _spender, uint256 _addedValue) public returns  (bool) 

    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.

    Parameters:
    _spender - The address which will spend the funds.
    _addedValue - The amount of tokens to increase the allowance by.
    Returns:
    bool
  • totalSupply

    function totalSupply() public view returns  (uint256) 

    Total number of tokens in existence.

    Returns:
    uint256
  • transfer

    function transfer(address _to, uint256 _value) public returns  (bool) 

    Transfer token for a specified address.

    Parameters:
    _to - The address to transfer to.
    _value - The amount to be transferred.
    Returns:
    bool
  • transferFrom

    function transferFrom(address _from, address _to, uint256 _value) public returns  (bool) 

    Transfer tokens from one address to another.

    Parameters:
    _from - address The address which you want to send tokens from
    _to - address The address which you want to transfer to
    _value - uint256 the amount of tokens to be transferred
    Returns:
    bool
diff --git a/docgen/docs/api_tokens_ecosystem_CanReclaimToken.md b/docgen/docs/api_tokens_ecosystem_CanReclaimToken.md deleted file mode 100644 index 42c935c6..00000000 --- a/docgen/docs/api_tokens_ecosystem_CanReclaimToken.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ecosystem_CanReclaimToken -title: CanReclaimToken ---- - -

contract CanReclaimToken

is SingleOwned

This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner. This will prevent any accidental loss of tokens.

Author: SylTi

Reference

Functions

  • reclaimToken

    function reclaimToken(StandardToken _token) external 

    Reclaim all ERC20Basic compatible tokens.

    Modifiers:
    onlyOwner 
    Parameters:
    _token - ERC20Basic The address of the token contract
diff --git a/docgen/docs/api_tokens_ecosystem_ERC20Burner.md b/docgen/docs/api_tokens_ecosystem_ERC20Burner.md deleted file mode 100644 index 4db34a13..00000000 --- a/docgen/docs/api_tokens_ecosystem_ERC20Burner.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ecosystem_ERC20Burner -title: ERC20Burner ---- - -

contract ERC20Burner

This contract does not accept tokens. It only burns tokens from users wallets when approved to do so, Allows Dapps to call this contract to burn ERC20 tokens as a usage fee.

Author: Kyle Dewhurst, MyBit Foundation

Reference

Events

  • LogBurnerAuthorized

    event LogBurnerAuthorized(address _owner, address _burningContract) 
    Parameters:
    _owner - address
    _burningContract - address
  • LogBurnerRemoved

    event LogBurnerRemoved(address _owner, address _burningContract) 
    Parameters:
    _owner - address
    _burningContract - address
  • LogMYBBurned

    event LogMYBBurned(address _tokenHolder, address _burningContract, uint _amount) 

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////.

    Parameters:
    _tokenHolder - address
    _burningContract - address
    _amount - uint

Modifiers

  • onlyAuthorizedBurner

    modifier onlyAuthorizedBurner(address _burner) 
    Parameters:
    _burner - address
  • onlyOwner

    modifier onlyOwner() 

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////.

Functions

  • authorizeBurner

    function authorizeBurner(address _burningContract) external returns  (bool) 
    Modifiers:
    onlyOwner 
    Parameters:
    _burningContract - address
    Returns:
    bool
  • burn

    function burn(address _tokenHolder, uint _amount) external returns  (bool) 
    Modifiers:
    onlyAuthorizedBurner 
    Parameters:
    _tokenHolder - address
    _amount - uint
    Returns:
    bool
  • fallback

    function (address _myBitTokenAddress) public 
    Parameters:
    _myBitTokenAddress - address
  • fallback

    function () external payable 
  • removeBurner

    function removeBurner(address _burningContract) external returns  (bool) 
    Modifiers:
    onlyAuthorizedBurner onlyOwner 
    Parameters:
    _burningContract - address
    Returns:
    bool
diff --git a/docgen/docs/api_tokens_ecosystem_RejectTokens.md b/docgen/docs/api_tokens_ecosystem_RejectTokens.md deleted file mode 100644 index b4dbbf5d..00000000 --- a/docgen/docs/api_tokens_ecosystem_RejectTokens.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -id: tokens_ecosystem_RejectTokens -title: RejectTokens ---- - -

contract RejectTokens

diff --git a/package-lock.json b/package-lock.json index 1b1eb2a2..44337e86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,1707 @@ { "name": "@mybit/contracts", - "version": "0.1.1", + "version": "0.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "1.5.2", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "requires": { + "tweetnacl": "^0.14.3" + } + }, "bignumber.js": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + }, + "browserify-sha3": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/browserify-sha3/-/browserify-sha3-0.0.1.tgz", + "integrity": "sha1-P/NKMAbvFcD7NWflQbkaI0ASPRE=", + "dev": true, + "requires": { + "js-sha3": "^0.3.1" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "coveralls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.2.tgz", + "integrity": "sha512-Tv0LKe/MkBOilH2v7WBiTBdudg2ChfGbdXafc/s330djpF3zKOmuehTeRwjXWc7pzfj9FrDUTA7tEx6Div8NFw==", + "requires": { + "growl": "~> 1.10.0", + "js-yaml": "^3.11.0", + "lcov-parse": "^0.0.10", + "log-driver": "^1.2.7", + "minimist": "^1.2.0", + "request": "^2.85.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } + } + }, + "crypto-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", + "integrity": "sha1-cV8HC/YBTyrpkqmLOSkli3E/CNU=", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha1-AaqcQB7dknUFFEcLgmY5DGbGcxg=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "ethereumjs-testrpc-sc": { + "version": "6.1.6", + "resolved": "https://registry.npmjs.org/ethereumjs-testrpc-sc/-/ethereumjs-testrpc-sc-6.1.6.tgz", + "integrity": "sha512-iv2qiGBFgk9mn5Nq2enX8dG5WQ7Lk+FCqpnxfPfH4Ns8KLPwttmNOy264nh3SXDJJvcQwz/XnlLteDQVILotbg==", + "dev": true, + "requires": { + "source-map-support": "^0.5.3" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "ganache-cli": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/ganache-cli/-/ganache-cli-6.1.8.tgz", + "integrity": "sha512-yXzteu4SIgUL31mnpm9j+x6dpHUw0p/nsRVkcySKq0w+1vDxH9jMErP1QhZAJuTVE6ni4nfvGSNkaQx5cD3jfg==", + "requires": { + "source-map-support": "^0.5.3" + } + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + }, + "handlebars": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.12.tgz", + "integrity": "sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA==", + "dev": true, + "requires": { + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=" + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "js-sha3": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.3.1.tgz", + "integrity": "sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "http://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "keccakjs": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/keccakjs/-/keccakjs-0.2.1.tgz", + "integrity": "sha1-HWM6+QfvMFu/ny+mFtVsRFYd+k0=", + "dev": true, + "requires": { + "browserify-sha3": "^0.0.1", + "sha3": "^1.1.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "requires": { + "graceful-fs": "^4.1.9" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=" + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==" + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + }, + "mime-db": { + "version": "1.36.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", + "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==" + }, + "mime-types": { + "version": "2.1.20", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", + "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "requires": { + "mime-db": "~1.36.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "http://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mustache": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.2.tgz", + "integrity": "sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==" + }, + "nan": { + "version": "2.10.0", + "resolved": "http://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "original-require": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/original-require/-/original-require-1.0.1.tgz", + "integrity": "sha1-DxMEcVhM0zURxew4yNWSE/msXiA=" + }, + "os-locale": { + "version": "1.4.0", + "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "requires": { + "lcid": "^1.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "^1.2.0" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "pegjs": { + "version": "0.10.0", + "resolved": "http://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "requires": { + "pinkie": "^2.0.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prop-types": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz", + "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==", + "requires": { + "loose-envify": "^1.3.1", + "object-assign": "^4.1.1" + } + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "react": { + "version": "16.5.2", + "resolved": "https://registry.npmjs.org/react/-/react-16.5.2.tgz", + "integrity": "sha512-FDCSVd3DjVTmbEAjUNX6FgfAmQ+ypJfHUsqUJOYNCBUp1h8lqmtC+0mXJ+JjsWx4KAVTkk1vKd1hLQPvEviSuw==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "schedule": "^0.5.0" + } + }, + "react-dom": { + "version": "16.5.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.5.2.tgz", + "integrity": "sha512-RC8LDw8feuZOHVgzEf7f+cxBr/DnKdqp56VU0lAs1f4UfKc4cU8wU4fTq/mgnvynLQo8OtlPC19NUFh/zjZPuA==", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "schedule": "^0.5.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "requires": { + "resolve": "^1.1.6" + } + }, + "req-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-1.0.1.tgz", + "integrity": "sha1-DXOurpJm5penj3l2AZZ352rPD/8=", + "dev": true, + "requires": { + "req-from": "^1.0.1" + } + }, + "req-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-1.0.1.tgz", + "integrity": "sha1-v4HaUUeUfTLRO5R9wSpYrUWHNQ4=", + "dev": true, + "requires": { + "resolve-from": "^2.0.0" + } + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=", + "dev": true + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "schedule": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/schedule/-/schedule-0.5.0.tgz", + "integrity": "sha512-HUcJicG5Ou8xfR//c2rPT0lPIRR09vVvN81T9fqfVgBmhERUbDEQoYKjpBxbueJnCPpSu2ujXzOnRQt6x9o/jw==", + "requires": { + "object-assign": "^4.1.1" + } + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "sha3": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/sha3/-/sha3-1.2.2.tgz", + "integrity": "sha1-pmxQmN5MJbyIM27ItIF9AFvKe6k=", + "dev": true, + "requires": { + "nan": "2.10.0" + } + }, + "shelljs": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", + "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + }, + "sol-explore": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/sol-explore/-/sol-explore-1.6.2.tgz", + "integrity": "sha1-Q66MQZ/TrAVqBfip0fsQIs1B7MI=", + "dev": true + }, + "solc": { + "version": "0.4.25", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.25.tgz", + "integrity": "sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg==", + "requires": { + "fs-extra": "^0.30.0", + "memorystream": "^0.3.1", + "require-from-string": "^1.1.0", + "semver": "^5.3.0", + "yargs": "^4.7.1" + } + }, + "solidity-coverage": { + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.5.11.tgz", + "integrity": "sha512-qikdsSi6+9XbfvwA0aI7HUVpF9fIFNqRWTw23M89GMDY+b6Gj0wWU9IngJS0fimoZIAdEp3bfChxvpfVcrUesg==", + "dev": true, + "requires": { + "death": "^1.1.0", + "ethereumjs-testrpc-sc": "6.1.6", + "istanbul": "^0.4.5", + "keccakjs": "^0.2.1", + "req-cwd": "^1.0.1", + "shelljs": "^0.7.4", + "sol-explore": "^1.6.2", + "solidity-parser-sc": "0.4.11", + "tree-kill": "^1.2.0", + "web3": "^0.18.4" + }, + "dependencies": { + "shelljs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", + "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "dev": true, + "requires": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + } + } + } + }, + "solidity-docgen": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/solidity-docgen/-/solidity-docgen-0.1.0.tgz", + "integrity": "sha512-F7ufNWmlP5c5hIi66Ijv9tc+HNosyO7ijWq6pRtyBR1WqyJBH/0DJkD6QZI8HkE8p6LEXiPKxGBWbAeVT9Nu9g==", + "requires": { + "commander": "^2.14.1", + "lodash": "^4.17.5", + "mocha": "^5.0.1", + "mustache": "^2.3.0", + "react": "^16.2.0", + "react-dom": "^16.2.0", + "shelljs": "^0.8.1" + } + }, + "solidity-parser-sc": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz", + "integrity": "sha512-1kV5iC7m3CtMDfmHaVNwz2saSGQVIuF16rIxU417Al38MVCWHMQQ5vT6cmLsNwDe60S74auobWij9vNawSeOyw==", + "dev": true, + "requires": { + "mocha": "^4.1.0", + "pegjs": "^0.10.0", + "yargs": "^4.6.0" + }, + "dependencies": { + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "dev": true + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + } + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz", + "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "spdx-correct": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.2.tgz", + "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", + "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", + "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "requires": { + "is-utf8": "^0.2.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "tree-kill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", + "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==", + "dev": true + }, + "truffle": { + "version": "4.1.14", + "resolved": "https://registry.npmjs.org/truffle/-/truffle-4.1.14.tgz", + "integrity": "sha512-e7tTLvKP3bN9dE7MagfWyFjy4ZgoEGbeujECy1me1ENBzbj/aO/+45gs72qsL3+3IkCNNcWNOJjjrm8BYZZNNg==", + "requires": { + "mocha": "^4.1.0", + "original-require": "1.0.1", + "solc": "0.4.24" + }, + "dependencies": { + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=" + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==" + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "mocha": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", + "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + } + }, + "solc": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.4.24.tgz", + "integrity": "sha512-2xd7Cf1HeVwrIb6Bu1cwY2/TaLRodrppCq3l7rhLimFQgmxptXhTC3+/wesVLpB09F1A2kZgvbMOgH7wvhFnBQ==", + "requires": { + "fs-extra": "^0.30.0", + "memorystream": "^0.3.1", + "require-from-string": "^1.1.0", + "semver": "^5.3.0", + "yargs": "^4.7.1" + } + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "requires": { + "has-flag": "^2.0.0" + } + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "uglify-js": { + "version": "3.4.9", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", + "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "dev": true, + "optional": true, + "requires": { + "commander": "~2.17.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.17.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", + "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "dev": true, + "optional": true + } + } + }, + "utf8": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-2.1.2.tgz", + "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "web3": { + "version": "0.18.4", + "resolved": "https://registry.npmjs.org/web3/-/web3-0.18.4.tgz", + "integrity": "sha1-gewXhBRUkfLqqJVbMcBgSeB8Xn0=", + "dev": true, + "requires": { + "bignumber.js": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "crypto-js": "^3.1.4", + "utf8": "^2.1.1", + "xhr2": "*", + "xmlhttprequest": "*" + }, + "dependencies": { + "bignumber.js": { + "version": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "from": "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2", + "dev": true + } + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xhr2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", + "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=", + "dev": true + }, + "xmlhttprequest": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", + "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yargs": { + "version": "4.8.1", + "resolved": "http://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "requires": { + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" + } + }, + "yargs-parser": { + "version": "2.4.1", + "resolved": "http://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "requires": { + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" + } } } } diff --git a/package.json b/package.json index c1636e58..fdec3397 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,8 @@ "coveralls": "^3.0.2", "ganache-cli": "^6.1.0", "request": "^2.87.0", - "solc": "^0.4.24", + "solc": "^0.4.25", + "solidity-docgen": "^0.1.0", "truffle": "^4.1.14" }, "devDependencies": { diff --git a/yarn.lock b/yarn.lock index eb3aeba7..648fb27c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -112,6 +112,11 @@ browser-stdout@1.3.0: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" integrity sha1-81HTKWnTL6XXpVZxVCY9korjvR8= +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + browserify-sha3@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/browserify-sha3/-/browserify-sha3-0.0.1.tgz#3ff34a3006ef15c0fb3567e541b91a2340123d11" @@ -177,6 +182,16 @@ commander@2.11.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" integrity sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ== +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + +commander@^2.14.1: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + commander@~2.17.1: version "2.17.1" resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" @@ -248,6 +263,11 @@ diff@3.3.1: resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" integrity sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww== +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -439,7 +459,7 @@ growl@1.10.3: resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" integrity sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q== -"growl@~> 1.10.0": +growl@1.10.5, "growl@~> 1.10.0": version "1.10.5" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== @@ -478,6 +498,11 @@ has-flag@^2.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -584,6 +609,11 @@ js-sha3@^0.3.1: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.3.1.tgz#86122802142f0828502a0d1dee1d95e253bb0243" integrity sha1-hhIoAhQvCChQKg0d7h2V4lO7AkM= +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + js-yaml@3.x, js-yaml@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" @@ -680,7 +710,7 @@ lodash.assign@^4.0.3, lodash.assign@^4.0.6: resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= -lodash@^4.17.10: +lodash@^4.17.10, lodash@^4.17.5: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== @@ -690,6 +720,13 @@ log-driver@^1.2.7: resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== +loose-envify@^1.1.0, loose-envify@^1.3.1: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + memorystream@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" @@ -707,7 +744,7 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "~1.36.0" -"minimatch@2 || 3", minimatch@^3.0.4: +"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== @@ -752,11 +789,33 @@ mocha@^4.1.0: mkdirp "0.5.1" supports-color "4.4.0" +mocha@^5.0.1: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +mustache@^2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.2.tgz#a6d4d9c3f91d13359ab889a812954f9230a3d0c5" + integrity sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ== + nan@2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" @@ -789,6 +848,11 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + once@1.x, once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -893,6 +957,14 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prop-types@^15.6.2: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ== + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" + psl@^1.1.24: version "1.1.29" resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" @@ -908,6 +980,26 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +react-dom@^16.2.0: + version "16.5.2" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.5.2.tgz#b69ee47aa20bab5327b2b9d7c1fe2a30f2cfa9d7" + integrity sha512-RC8LDw8feuZOHVgzEf7f+cxBr/DnKdqp56VU0lAs1f4UfKc4cU8wU4fTq/mgnvynLQo8OtlPC19NUFh/zjZPuA== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + schedule "^0.5.0" + +react@^16.2.0: + version "16.5.2" + resolved "https://registry.yarnpkg.com/react/-/react-16.5.2.tgz#19f6b444ed139baa45609eee6dc3d318b3895d42" + integrity sha512-FDCSVd3DjVTmbEAjUNX6FgfAmQ+ypJfHUsqUJOYNCBUp1h8lqmtC+0mXJ+JjsWx4KAVTkk1vKd1hLQPvEviSuw== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.2" + schedule "^0.5.0" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -1021,6 +1113,13 @@ safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +schedule@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/schedule/-/schedule-0.5.0.tgz#c128fffa0b402488b08b55ae74bb9df55cc29cc8" + integrity sha512-HUcJicG5Ou8xfR//c2rPT0lPIRR09vVvN81T9fqfVgBmhERUbDEQoYKjpBxbueJnCPpSu2ujXzOnRQt6x9o/jw== + dependencies: + object-assign "^4.1.1" + "semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -1047,6 +1146,15 @@ shelljs@^0.7.4: interpret "^1.0.0" rechoir "^0.6.2" +shelljs@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.2.tgz#345b7df7763f4c2340d584abb532c5f752ca9e35" + integrity sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + sol-explore@^1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/sol-explore/-/sol-explore-1.6.2.tgz#43ae8c419fd3ac056a05f8a9d1fb1022cd41ecc2" @@ -1063,7 +1171,7 @@ solc@0.4.24: semver "^5.3.0" yargs "^4.7.1" -solc@^0.4.24: +solc@^0.4.25: version "0.4.25" resolved "https://registry.yarnpkg.com/solc/-/solc-0.4.25.tgz#06b8321f7112d95b4b903639b1138a4d292f5faa" integrity sha512-jU1YygRVy6zatgXrLY2rRm7HW1d7a8CkkEgNJwvH2VLpWhMFsMdWcJn6kUqZwcSz/Vm+w89dy7Z/aB5p6AFTrg== @@ -1090,6 +1198,19 @@ solidity-coverage@^0.5.11: tree-kill "^1.2.0" web3 "^0.18.4" +solidity-docgen@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.1.0.tgz#f3a56ff074e8c7d832af3a3d462c3b5abf0f64cb" + integrity sha512-F7ufNWmlP5c5hIi66Ijv9tc+HNosyO7ijWq6pRtyBR1WqyJBH/0DJkD6QZI8HkE8p6LEXiPKxGBWbAeVT9Nu9g== + dependencies: + commander "^2.14.1" + lodash "^4.17.5" + mocha "^5.0.1" + mustache "^2.3.0" + react "^16.2.0" + react-dom "^16.2.0" + shelljs "^0.8.1" + solidity-parser-sc@0.4.11: version "0.4.11" resolved "https://registry.yarnpkg.com/solidity-parser-sc/-/solidity-parser-sc-0.4.11.tgz#86734c9205537007f4d6201b57176e41696ee607" @@ -1196,6 +1317,13 @@ supports-color@4.4.0: dependencies: has-flag "^2.0.0" +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + supports-color@^3.1.0: version "3.2.3" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" From 8cf5cae884ece7dbdfccb2683412d67f4f86f04f Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 12:39:03 +0200 Subject: [PATCH 09/21] added code snippets to README --- README.md | 143 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 110 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 8ac27933..fc69ccca 100644 --- a/README.md +++ b/README.md @@ -39,24 +39,6 @@ yarn blockchain You should see 20 accounts load up and see the local chain info: -``` -HD Wallet -================== -Mnemonic: fetch detect turtle medal cabin desk dish quality swap call shaft curtain -Base HD Path: m/44'/60'/0'/0/{account_index} - -Gas Price -================== -20000000000 - -Gas Limit -================== -6721975 - -Listening on 127.0.0.1:8545 -``` - - If you see this error: ``` @@ -85,7 +67,8 @@ yarn coverage ``` ## [Contracts](contracts) -The contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the [erc20 burner](contracts/access/ERC20Burner.sol) +:no_entry_sign: The SDK contracts can be upgradeable and thus before using variables and permissions must be set in the Database, Contract Manager, Platform Funds, Operator and approval for the ERC20Burner before use +Contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the [erc20 burner](contracts/access/ERC20Burner.sol). ### [Database](contracts/database) Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: @@ -95,7 +78,7 @@ Storing an unsigned integer looks like this: database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), 20000000); ``` -The database then stores this with the function. `key = sha3("fundingDeadline", assetID)`, `value = tokenAddress` +The [Database](contracts/database/Database.sol) then stores this with the function. `key = sha3("fundingDeadline", assetID)`, `value = tokenAddress` ```javascript function setUint(bytes32 _key, address _value) onlyApprovedContract @@ -115,15 +98,117 @@ The [API](contracts/database/API.sol) can be used to easily fetch variables from } ``` -### [Access](contracts/access) +### [ContractManager](contracts/database/ContractManager.sol) +To give a contract write access to the database, you must call `addContract(contractName, contractAddress)` from a platform owner account +```javascript + 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); + } +``` +Everytime a contract is added or updated the contract state will change, requiring approval from users before they interact with the platform. This can be done by calling the following function: + +```javascript + 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; + } +``` + +### [ERC20Burner](contracts/access/ERC20Burner.sol) +To create new asset orders, or purchase existing asset orders, users must provably burn MYB using the burner. To do this each user must approve the burner contract to burn tokens by calling the MYB contract: + +```javascript + function approve(address _spender, uint256 _value) public returns (bool) { + allowed[msg.sender][_spender] = _value; + emit Approval(msg.sender, _spender, _value); + return true; + } +``` + +:interrobang: `_spender in this case is the address of the ERC20Burner contract. _value should be placed high enough to avoid needing to approve the burner every use` + +### [Platform-Variables](contracts/ecosystem/PlatformFunds.sol) +Before assets can be funded the platform owners must set the `platform token` and the `platform wallet` by using: +```javascript + function setPlatformWallet(address _walletAddress) + external + onlyOwner { + database.setAddress(keccak256(abi.encodePacked("platformWallet")), _walletAddress); + emit LogPlatformWallet(_walletAddress); + } +``` +:heavy_plus_sign: + +```javascript + // @notice + function setPlatformToken(address _tokenAddress) + external + onlyOwner { + database.setAddress(keccak256(abi.encodePacked("platformToken")), _tokenAddress); + emit LogPlatformToken(_tokenAddress); + } +``` +### [Operator](contracts/roles/Operator.sol) +The Operator must be registered and define what currencies they are willing to receive as payment. To set the operators you can call: + +```javascript +function registerOperator(address _operatorAddress, string _operatorURI) +external +onlyOwner { + require(_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); +} +``` + +To choose which currencies the operator would like to accept they can call: + +```javascript +function acceptERC20Token(bytes32 _operatorID, address _tokenAddress, bool _accept) +external +onlyOperator(_operatorID) +returns (bool) { + database.setBool(keccak256(abi.encodePacked("acceptsToken", _operatorID, _tokenAddress)), _accept); + return true; +} +``` +OR +```javascript +function acceptEther(bytes32 _operatorID, bool _accept) +external +onlyOperator(_operatorID) +returns (bool) { + database.setBool(keccak256(abi.encodePacked("acceptsEther", _operatorID)), _accept); + return true; +} +``` ## [Roles](contracts/roles) The MYB SDK's have 4 fundamental roles: -* Investor -* AssetManager -* Operator +* Investor `must burn MYB to participate` +* AssetManager `must burn MYB to participate` +* Operator `must be registered by owners` * Platform Owner(s) Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. @@ -137,7 +222,7 @@ Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. ## Documentation - +Documentation is created using Zeppelins [Solidity-Docgen](https://github.com/OpenZeppelin/solidity-docgen) ``` cd docs/website yarn build @@ -153,14 +238,6 @@ GIT_USER= \ ``` -# Live example test-net contracts -* [InitialVariables](https://ropsten.etherscan.io/address/0x9e6606dedcf9d4960f8652abe2d624a048231841#code) -* [UserAccess](https://ropsten.etherscan.io/address/0xb14c50bb7530c71e14f28498bad1f65d10b5b3a9#code) -* [API](https://ropsten.etherscan.io/address/0x139ebd700b089f51a9dd90c0403e5326b1426f3b#code) -* [AssetCreation](https://ropsten.etherscan.io/address/0x011d426358f1982e327648506d3fdae01d054297#code) -* [FundingHub](https://ropsten.etherscan.io/address/0xb94bd7c5ca000beeff27db7cebb9c03749901f19#code) -* [MyBitToken](https://ropsten.etherscan.io/address/0xbb07c8c6e7cd15e2e6f944a5c2cac056c5476151#code) -* [TokenFaucet](https://ropsten.etherscan.io/address/0x564a7464b6ea98259aae1ad4aa8a11ca9b502cf8#code) ### ⚠️ Warning This application is unstable and has not undergone any rigorous security audits. Use at your own risk. From aa326e5dd0f0ce0b31b06cdeeb18aa0bad10e4c6 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:03:03 +0200 Subject: [PATCH 10/21] added relative links --- README.md | 43 +++++++++++++++++++++++++++++++++++++++---- contracts/README.md | 19 ++++++++----------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index fc69ccca..23586b73 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

- MyBit Logo + MyBit Logo

@@ -9,7 +9,7 @@ # MyBit-Network: Contract SDK [![CircleCI](https://circleci.com/gh/MyBitFoundation/MyBit-Network.tech.svg?style=shield)](https://circleci.com/gh/MyBitFoundation/MyBit-Network.tech) [![Coverage Status](https://coveralls.io/repos/github/MyBitFoundation/MyBit-Network.tech/badge.svg)](https://coveralls.io/github/MyBitFoundation/MyBit-Network.tech) -A software development kit for the automated machine economy. +:factory: A software development kit for the automated machine economy. The SDK's contain contracts that can be deployed to create varied decentralized asset management platforms. The contracts enable for the crowdsale of digital assets, which are represented as ERC20 dividend tokens. Crowdsales can receive ETH or ERC20 tokens, depending on the preferences of the operator and asset dividends can be paid in ETH or ERC20 tokens depending on the preferences of the investors. @@ -67,7 +67,7 @@ yarn coverage ``` ## [Contracts](contracts) -:no_entry_sign: The SDK contracts can be upgradeable and thus before using variables and permissions must be set in the Database, Contract Manager, Platform Funds, Operator and approval for the ERC20Burner before use +The SDK contracts can be upgradeable and thus before using variables and permissions must be set in the Database, Contract Manager, Platform Funds, Operator and approval for the ERC20Burner before use Contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the [erc20 burner](contracts/access/ERC20Burner.sol). ### [Database](contracts/database) @@ -142,7 +142,15 @@ To create new asset orders, or purchase existing asset orders, users must provab } ``` -:interrobang: `_spender in this case is the address of the ERC20Burner contract. _value should be placed high enough to avoid needing to approve the burner every use` +* spender in this case is the address of the ERC20Burner contract. value should be placed high enough to avoid needing to approve the burner every use + +The functions that require burning are: +- CrowdsaleGeneratorETH.createAssetOrderETH() +- CrowdsaleETH.buyAssetOrderETH() +- CrowdsaleGeneratorERC20.createAssetOrderERC20() +- CrowdsaleERC20.buyAssetOrderERC20() +- AssetExchange.buyAsset() +- AssetExchange.createBuyOrder() ### [Platform-Variables](contracts/ecosystem/PlatformFunds.sol) Before assets can be funded the platform owners must set the `platform token` and the `platform wallet` by using: @@ -214,6 +222,33 @@ The MYB SDK's have 4 fundamental roles: Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. +## In-Development +:construction: The SDK's are a work in progress and we hope to implement more features such as asset-governance, platform-governance and obfuscated asset authentication. + +### [Governance](contracts/ownership) +We are working on giving investors governance tools to vote for new AssetManagers if the need arises. Voting is based on token holdings and can be accomplished by approving a function call at a particular contract: +```javascript + 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; + } +``` + +* executingContract = The address of the contract, where the function is to be called +* assetID = The ID of the asset in question +* methodID = The function signature of the funtion to be called ie. `bytes4(sha3("exampleFunction(address, uint256, bool)"))` +* parameterHash = The sha3 hash of the exact parameters to be called at that function +* amountToLock - The number of asset-tokens this investor wishes to lock towards this function call ✏️ All contracts are written in [Solidity](https://solidity.readthedocs.io/en/v0.4.24/) version 0.4.24. diff --git a/contracts/README.md b/contracts/README.md index 04ed183e..c0ec906d 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -2,9 +2,6 @@ :wrench: Block-end developer tools -MyBit SDK allows developers to create personalized platforms which create and distribute income using tokenized assets on the Ethereum virtual machine. Using these tools front-end developers can build decentralized asset management platforms of their own using MyBit deploy scripts and API's. - - ## Contract Categories ### [Access](access) @@ -13,26 +10,26 @@ Access is where user access is managed. KYC access restriction can be applied to ### [Crowdsale](crowdsale) In the crowdsale folder you can find all the contracts involved in funding new assets. Funds can be received in either Ether or any ERC20 token the operator agrees to accept. Each base unit of the received tokens or Wei represent 1 share of the asset. The total supply of each asset is determined by the amount raised plus the Asset Managers fee. -### Database +### [Database](database) The database folder contains all contracts that abstract storage away from the logical 'front-end' contracts. When deploying the database, you can choose to have an upgradeable platform or a non-upgradeable. Write privileges to the database are determined by the contract manager, which is managed by the owner/owners of the platform. -### Ecosystem +### [Ecosystem](ecosystem) The ecosystem folder contains all the non-core contracts that are used for the on-boarding of non-platform assets, asset-exchange, staking, and platform payment and token controls. Before funding assets the platform-token and the platform-wallet need to be set. -### Interfaces +### [Interfaces](interfaces) All interfaces that our contracts use to interact with other deployed contracts. -### Math +### [Math](math) Math contracts are helper libraries for performing arithmetic without worrying about overflows and underflows. -### Ownership +### [Ownership](ownership) Contracts for controlling the platform (such as updating or pausing contracts) by a single account, multiple accounts or ERC20 token holders. Investors holding asset-tokens can vote to choose or fire their current Asset Manager here. -### Roles +### [Roles](roles) Asset Managers and Operators can control their funding preferences in the roles contracts. Asset Managers fees are held here to prevent them from transferring away the tokens. -### Test +### [Test](test) Contracts that are only used for local testing to ensure full code coverage of the platform contracts. -### Tokens +### [Tokens](tokens) Token contracts are used to represent fungible divisible assets. Tokens representing assets can be burnable, mintable, governed, and can receive ETH or ERC20 tokens as payment. The payment is distributed to asset-token holders according to their holdings. From 72f89fe8e7ebbae81b509247d92a35e1935c9d2f Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:15:38 +0200 Subject: [PATCH 11/21] added links to other repos --- README.md | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 23586b73..15ae45cd 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,9 @@ :factory: A software development kit for the automated machine economy. -The SDK's contain contracts that can be deployed to create varied decentralized asset management platforms. The contracts enable for the crowdsale of digital assets, which are represented as ERC20 dividend tokens. Crowdsales can receive ETH or ERC20 tokens, depending on the preferences of the operator and asset dividends can be paid in ETH or ERC20 tokens depending on the preferences of the investors. +The SDK's which contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to create crowdsales for digital assets, which are represented on the Ethereum blockchain as ERC20 dividend tokens. Crowdsales can receive ETH or ERC20 tokens, and the asset-tokens they produce and receive dividends in ETH or any ERC20 token depending on the preferences of the investors. +If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) or if you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) ## Getting Started First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable): @@ -21,14 +22,14 @@ First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install yarn ``` -You should see an output similar to below: +If successful you should see output similar to below: ``` [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... -Done in 0.66s. +Done in 5.69s. ``` Then get a local test blockchain running using [Ganache](https://truffleframework.com/ganache) @@ -38,37 +39,35 @@ yarn blockchain ```` You should see 20 accounts load up and see the local chain info: - -If you see this error: - ``` -Error: listen EADDRINUSE 127.0.0.1:8545 - at Server.setupListenHandle [as _listen2] (net.js:1360:14) - at listenInCluster (net.js:1401:12) - at doListen (net.js:1510:7) - at _combinedTickCallback (internal/process/next_tick.js:142:11) - at process._tickCallback (internal/process/next_tick.js:181:9) - at Function.Module.runMain (module.js:696:11) - at startup (bootstrap_node.js:204:16) - at bootstrap_node.js:625:3 -error Command failed with exit code 1. +Available Accounts +================== +(0) 0x1395e096348847e656c0d6b699087c47996235c0 (~100 ETH) +(1) 0x0c317c12a25eb6ef6e0e12583bf6ef6cb75cfb5f (~100 ETH) +(2) 0x1e195348e46184fc67bb23c8dfe1dd58f96c551c (~100 ETH) +(3) 0x3b699ce55888f4001d44eab5c205f371a336e535 (~100 ETH) +(4) 0x9c8bc949b634697c98efd275db97cc87d936c790 (~100 ETH) +(5) 0x345632ec32e459da68c62ae967216e7253d676c2 (~100 ETH) +(6) 0x2643f91ba26332d19136a5769a52ebba45664206 (~100 ETH) +(7) 0x9e6636b30928d72ee17788410b2e222bc9f6025d (~100 ETH) +(8) 0x31e98e2a637fc6289196947781361f1ca6437c49 (~100 ETH) +(9) 0x32282c09f837a1b9f4a74ebdd234172438442e95 (~100 ETH) +(20) 0x...... ``` -You need to first close any other processes that are using this port and start (ie. Geth, Parity, Ganache-cli, TestRPC etc..) - -You can now run the tests: +In another terminal window, you can now run the tests: ``` yarn tests ``` -You can run code-coverage tests: +To see code-coverage run: ``` yarn coverage ``` ## [Contracts](contracts) The SDK contracts can be upgradeable and thus before using variables and permissions must be set in the Database, Contract Manager, Platform Funds, Operator and approval for the ERC20Burner before use -Contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the [erc20 burner](contracts/access/ERC20Burner.sol). +Contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the ERC20Burner ### [Database](contracts/database) Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: From c0c2532bf1e841ed8ba78804992b260389a3cbf1 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:33:25 +0200 Subject: [PATCH 12/21] minor tweaking --- README.md | 58 ++++++++++++++++++++++++------------------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 15ae45cd..61836acb 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,11 @@ :factory: A software development kit for the automated machine economy. -The SDK's which contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to create crowdsales for digital assets, which are represented on the Ethereum blockchain as ERC20 dividend tokens. Crowdsales can receive ETH or ERC20 tokens, and the asset-tokens they produce and receive dividends in ETH or any ERC20 token depending on the preferences of the investors. +The SDK's are a group of contracts that contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to create crowdsales and receive dividends from assets. Crowdsales are essentially ICO's that produce dividend-tokens representing a particular asset. Crowdsales can receive ETH or ERC20 tokens, and the asset-tokens they produce can receive dividends in ETH or any ERC20 token depending on the preferences of the investors. -If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) or if you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) +If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) + +If you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) ## Getting Started First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable): @@ -39,21 +41,6 @@ yarn blockchain ```` You should see 20 accounts load up and see the local chain info: -``` -Available Accounts -================== -(0) 0x1395e096348847e656c0d6b699087c47996235c0 (~100 ETH) -(1) 0x0c317c12a25eb6ef6e0e12583bf6ef6cb75cfb5f (~100 ETH) -(2) 0x1e195348e46184fc67bb23c8dfe1dd58f96c551c (~100 ETH) -(3) 0x3b699ce55888f4001d44eab5c205f371a336e535 (~100 ETH) -(4) 0x9c8bc949b634697c98efd275db97cc87d936c790 (~100 ETH) -(5) 0x345632ec32e459da68c62ae967216e7253d676c2 (~100 ETH) -(6) 0x2643f91ba26332d19136a5769a52ebba45664206 (~100 ETH) -(7) 0x9e6636b30928d72ee17788410b2e222bc9f6025d (~100 ETH) -(8) 0x31e98e2a637fc6289196947781361f1ca6437c49 (~100 ETH) -(9) 0x32282c09f837a1b9f4a74ebdd234172438442e95 (~100 ETH) -(20) 0x...... -``` In another terminal window, you can now run the tests: ``` @@ -66,8 +53,14 @@ yarn coverage ``` ## [Contracts](contracts) -The SDK contracts can be upgradeable and thus before using variables and permissions must be set in the Database, Contract Manager, Platform Funds, Operator and approval for the ERC20Burner before use -Contracts in the SDK abstract storage into a non-upgradeable Database. All users of the platform must agree to the current state, and signal whether they wish to accept future upgrades by default. To run key functionality on the platform users must burn MYB tokens, using the ERC20Burner +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 +* Users must approve ERC20Burner to burn platform tokens before using key functionality +* 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 found below: ### [Database](contracts/database) Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: @@ -109,14 +102,14 @@ To give a contract write access to the database, you must call `addContract(cont 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 currentState = database.bytes32Storage(keccak256(abi.encodePacked("currentState"))); bytes32 newState = keccak256(abi.encodePacked(currentState, _contractAddress)); database.setBytes32(keccak256(abi.encodePacked("currentState")), newState); emit LogContractAdded(_contractAddress, _name, block.number); } ``` -Everytime a contract is added or updated the contract state will change, requiring approval from users before they interact with the platform. This can be done by calling the following function: +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: ```javascript function setContractStatePreferences(bool _acceptCurrentState, bool _ignoreStateChanges) @@ -141,15 +134,15 @@ To create new asset orders, or purchase existing asset orders, users must provab } ``` -* spender in this case is the address of the ERC20Burner contract. value should be placed high enough to avoid needing to approve the burner every use +* spender in this case should be the address of the ERC20Burner contract. value should be placed high enough to avoid needing to approve the burner every use -The functions that require burning are: -- CrowdsaleGeneratorETH.createAssetOrderETH() -- CrowdsaleETH.buyAssetOrderETH() -- CrowdsaleGeneratorERC20.createAssetOrderERC20() -- CrowdsaleERC20.buyAssetOrderERC20() -- AssetExchange.buyAsset() -- AssetExchange.createBuyOrder() +Functions that require burning: +- `CrowdsaleGeneratorETH.createAssetOrderETH()` +- `CrowdsaleETH.buyAssetOrderETH()` +- `CrowdsaleGeneratorERC20.createAssetOrderERC20()` +- `CrowdsaleERC20.buyAssetOrderERC20()` +- `AssetExchange.buyAsset()` +- `AssetExchange.createBuyOrder()` ### [Platform-Variables](contracts/ecosystem/PlatformFunds.sol) Before assets can be funded the platform owners must set the `platform token` and the `platform wallet` by using: @@ -161,7 +154,7 @@ Before assets can be funded the platform owners must set the `platform token` an emit LogPlatformWallet(_walletAddress); } ``` -:heavy_plus_sign: + :heavy_plus_sign: ```javascript // @notice @@ -256,7 +249,7 @@ We are working on giving investors governance tools to vote for new AssetManager ## Documentation -Documentation is created using Zeppelins [Solidity-Docgen](https://github.com/OpenZeppelin/solidity-docgen) +Documentation is created using [Solidity-Docgen](https://github.com/OpenZeppelin/solidity-docgen) ``` cd docs/website yarn build @@ -273,8 +266,7 @@ GIT_USER= \ -### ⚠️ Warning -This application is unstable and has not undergone any rigorous security audits. Use at your own risk. +### ⚠️ This application is unstable and has not undergone any rigorous security audits. Use at your own risk.

From 3223091c44df5e18009e8b525184676708802232 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:41:35 +0200 Subject: [PATCH 13/21] minor fixes --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61836acb..1d9685c0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ :factory: A software development kit for the automated machine economy. -The SDK's are a group of contracts that contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to create crowdsales and receive dividends from assets. Crowdsales are essentially ICO's that produce dividend-tokens representing a particular asset. Crowdsales can receive ETH or ERC20 tokens, and the asset-tokens they produce can receive dividends in ETH or any ERC20 token depending on the preferences of the investors. +The SDK's are a group of contracts that contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to generate crowdsales to create revenue producing assets. The crowdsale produces a dividend-tokens which can directly receive payment and distribute it to token holders. Crowdsales can take Ether or ERC20 tokens, and the asset-tokens produced can receive dividends in ETH or any ERC20 token depending on the preferences of the investors. If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) @@ -79,7 +79,8 @@ external { } ``` -The [API](contracts/database/API.sol) can be used to easily fetch variables from the database +### [API](contracts/database/API.sol) +The API contract can be used to easily fetch variables from the database ```javascript function getAssetFundingDeadline(bytes32 _assetID) public @@ -123,7 +124,7 @@ Everytime a contract is added or updated the contract state will change, requiri } ``` -### [ERC20Burner](contracts/access/ERC20Burner.sol) +### [TokenBurning](contracts/access/ERC20Burner.sol) To create new asset orders, or purchase existing asset orders, users must provably burn MYB using the burner. To do this each user must approve the burner contract to burn tokens by calling the MYB contract: ```javascript @@ -165,7 +166,7 @@ Before assets can be funded the platform owners must set the `platform token` an emit LogPlatformToken(_tokenAddress); } ``` -### [Operator](contracts/roles/Operator.sol) +### [Onboarding Operators](contracts/roles/Operator.sol) The Operator must be registered and define what currencies they are willing to receive as payment. To set the operators you can call: ```javascript From dfe61703ace157fa31cc56756c8caaaaaf46a923 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:45:16 +0200 Subject: [PATCH 14/21] playing with emojis --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1d9685c0..318d9648 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ :factory: A software development kit for the automated machine economy. -The SDK's are a group of contracts that contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). These contracts allow developers to generate crowdsales to create revenue producing assets. The crowdsale produces a dividend-tokens which can directly receive payment and distribute it to token holders. Crowdsales can take Ether or ERC20 tokens, and the asset-tokens produced can receive dividends in ETH or any ERC20 token depending on the preferences of the investors. + Network SDK's are a protocol that allows the creation of decentralised digital assets, funding and trading. It also enables the distribution of revenue generated by assets. These SDK's contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). -If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) +:large_blue_diamond: If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) -If you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) +:large_blue_diamond: If you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) ## Getting Started First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable): From 97e8e7dd4f972b109c04ca7f786f9ea21470a5a1 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 13:48:04 +0200 Subject: [PATCH 15/21] fix --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 318d9648..ad209156 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ 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 found below: +Basic functionality for these critical operations are outlined below: ### [Database](contracts/database) Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: @@ -125,7 +125,7 @@ Everytime a contract is added or updated the contract state will change, requiri ``` ### [TokenBurning](contracts/access/ERC20Burner.sol) -To create new asset orders, or purchase existing asset orders, users must provably burn MYB using the burner. To do this each user must approve the burner contract to burn tokens by calling the MYB contract: +To create new asset orders, or purchase existing asset orders, users must provably burn MYB using the [burner](contracts/access/ERC20Burner.sol). To do this each user must approve the burner contract to burn tokens by calling the MYB contract: ```javascript function approve(address _spender, uint256 _value) public returns (bool) { @@ -147,6 +147,7 @@ Functions that require burning: ### [Platform-Variables](contracts/ecosystem/PlatformFunds.sol) Before assets can be funded the platform owners must set the `platform token` and the `platform wallet` by using: + ```javascript function setPlatformWallet(address _walletAddress) external @@ -155,7 +156,7 @@ Before assets can be funded the platform owners must set the `platform token` an emit LogPlatformWallet(_walletAddress); } ``` - :heavy_plus_sign: +:heavy_plus_sign: ```javascript // @notice From 790617649e94b658e054a856025118c79f4c4e3d Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 14:03:26 +0200 Subject: [PATCH 16/21] added creating asset docs --- README.md | 106 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ad209156..d69d1e51 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Network SDK's are a protocol that allows the creation of decentralised digital assets, funding and trading. It also enables the distribution of revenue generated by assets. These SDK's contain all the functional logic of [MyBit-Go](https://github.com/MyBitFoundation/MyBit-Go.app). -:large_blue_diamond: If you would like to try a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) +* For a simple example see [Hello-Network](https://github.com/MyBitFoundation/hello-network) -:large_blue_diamond: If you would like to import the SDK contracts into your project as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) +* For importing the SDK's as an NPM package see [Network.js](https://github.com/MyBitFoundation/network.js) ## Getting Started First install dependencies using [Yarn](https://yarnpkg.com/lang/en/docs/install/#debian-stable): @@ -36,12 +36,12 @@ Done in 5.69s. Then get a local test blockchain running using [Ganache](https://truffleframework.com/ganache) +:heavy_exclamation_mark: Make sure no other applications are running on port 8545 + ```bash yarn blockchain ```` -You should see 20 accounts load up and see the local chain info: - In another terminal window, you can now run the tests: ``` yarn tests @@ -52,7 +52,18 @@ To see code-coverage run: yarn coverage ``` -## [Contracts](contracts) +## [Roles](contracts/roles) +The MYB SDK's have 4 fundamental roles: + +* Investor `must burn MYB to participate` +* AssetManager `must burn MYB to participate` +* Operator `must be registered by owners` +* Platform Owner(s) + +Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. + + +## [Contract Usage](contracts) 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 @@ -205,16 +216,87 @@ returns (bool) { } ``` -## [Roles](contracts/roles) -The MYB SDK's have 4 fundamental roles: +## Creating Assets +To create assets you will use [CrowdsaleGeneratorETH](contracts/crowdsale/CrowdsaleGeneratorETH) or [CrowdsaleGeneratorERC20](contracts/crowdsale/CrowdsaleGeneratorERC20) -* Investor `must burn MYB to participate` -* AssetManager `must burn MYB to participate` -* Operator `must be registered by owners` -* Platform Owner(s) +For Ether based crowdsales you would call `createAssetOrderETH()` from the AssetManager account, effectively creating a new crowdsale +```javascript + function createAssetOrderETH(string _assetURI, bytes32 _operatorID, uint _fundingLength, uint _amountToRaise, uint _assetManagerPerc) + external + burnRequired + returns (bool) { + require(_amountToRaise > 0); + require(_assetManagerPerc < 100); + require(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; + } +``` -Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. +## Funding Assets +To fund an asset you can use either [CrowdsaleETH](contracts/crowdsale/crowdsaleETH) or [CrowdsaleERC20](contracts/crowdsale/CrowdsaleERC20) + +For Ether based crowdsales you would call `buyAssetOrderETH()` from the investor account: +```javascript + 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 + require(assetToken.mint(database.addressStorage(keccak256(abi.encodePacked("assetManager", _assetID))), database.uintStorage(keccak256(abi.encodePacked("assetManagerFee", _assetID))))); + require(finalizeCrowdsale(_assetID)); // delete unnecessary variables + require(assetToken.mint(msg.sender, tokensRemaining)); // Send remaining asset tokens + require(assetToken.finishMinting()); + require(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 { + require(assetToken.mint(msg.sender, msg.value)); + } + emit LogAssetPurchased(_assetID, msg.sender, msg.value); + return true; +} +``` + +If the funding fails you can call `refund()` , which sends all funds to the asset-token contract to be redistributed to investors + +## Distributing Revenue +By default all assets generated on the platform are able to receive payments and distribute revenue equally to token holders. It accomplishes this by keeping track of how much value (WEI/Token) is contained in each asset-token. The token contract can receive payment in it's fallback function or by calling `issueDividends()` +Investors an withdraw income by calling `withdraw()` which updates their personal ledger: +```javascript + 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; + } +``` ## In-Development :construction: The SDK's are a work in progress and we hope to implement more features such as asset-governance, platform-governance and obfuscated asset authentication. From 54e82851d27fc92b4d936ab16322da4919ab7b1f Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 14:07:27 +0200 Subject: [PATCH 17/21] proofread --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d69d1e51..c2fcdf2d 100644 --- a/README.md +++ b/README.md @@ -74,14 +74,14 @@ Before creating assets, certain variables and parameters have to be set: Basic functionality for these critical operations are outlined below: ### [Database](contracts/database) -Contracts in the SDK store all long-term data in a non-upgradeable database contract. This allows for contracts to be upgraded without losing valuable data. The Database stores all data in a simple key:value manner. The key is always of bytes32 type, as they are the keccak256 hash of the variableName, ID, address etc: +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: ```javascript database.setUint(keccak256(abi.encodePacked("fundingDeadline", assetID)), 20000000); ``` -The [Database](contracts/database/Database.sol) then stores this with the function. `key = sha3("fundingDeadline", assetID)`, `value = tokenAddress` +The [Database](contracts/database/Database.sol) stores this with `key = sha3("fundingDeadline", assetID)` and `value = 20000000` ```javascript function setUint(bytes32 _key, address _value) onlyApprovedContract @@ -102,7 +102,7 @@ The API contract can be used to easily fetch variables from the database } ``` -### [ContractManager](contracts/database/ContractManager.sol) +### [ContractManagement](contracts/database/ContractManager.sol) To give a contract write access to the database, you must call `addContract(contractName, contractAddress)` from a platform owner account ```javascript function addContract(string _name, address _contractAddress) From 54a9acc80ccff42d8ca9a56442988c7ce098f4ca Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 14:11:59 +0200 Subject: [PATCH 18/21] added burning example --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index c2fcdf2d..2356aaf4 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,19 @@ To create new asset orders, or purchase existing asset orders, users must provab * spender in this case should be the address of the ERC20Burner contract. value should be placed high enough to avoid needing to approve the burner every use +Tokens are burnt before the function runs due to the modifier `burnRequired` which calls `burn()` at the [burner](contracts/access/ERC20Burner.sol) contract: +```javascript + 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; + } +``` + Functions that require burning: - `CrowdsaleGeneratorETH.createAssetOrderETH()` - `CrowdsaleETH.buyAssetOrderETH()` @@ -215,6 +228,7 @@ returns (bool) { return true; } ``` +:heavy_exclamation_mark: The Operator can choose to accept Ether and an unlimited number of ERC20 tokens if they choose. ## Creating Assets To create assets you will use [CrowdsaleGeneratorETH](contracts/crowdsale/CrowdsaleGeneratorETH) or [CrowdsaleGeneratorERC20](contracts/crowdsale/CrowdsaleGeneratorERC20) From c77c044793e43d079ffc02ee363a1783e8a60d1e Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 14:20:15 +0200 Subject: [PATCH 19/21] header change --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2356aaf4..3c37dea0 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ The MYB SDK's have 4 fundamental roles: Investors can contribute ETH or Erc20 tokens to invest in new asset crowdsales. The assets are managed 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 install the asset. 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. -## [Contract Usage](contracts) +## Setting Up The Platform 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 @@ -228,7 +228,7 @@ returns (bool) { return true; } ``` -:heavy_exclamation_mark: The Operator can choose to accept Ether and an unlimited number of ERC20 tokens if they choose. +:heavy_exclamation_mark: The Operator can choose to accept Ether and an unlimited number of ERC20 tokens if they want. ## Creating Assets To create assets you will use [CrowdsaleGeneratorETH](contracts/crowdsale/CrowdsaleGeneratorETH) or [CrowdsaleGeneratorERC20](contracts/crowdsale/CrowdsaleGeneratorERC20) @@ -364,7 +364,7 @@ GIT_USER= \ -### ⚠️ This application is unstable and has not undergone any rigorous security audits. Use at your own risk. +⚠️ This application is unstable and has not undergone any rigorous security audits. Use at your own risk.

From 618e0782235e5857ab5c9ba35f50fe1f0186d9ed Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 14:22:06 +0200 Subject: [PATCH 20/21] link to contracts folder --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c37dea0..153bf2d7 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ 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: +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. From 16f1163c20575d592f1d79b583d0879d5419a520 Mon Sep 17 00:00:00 2001 From: Kyle Dewy Date: Fri, 19 Oct 2018 15:25:36 +0200 Subject: [PATCH 21/21] deleted line --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 153bf2d7..b6d8c012 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,6 @@ Done in 5.69s. Then get a local test blockchain running using [Ganache](https://truffleframework.com/ganache) -:heavy_exclamation_mark: Make sure no other applications are running on port 8545 - ```bash yarn blockchain ````