Skip to content

Commit

Permalink
Small refactoring, deleted event- debugger from contract
Browse files Browse the repository at this point in the history
  • Loading branch information
cyborgshead committed Jan 28, 2019
1 parent 644046c commit 9b18aaf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 140 deletions.
2 changes: 1 addition & 1 deletion contracts/chaingear/Chaingear.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ contract Chaingear is IChaingear, Ownable, SupportsInterfaceWithLookup, Pausable
mapping(string => DatabaseBuilder) private buildersVersion;

Safe private chaingearSafe;
uint256 private databaseCreationFeeWei = 1 finney;
uint256 private databaseCreationFeeWei = 1 ether;

string private constant CHAINGEAR_DESCRIPTION = "The novel Ethereum database framework";
bytes4 private constant INTERFACE_CHAINGEAR_EULER_ID = 0xea1db66f;
Expand Down
1 change: 0 additions & 1 deletion contracts/databases/DatabaseV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pragma solidity 0.4.25;

import "openzeppelin-solidity/contracts/introspection/SupportsInterfaceWithLookup.sol";
import "openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol";
import "openzeppelin-solidity/contracts/payment/SplitPayment.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";

Expand Down
2 changes: 0 additions & 2 deletions contracts/databases/FeeSplitterDatabase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ contract FeeSplitterDatabase is PaymentSplitter, DatabasePermissionControl {
address newAddress
);
event PayeesDeleted();
event Log();

constructor(address[] _payees, uint256[] _shares)
public
Expand Down Expand Up @@ -66,7 +65,6 @@ contract FeeSplitterDatabase is PaymentSplitter, DatabasePermissionControl {
address account = payees[i];
delete shares[account];
delete released[account];
emit Log();
}
payees.length = 0;
totalShares = 0;
Expand Down
146 changes: 12 additions & 134 deletions migrations/3_deploy_chaingear_and_add_builder.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var Chaingear = artifacts.require("./chaingear/Chaingear.sol");
var DatabaseBuilderV1 = artifacts.require("./builders/DatabaseBuilderV1.sol");
var DatabaseV1 = artifacts.require("./databases/DatabaseV1.sol");
var Safe = artifacts.require("./common/Safe.sol");

var AppsSchema = artifacts.require("./schemas/AppsSchema.sol");
var TeamSchema = artifacts.require("./schemas/TeamSchema.sol");
Expand All @@ -19,9 +20,8 @@ module.exports = async function(deployer, network, accounts) {
let databaseMeta;
let hash;
let database;
let BENEFICIARIES = ["0x0000000000000000000000000000000000000042"];
let BENEFICIARIES = ["0xE93984eC26Df9a71a094e3d159b4Ed05E6d73fb0"];
let SHARES = [100];
let BUILDING_FEE = web3.utils.toWei('1', 'finney');

const builder = await DatabaseBuilderV1.deployed();
const chaingear = await deployer.deploy(
Expand All @@ -36,138 +36,16 @@ module.exports = async function(deployer, network, accounts) {
"V1",
builder.address,
hash[0].path,
"Basic version of registry"
"Basic version of database"
);

if (network === 'development2') {
console.log("Deployment of CYB Application Store Database");

await chaingear.createDatabase(
"V1",
BENEFICIARIES,
SHARES,
"CYB Application Store",
"APP",
{ value: BUILDING_FEE }
)

ids = await chaingear.getDatabasesIDs();
databaseMeta = await chaingear.getDatabase(ids.slice(-1)[0].toNumber());

hash = await ipfs.files.add(Buffer.from(JSON.stringify(AppsSchema.abi)));
console.log("CID of AppsSchema ABI in IPFS >>>> ", hash[0].path);

database = await DatabaseV1.at(databaseMeta[2]);
await database.initializeDatabase(
hash[0].path,
AppsSchema.bytecode,
{
from: accounts[0]
}
);

console.log("Deployment of cyber•Search Team Database");

await chaingear.createDatabase(
"V1",
BENEFICIARIES,
SHARES,
"cyber•Search Team",
"MEMBER",
{ value: BUILDING_FEE }
)

ids = await chaingear.getDatabasesIDs();
databaseMeta = await chaingear.getDatabase(ids.slice(-1)[0].toNumber());

hash = await ipfs.files.add(Buffer.from(JSON.stringify(TeamSchema.abi)));
console.log("CID of TeamSchema ABI in IPFS >>>> ", hash[0].path);

database = await DatabaseV1.at(databaseMeta[2]);
await database.initializeDatabase(
hash[0].path,
TeamSchema.bytecode,
{
from: accounts[0]
}
);

console.log("Deployment of cybernodes Database");

await chaingear.createDatabase(
"V1",
BENEFICIARIES,
SHARES,
"cybernodes Registry",
"CYBERNODE",
{ value: BUILDING_FEE }
)

ids = await chaingear.getDatabasesIDs();
databaseMeta = await chaingear.getDatabase(ids.slice(-1)[0].toNumber());

hash = await ipfs.files.add(Buffer.from(JSON.stringify(NodesSchema.abi)));
console.log("CID of NodesSchema ABI in IPFS >>>> ", hash[0].path);

database = await DatabaseV1.at(databaseMeta[2]);
await database.initializeDatabase(
hash[0].path,
NodesSchema.bytecode,
{
from: accounts[0]
}
);

console.log("Deployment of Ports Database");

await chaingear.createDatabase(
"V1",
BENEFICIARIES,
SHARES,
"Ports Registry",
"PORT",
{ value: BUILDING_FEE }
)

ids = await chaingear.getDatabasesIDs();
databaseMeta = await chaingear.getDatabase(ids.slice(-1)[0].toNumber());

hash = await ipfs.files.add(Buffer.from(JSON.stringify(PortsSchema.abi)));
console.log("CID of PortsSchema ABI in IPFS >>>> ", hash[0].path);

database = await DatabaseV1.at(databaseMeta[2]);
await database.initializeDatabase(
hash[0].path,
PortsSchema.bytecode,
{
from: accounts[0]
}
);

console.log("Deployment of CYB Features Database");

await chaingear.createDatabase(
"V1",
BENEFICIARIES,
SHARES,
"CYB Features Registry",
"FEATURE",
{ value: BUILDING_FEE }
)

ids = await chaingear.getDatabasesIDs();
databaseMeta = await chaingear.getDatabase(ids.slice(-1)[0].toNumber());

hash = await ipfs.files.add(Buffer.from(JSON.stringify(FeaturesSchema.abi)));
console.log("CID of FeaturesSchema ABI in IPFS >>>> ", hash[0].path);

database = await DatabaseV1.at(databaseMeta[2]);
await database.initializeDatabase(
hash[0].path,
FeaturesSchema.bytecode,
{
from: accounts[0]
}
);
}
const db = await deployer.deploy(
DatabaseV1,
BENEFICIARIES,
SHARES,
"verification-database",
"VRFD"
);

const safe = await deployer.deploy(Safe);
};
4 changes: 2 additions & 2 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
from: infuraConfigRinkeby.fromAddress,
network_id: 4,
gasPrice: toWei(10, 'gwei').toNumber(),
gas: toWei(7, 'mwei').toNumber(),
gas: toWei(6.8, 'mwei').toNumber(),
confirmations: 2,
skipDryRun: true
},
Expand All @@ -58,7 +58,7 @@ module.exports = {
return new HDWalletProvider(infuraConfigMainnet.privateKey, infuraConfigMainnet.infuraUrl);
},
from: infuraConfigMainnet.fromAddress,
network_id: 0,
network_id: 1,
gasPrice: toWei(10, 'gwei').toNumber(),
gas: toWei(7, 'mwei').toNumber(),
confirmations: 2,
Expand Down

0 comments on commit 9b18aaf

Please sign in to comment.