Skip to content

Commit

Permalink
Merge pull request #245 from oceanprotocol/fix/token-template-cap
Browse files Browse the repository at this point in the history
Fix/token template cap
  • Loading branch information
ssallam authored Oct 14, 2020
2 parents a8df897 + c3e61e3 commit 5ff2375
Show file tree
Hide file tree
Showing 22 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion artifacts/BConst.json
Original file line number Diff line number Diff line change
Expand Up @@ -2837,7 +2837,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.045Z",
"updatedAt": "2020-10-13T14:53:16.516Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -3024,7 +3024,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.047Z",
"updatedAt": "2020-10-13T14:53:16.537Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BMath.json
Original file line number Diff line number Diff line change
Expand Up @@ -16482,7 +16482,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.049Z",
"updatedAt": "2020-10-13T14:53:16.546Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BNum.json
Original file line number Diff line number Diff line change
Expand Up @@ -13037,7 +13037,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.057Z",
"updatedAt": "2020-10-13T14:53:16.577Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BPool.json
Original file line number Diff line number Diff line change
Expand Up @@ -66915,7 +66915,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.063Z",
"updatedAt": "2020-10-13T14:53:16.602Z",
"devdoc": {
"details": "Used by the (Ocean version) BFactory contract as a bytecode reference to deploy new BPools. * This contract is is nearly identical to the BPool.sol contract at [1] The only difference is the \"Proxy contract functionality\" section given below. We'd inherit from BPool if we could, for simplicity. But we can't, because the proxy section needs to access private variables declared in BPool, and Solidity disallows this. Therefore the best we can do for now is clearly demarcate the proxy section. * [1] https://github.com/balancer-labs/balancer-core/contracts/.",
"methods": {},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BToken.json
Original file line number Diff line number Diff line change
Expand Up @@ -14000,7 +14000,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.089Z",
"updatedAt": "2020-10-13T14:53:16.675Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/BTokenBase.json
Original file line number Diff line number Diff line change
Expand Up @@ -13783,7 +13783,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.096Z",
"updatedAt": "2020-10-13T14:53:16.705Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/Context.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.125Z",
"updatedAt": "2020-10-13T14:53:16.733Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/DTFactory.json
Original file line number Diff line number Diff line change
Expand Up @@ -4538,7 +4538,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.038Z",
"updatedAt": "2020-10-13T14:53:16.505Z",
"devdoc": {
"author": "Ocean Protocol Team",
"details": "Implementation of Ocean DataTokens Factory * DTFactory deploys DataToken proxy contracts. New DataToken proxy contracts are links to the template contract's bytecode. Proxy contract functionality is based on Ocean Protocol custom implementation of ERC1167 standard.",
Expand Down
2 changes: 1 addition & 1 deletion artifacts/DataTokenTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14458,7 +14458,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.118Z",
"updatedAt": "2020-10-13T14:53:16.724Z",
"devdoc": {
"details": "DataTokenTemplate is an ERC20 compliant token template Used by the factory contract as a bytecode reference to deploy new DataTokens.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/Deployer.json
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.125Z",
"updatedAt": "2020-10-13T14:53:16.733Z",
"devdoc": {
"author": "Ocean Protocol Team",
"details": "Contract Deployer This contract allowes factory contract to deploy new contract instances using the same library pattern in solidity. the logic it self is deployed only once, but executed in the context of the new storage contract (new contract instance)",
Expand Down
2 changes: 1 addition & 1 deletion artifacts/ERC20.json
Original file line number Diff line number Diff line change
Expand Up @@ -11318,7 +11318,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.128Z",
"updatedAt": "2020-10-13T14:53:16.736Z",
"devdoc": {
"details": "Implementation of the {IERC20} interface. * This implementation is agnostic to the way tokens are created. This means that a supply mechanism has to be added in a derived contract using {_mint}. For a generic mechanism see {ERC20Mintable}. * TIP: For a detailed writeup see our guide https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How to implement supply mechanisms]. * We have followed general OpenZeppelin guidelines: functions revert instead of returning `false` on failure. This behavior is nonetheless conventional and does not conflict with the expectations of ERC20 applications. * Additionally, an {Approval} event is emitted on calls to {transferFrom}. This allows applications to reconstruct the allowance for all accounts just by listening to said events. Other implementations of the EIP may not emit these events, as it isn't required by the specification. * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} functions have been added to mitigate the well-known issues around setting allowances. See {IERC20-approve}.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/FixedRateExchange.json
Original file line number Diff line number Diff line change
Expand Up @@ -16232,7 +16232,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.104Z",
"updatedAt": "2020-10-13T14:53:16.714Z",
"devdoc": {
"details": "FixedRateExchange is a fixed rate exchange Contract Marketplaces uses this contract to allow consumers exchanging datatokens with ocean token using a fixed exchange rate.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/IERC20.json
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.131Z",
"updatedAt": "2020-10-13T14:53:16.743Z",
"devdoc": {
"details": "Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/IERC20Template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.115Z",
"updatedAt": "2020-10-13T14:53:16.721Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/Metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.117Z",
"updatedAt": "2020-10-13T14:53:16.723Z",
"devdoc": {
"details": "Metadata stands for Decentralized Document. It allows publishers to publish their dataset metadata in decentralized way. It follows the Ocean DID Document standard: https://github.com/oceanprotocol/OEPs/blob/master/7/v0.2/README.md",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/Migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.044Z",
"updatedAt": "2020-10-13T14:53:16.511Z",
"devdoc": {
"methods": {}
},
Expand Down
2 changes: 1 addition & 1 deletion artifacts/OPFCommunityFeeCollector.json
Original file line number Diff line number Diff line change
Expand Up @@ -3296,7 +3296,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.102Z",
"updatedAt": "2020-10-13T14:53:16.713Z",
"devdoc": {
"details": "Ocean Protocol Foundation Community Fee Collector contract allows consumers to pay very small fee as part of the exchange of data tokens with ocean token in order to support the community of ocean protocol and provide a sustainble development.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/Ownable.json
Original file line number Diff line number Diff line change
Expand Up @@ -3059,7 +3059,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.127Z",
"updatedAt": "2020-10-13T14:53:16.735Z",
"devdoc": {
"details": "Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. * This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.",
"methods": {
Expand Down
2 changes: 1 addition & 1 deletion artifacts/SafeMath.json
Original file line number Diff line number Diff line change
Expand Up @@ -4882,7 +4882,7 @@
},
"networks": {},
"schemaVersion": "3.2.4",
"updatedAt": "2020-10-09T20:18:27.126Z",
"updatedAt": "2020-10-13T14:53:16.734Z",
"devdoc": {
"details": "Wrappers over Solidity's arithmetic operations with added overflow checks. * Arithmetic operations in Solidity wrap on overflow. This can easily result in bugs, because programmers usually assume that an overflow raises an error, which is the standard behavior in high level programming languages. `SafeMath` restores this intuition by reverting the transaction when an operation overflows. * Using this library instead of the unchecked operations eliminates an entire class of bugs, so it's recommended to use it always.",
"methods": {}
Expand Down
10 changes: 5 additions & 5 deletions artifacts/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"Ocean": "0x8967BCF84170c91B0d24D4302C2376283b0B3a07"
},
"development": {
"DTFactory": "0x1e6d9207241DbDca82B0D9546490c97B24B1a9f6",
"BFactory": "0x98b6901cE7C9fc65dBeeC98598136593EB7b4c6C",
"FixedRateExchange": "0x91EB42b164664cB28a09B0cF9651b404Ee105afA",
"Metadata": "0x9C2a015129969c98E9A5BcBEb61A5F907FF5b629",
"Ocean": "0x2fC1fd21cb222Dc180Ef817dE4c426fd9230b5A5"
"DTFactory": "0xF2796e64c80dBd32889359afa022152F1ea02912",
"BFactory": "0xB4dD18067fa16917dB96A41170e8a8CD73a93121",
"FixedRateExchange": "0x4c31aB8cC2cA64Bb0ba2fbb75aA92c7CB706F535",
"Metadata": "0x5a568768dD36cb993Bc0c3F6E038d9cFFa854610",
"Ocean": "0xE5A5b593Fd3e2913dB110d65c6029b974CCC86Cc"
}
}
10 changes: 8 additions & 2 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env mocha */
/* global artifacts */
/* global artifacts, web3 */
const fs = require('fs')
var DataTokenTemplate = artifacts.require('./DataTokenTemplate.sol')
var DTFactory = artifacts.require('./DTFactory.sol')
Expand Down Expand Up @@ -29,12 +29,18 @@ module.exports = function(deployer, network, accounts) {
communityCollector,
OPFOwner
)

let cap = 10000000
if (networkName === 'development' || networkName === 'ganache') {
cap = web3.utils.toWei('100000')
}

await deployer.deploy(
DataTokenTemplate,
'DataTokenTemplate',
'DTT',
accounts[0],
10000000,
cap,
'http://oceanprotocol.com',
OPFCommunityFeeCollector.address
)
Expand Down

0 comments on commit 5ff2375

Please sign in to comment.