diff --git a/contracts/teller-network/License.sol b/contracts/teller-network/License.sol index c40af8f2..b9a9f756 100644 --- a/contracts/teller-network/License.sol +++ b/contracts/teller-network/License.sol @@ -14,6 +14,7 @@ contract License is Ownable, ApproveAndCallFallBack { uint256 public price; ERC20Token token; + address burnAddress; struct LicenseDetails { uint price; @@ -31,9 +32,10 @@ contract License is Ownable, ApproveAndCallFallBack { * @param _tokenAddress Address of token used to pay for licenses (SNT) * @param _price Price of the licenses */ - constructor(address _tokenAddress, uint256 _price) public { + constructor(address _tokenAddress, uint256 _price, address _burnAddress) public { price = _price; token = ERC20Token(_tokenAddress); + burnAddress = _burnAddress; } /** diff --git a/embarkConfig/contracts.js b/embarkConfig/contracts.js index 6c570a25..553cb987 100644 --- a/embarkConfig/contracts.js +++ b/embarkConfig/contracts.js @@ -75,7 +75,8 @@ module.exports = { instanceOf: "License", args: [ "$SNT", - LICENSE_PRICE + LICENSE_PRICE, + "$StakingPool" ] }, "MetadataStore": { @@ -85,7 +86,8 @@ module.exports = { instanceOf: "License", args: [ "$SNT", - ARB_LICENSE_PRICE + ARB_LICENSE_PRICE, + "$StakingPool" ] }, Escrow: { @@ -115,6 +117,12 @@ module.exports = { true ] }, + "StakingPool": { + file: 'staking-pool/contracts/StakingPool.sol', + args: [ + "$SNT" + ] + }, "RLPReader": { file: 'tabookey-gasless/contracts/RLPReader.sol' }, diff --git a/package.json b/package.json index 91811d51..4b995e26 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ "redux-persist": "^5.10.0", "redux-saga": "^0.16.2", "sass-loader": "^7.1.0", + "staking-pool": "^0.0.1", "tabookey-gasless": "^0.3.3-a", "web3": "1.0.0-beta.37" }, diff --git a/test/escrow_spec.js b/test/escrow_spec.js index 98dae328..6ef3e188 100644 --- a/test/escrow_spec.js +++ b/test/escrow_spec.js @@ -58,11 +58,15 @@ config({ }, SellerLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] }, ArbitrationLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] + }, + StakingPool: { + file: 'staking-pool/contracts/StakingPool.sol', + args: ["$SNT"] }, MetadataStore: { args: ["$SellerLicense", "$ArbitrationLicense"] diff --git a/test/funding_escrows_spec.js b/test/funding_escrows_spec.js index 4d39d759..433d5836 100644 --- a/test/funding_escrows_spec.js +++ b/test/funding_escrows_spec.js @@ -40,14 +40,18 @@ config({ }, SellerLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] }, MetadataStore: { args: ["$SellerLicense", "$ArbitrationLicense"] }, ArbitrationLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] + }, + StakingPool: { + file: 'staking-pool/contracts/StakingPool.sol', + args: ["$SNT"] }, Escrow: { args: ["$SellerLicense", "$ArbitrationLicense", "$MetadataStore", "$SNT", "0x0000000000000000000000000000000000000001", feeAmount], diff --git a/test/license_spec.js b/test/license_spec.js index c59db368..8eef9fa1 100644 --- a/test/license_spec.js +++ b/test/license_spec.js @@ -4,6 +4,7 @@ const TestUtils = require("../utils/testUtils"); const License = require('Embark/contracts/License'); const SNT = require('Embark/contracts/SNT'); +const StakingPool = require('Embark/contracts/StakingPool'); let accounts; @@ -27,8 +28,12 @@ config({ ] }, License: { - args: ["$SNT", 10] - } + args: ["$SNT", 10, "$StakingPool"] + }, + StakingPool: { + file: 'staking-pool/contracts/StakingPool.sol', + args: ["$SNT"] + }, } }, (_err, web3_accounts) => { accounts = web3_accounts; @@ -68,8 +73,8 @@ contract("License", function () { isLicenseOwner = await License.methods.isLicenseOwner(accounts[0]).call(); assert.strictEqual(isLicenseOwner, true); - const contractBalance = await SNT.methods.balanceOf(License.options.address).call(); - assert.strictEqual(contractBalance, "10", "Contract balance is incorrect"); + const stakingBalance = await SNT.methods.balanceOf(StakingPool.options.address).call(); + assert.strictEqual(stakingBalance, "10", "Contract balance is incorrect"); }); it("should buy license with approveAndCall", async () => { diff --git a/test/metadata_store_spec.js b/test/metadata_store_spec.js index 748e2f3b..992b38da 100644 --- a/test/metadata_store_spec.js +++ b/test/metadata_store_spec.js @@ -31,11 +31,15 @@ config({ }, SellerLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] }, ArbitrationLicense: { instanceOf: "License", - args: ["$SNT", 10] + args: ["$SNT", 10, "$StakingPool"] + }, + StakingPool: { + file: 'staking-pool/contracts/StakingPool.sol', + args: ["$SNT"] }, MetadataStore: { args: ["$SellerLicense", "$ArbitrationLicense"] diff --git a/yarn.lock b/yarn.lock index eff0134f..af307fe4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12840,6 +12840,11 @@ onetime@^2.0.0: dependencies: mimic-fn "^1.0.0" +openzeppelin-solidity@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-2.3.0.tgz#1ab7b4cc3782a5472ed61eb740c56a8bfdd74119" + integrity sha512-QYeiPLvB1oSbDt6lDQvvpx7k8ODczvE474hb2kLXZBPKMsxKT1WxTCHBYrCU7kS7hfAku4DcJ0jqOyL+jvjwQw== + opn@5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/opn/-/opn-5.3.0.tgz#64871565c863875f052cfdf53d3e3cb5adb53b1c" @@ -16789,6 +16794,14 @@ stack-utils@^1.0.1: resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== +staking-pool@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/staking-pool/-/staking-pool-0.0.1.tgz#1b2d53a232bc2d1385249252759844cef64c1b7d" + integrity sha512-Bom97X4qxL4704ojPFYpuRJNihPcUiEuWb8yIL8ZiUn80daTeFfkf+bFLTRDvKD9cMKicxAoXw5vUNilrpPIJw== + dependencies: + embark "^4.0.2" + openzeppelin-solidity "^2.3.0" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"