From b0eb08e105edd9a8ae63cff0445c022fc15c18a4 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 15:55:23 -0400 Subject: [PATCH 01/14] Removed bytes field from contracts --- .../contracts/service/DelegateManager.sol | 9 +--- .../service/ServiceProviderFactory.sol | 10 ++-- eth-contracts/contracts/staking/Staking.sol | 46 ++++++------------- .../contracts/staking/StakingInterface.sol | 14 +++--- .../contracts/test/MockStakingCaller.sol | 10 ++-- 5 files changed, 29 insertions(+), 60 deletions(-) diff --git a/eth-contracts/contracts/service/DelegateManager.sol b/eth-contracts/contracts/service/DelegateManager.sol index 22c90882866..2932ef9f771 100644 --- a/eth-contracts/contracts/service/DelegateManager.sol +++ b/eth-contracts/contracts/service/DelegateManager.sol @@ -67,9 +67,6 @@ contract DelegateManager is RegistryContract { // Requester to pending undelegate request mapping (address => UndelegateStakeRequest) undelegateRequests; - // TODO: Evaluate whether this is necessary - bytes empty; - event IncreaseDelegatedStake( address _delegator, address _serviceProvider, @@ -136,8 +133,7 @@ contract DelegateManager is RegistryContract { stakingContract.delegateStakeFor( _targetSP, delegator, - _amount, - empty + _amount ); // Update list of delegators to SP if necessary @@ -275,8 +271,7 @@ contract DelegateManager is RegistryContract { ).undelegateStakeFor( serviceProvider, delegator, - unstakeAmount, - empty + unstakeAmount ); // Update amount staked from this delegator to targeted service provider diff --git a/eth-contracts/contracts/service/ServiceProviderFactory.sol b/eth-contracts/contracts/service/ServiceProviderFactory.sol index 63082c99357..e8229b67ca5 100644 --- a/eth-contracts/contracts/service/ServiceProviderFactory.sol +++ b/eth-contracts/contracts/service/ServiceProviderFactory.sol @@ -13,7 +13,6 @@ contract ServiceProviderFactory is RegistryContract { bytes32 private governanceKey; bytes32 private serviceTypeManagerKey; address private deployerAddress; - bytes empty; /// @dev - Stores following entities /// 1) Directly staked amount by SP, not including delegators @@ -148,7 +147,7 @@ contract ServiceProviderFactory is RegistryContract { if (_stakeAmount > 0) { StakingInterface( registry.getContract(stakingProxyOwnerKey) - ).stakeFor(msg.sender, _stakeAmount, empty); + ).stakeFor(msg.sender, _stakeAmount); } require ( @@ -231,8 +230,7 @@ contract ServiceProviderFactory is RegistryContract { unstakeAmount = stakingContract.totalStakedFor(msg.sender); stakingContract.unstakeFor( msg.sender, - unstakeAmount, - empty + unstakeAmount ); // Update deployer total @@ -313,7 +311,7 @@ contract ServiceProviderFactory is RegistryContract { ); // Stake increased token amount for msg.sender - stakingContract.stakeFor(msg.sender, _increaseStakeAmount, empty); + stakingContract.stakeFor(msg.sender, _increaseStakeAmount); uint newStakeAmount = stakingContract.totalStakedFor(msg.sender); @@ -358,7 +356,7 @@ contract ServiceProviderFactory is RegistryContract { "Please deregister endpoints to remove all stake"); // Decrease staked token amount for msg.sender - stakingContract.unstakeFor(msg.sender, _decreaseStakeAmount, empty); + stakingContract.unstakeFor(msg.sender, _decreaseStakeAmount); // Query current stake uint newStakeAmount = stakingContract.totalStakedFor(msg.sender); diff --git a/eth-contracts/contracts/staking/Staking.sol b/eth-contracts/contracts/staking/Staking.sol index aef7a758c72..1b3d0947882 100644 --- a/eth-contracts/contracts/staking/Staking.sol +++ b/eth-contracts/contracts/staking/Staking.sol @@ -86,11 +86,7 @@ contract Staking is RegistryContract, StakingInterface { msg.sender == registry.getContract(claimsManagerProxyKey), "Only callable from ClaimsManager" ); - _stakeFor( - _stakerAccount, - msg.sender, - _amount, - bytes("")); // TODO: RM bytes requirement if unused + _stakeFor(_stakerAccount, msg.sender, _amount); // Update claim history even if no value claimed accounts[_stakerAccount].claimHistory.add(block.number.toUint64(), _amount); @@ -130,12 +126,10 @@ contract Staking is RegistryContract, StakingInterface { * @notice Stakes `_amount` tokens, transferring them from _accountAddress, and assigns them to `_accountAddress` * @param _accountAddress The final staker of the tokens * @param _amount Number of tokens staked - * @param _data Used in Staked event, to add signalling information in more complex staking applications */ function stakeFor( address _accountAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); @@ -146,20 +140,17 @@ contract Staking is RegistryContract, StakingInterface { _stakeFor( _accountAddress, _accountAddress, - _amount, - _data); + _amount); } /** * @notice Unstakes `_amount` tokens, returning them to the desired account. * @param _accountAddress Account unstaked for, and token recipient * @param _amount Number of tokens staked - * @param _data Used in Unstaked event, to add signalling information in more complex staking applications */ function unstakeFor( address _accountAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); @@ -170,8 +161,7 @@ contract Staking is RegistryContract, StakingInterface { _unstakeFor( _accountAddress, _accountAddress, - _amount, - _data + _amount ); } @@ -180,13 +170,11 @@ contract Staking is RegistryContract, StakingInterface { * @param _accountAddress The final staker of the tokens * @param _delegatorAddress Address from which to transfer tokens * @param _amount Number of tokens staked - * @param _data Used in Staked event, to add signalling information in more complex staking applications */ function delegateStakeFor( address _accountAddress, address _delegatorAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); require( @@ -196,8 +184,7 @@ contract Staking is RegistryContract, StakingInterface { _stakeFor( _accountAddress, _delegatorAddress, - _amount, - _data); + _amount); } /** @@ -205,13 +192,11 @@ contract Staking is RegistryContract, StakingInterface { * @param _accountAddress The staker of the tokens * @param _delegatorAddress Address from which to transfer tokens * @param _amount Number of tokens unstaked - * @param _data Used in Staked event, to add signalling information in more complex staking applications */ function undelegateStakeFor( address _accountAddress, address _delegatorAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); require( @@ -221,8 +206,7 @@ contract Staking is RegistryContract, StakingInterface { _unstakeFor( _accountAddress, _delegatorAddress, - _amount, - _data); + _amount); } /** @@ -315,8 +299,7 @@ contract Staking is RegistryContract, StakingInterface { function _stakeFor( address _stakeAccount, address _transferAccount, - uint256 _amount, - bytes memory _data + uint256 _amount ) internal { // staking 0 tokens is invalid @@ -334,15 +317,13 @@ contract Staking is RegistryContract, StakingInterface { emit Staked( _stakeAccount, _amount, - totalStakedFor(_stakeAccount), - _data); + totalStakedFor(_stakeAccount)); } function _unstakeFor( address _stakeAccount, address _transferAccount, - uint256 _amount, - bytes memory _data + uint256 _amount ) internal { require(_amount > 0, ERROR_AMOUNT_ZERO); @@ -359,8 +340,7 @@ contract Staking is RegistryContract, StakingInterface { emit Unstaked( _stakeAccount, _amount, - totalStakedFor(_stakeAccount), - _data + totalStakedFor(_stakeAccount) ); } diff --git a/eth-contracts/contracts/staking/StakingInterface.sol b/eth-contracts/contracts/staking/StakingInterface.sol index d7dec1f4ab9..c4c03aef722 100644 --- a/eth-contracts/contracts/staking/StakingInterface.sol +++ b/eth-contracts/contracts/staking/StakingInterface.sol @@ -5,23 +5,21 @@ pragma solidity ^0.5.0; // Modified interface for ERC900: https://eips.ethereum.org/EIPS/eip-900 // Eliminates direct stake operations interface StakingInterface { - event Staked(address indexed user, uint256 amount, uint256 total, bytes data); - event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data); + event Staked(address indexed user, uint256 amount, uint256 total); + event Unstaked(address indexed user, uint256 amount, uint256 total); - function stakeFor(address user, uint256 amount, bytes calldata data) external; - function unstakeFor(address user, uint256 amount, bytes calldata data) external; + function stakeFor(address user, uint256 amount) external; + function unstakeFor(address user, uint256 amount) external; function stakeRewards(uint256 amount, address stakerAccount) external; function delegateStakeFor( address accountAddress, address delegatorAddress, - uint256 amount, - bytes calldata data) external; + uint256 amount) external; function undelegateStakeFor( address accountAddress, address delegatorAddress, - uint256 amount, - bytes calldata data) external; + uint256 amount) external; function slash(uint256 amount, address slashAddress) external; diff --git a/eth-contracts/contracts/test/MockStakingCaller.sol b/eth-contracts/contracts/test/MockStakingCaller.sol index 882f9b4a0a8..9473fa279c6 100644 --- a/eth-contracts/contracts/test/MockStakingCaller.sol +++ b/eth-contracts/contracts/test/MockStakingCaller.sol @@ -44,21 +44,19 @@ contract MockStakingCaller is RegistryContract { // Test only function function stakeFor( address _accountAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); - staking.stakeFor(_accountAddress, _amount, _data); + staking.stakeFor(_accountAddress, _amount); } // Test only function function unstakeFor( address _accountAddress, - uint256 _amount, - bytes calldata _data + uint256 _amount ) external { requireIsInitialized(); - staking.unstakeFor(_accountAddress, _amount, _data); + staking.unstakeFor(_accountAddress, _amount); } function slash( From 34f67bbaabbe64db2e7676c8c2534b2a6c4cd48a Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 16:04:35 -0400 Subject: [PATCH 02/14] Test fixes --- eth-contracts/test/claimsManager.test.js | 3 +-- eth-contracts/test/staking.test.js | 21 +++++++-------------- eth-contracts/test/upgradeProxy.test.js | 3 +-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/eth-contracts/test/claimsManager.test.js b/eth-contracts/test/claimsManager.test.js index 69e379f0e23..15455aea638 100644 --- a/eth-contracts/test/claimsManager.test.js +++ b/eth-contracts/test/claimsManager.test.js @@ -48,8 +48,7 @@ contract('ClaimsManager', async (accounts) => { // Stake tokens await mockStakingCaller.stakeFor( staker, - amount, - web3.utils.utf8ToHex('')) + amount) } beforeEach(async () => { diff --git a/eth-contracts/test/staking.test.js b/eth-contracts/test/staking.test.js index 28e6bdf00c1..f3f248bdf07 100644 --- a/eth-contracts/test/staking.test.js +++ b/eth-contracts/test/staking.test.js @@ -34,16 +34,14 @@ contract('Staking test', async (accounts) => { const [deployerAddress, proxyAdminAddress, proxyDeployerAddress] = accounts - const EMPTY_STRING = '' - const approveAndStake = async (amount, staker) => { // allow Staking app to move owner tokens await token.approve(stakingAddress, amount, { from: staker }) // stake tokens await mockStakingCaller.stakeFor( staker, - amount, - web3.utils.utf8ToHex(EMPTY_STRING)) + amount + ) } const getStakedAmountForAcct = async (acct) => { @@ -112,8 +110,7 @@ contract('Staking test', async (accounts) => { await _lib.assertRevert( mockStakingCaller.stakeFor( staker, - 0, - web3.utils.utf8ToHex(EMPTY_STRING) + 0 ), "STAKING_AMOUNT_ZERO" ) @@ -124,16 +121,14 @@ contract('Staking test', async (accounts) => { await _lib.assertRevert( mockStakingCaller.unstakeFor( deployerAddress, - DEFAULT_AMOUNT + 1, - web3.utils.utf8ToHex(EMPTY_STRING) + DEFAULT_AMOUNT + 1 ), "Cannot decrease greater than current balance" ) await _lib.assertRevert( mockStakingCaller.unstakeFor( deployerAddress, - 0, - web3.utils.utf8ToHex(EMPTY_STRING) + 0 )) }) @@ -155,8 +150,7 @@ contract('Staking test', async (accounts) => { // stake tokens await mockStakingCaller.stakeFor( staker, - DEFAULT_AMOUNT, - web3.utils.utf8ToHex(EMPTY_STRING)) + DEFAULT_AMOUNT) let finalTotalStaked = parseInt(await staking.totalStaked()) assert.equal( @@ -191,8 +185,7 @@ contract('Staking test', async (accounts) => { // Unstake default amount await mockStakingCaller.unstakeFor( staker, - DEFAULT_AMOUNT, - web3.utils.utf8ToHex(EMPTY_STRING) + DEFAULT_AMOUNT ) const finalOwnerBalance = await getTokenBalance(token, staker) diff --git a/eth-contracts/test/upgradeProxy.test.js b/eth-contracts/test/upgradeProxy.test.js index 7079df0416d..6c5c40a0bdb 100644 --- a/eth-contracts/test/upgradeProxy.test.js +++ b/eth-contracts/test/upgradeProxy.test.js @@ -47,8 +47,7 @@ contract('Upgrade proxy test', async (accounts) => { // stake tokens await mockStakingCaller.stakeFor( staker, - amount, - web3.utils.utf8ToHex('')) + amount) } beforeEach(async () => { From dbedeb0c893eec00e163cddc18a0c25f6cdf11b5 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 16:15:35 -0400 Subject: [PATCH 03/14] Remove unused events --- eth-contracts/contracts/staking/Staking.sol | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/eth-contracts/contracts/staking/Staking.sol b/eth-contracts/contracts/staking/Staking.sol index 1b3d0947882..33e2bb1193f 100644 --- a/eth-contracts/contracts/staking/Staking.sol +++ b/eth-contracts/contracts/staking/Staking.sol @@ -43,17 +43,6 @@ contract Staking is RegistryContract, StakingInterface { bytes32 delegateManagerKey; bytes32 serviceProviderFactoryKey; - event StakeTransferred( - address indexed from, - uint256 amount, - address to - ); - - event Claimed( - address claimaint, - uint256 amountClaimed - ); - event Slashed(address indexed user, uint256 amount, uint256 total); function initialize( From faf09c14c29844860f24a47b48e370ba3b0a5172 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 20:04:13 -0400 Subject: [PATCH 04/14] FIrst events validated now --- eth-contracts/package-lock.json | 612 ++++++++++++++++++--- eth-contracts/package.json | 1 + eth-contracts/test/serviceProvider.test.js | 10 +- 3 files changed, 553 insertions(+), 70 deletions(-) diff --git a/eth-contracts/package-lock.json b/eth-contracts/package-lock.json index 03ecda35028..25a25bdaa53 100644 --- a/eth-contracts/package-lock.json +++ b/eth-contracts/package-lock.json @@ -35,11 +35,110 @@ "fastq": "^1.6.0" } }, + "@openzeppelin/contract-loader": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@openzeppelin/contract-loader/-/contract-loader-0.4.0.tgz", + "integrity": "sha512-K+Pl4tn0FbxMSP0H9sgi61ayCbecpqhQmuBshelC7A3q2MlpcqWRJan0xijpwdtv6TORNd5oZNe/+f3l+GD6tw==", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "fs-extra": "^8.1.0", + "try-require": "^1.2.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + } + } + }, "@openzeppelin/contracts-ethereum-package": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@openzeppelin/contracts-ethereum-package/-/contracts-ethereum-package-2.5.0.tgz", "integrity": "sha512-14CijdTyy4Y/3D3UUeFC2oW12nt1Yq1M8gFOtkuODEvSYPe3YSAKnKyhUeGf0UDNCZzwfGr15KdiFK6AoJjoSQ==" }, + "@openzeppelin/test-helpers": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@openzeppelin/test-helpers/-/test-helpers-0.5.5.tgz", + "integrity": "sha512-jTSCQojQ0Q7FBMN3Me7o0OIVuRnfHRR9TcE+ZlfbSfdqrHkFLwSfeDHSNWtQGlF1xPQR5r3iRI0ccsCrN+JblA==", + "dev": true, + "requires": { + "@openzeppelin/contract-loader": "^0.4.0", + "@truffle/contract": "^4.0.35", + "ansi-colors": "^3.2.3", + "chai": "^4.2.0", + "chai-bn": "^0.2.1", + "ethjs-abi": "^0.2.1", + "lodash.flatten": "^4.4.0", + "semver": "^5.6.0", + "web3": "^1.2.1", + "web3-utils": "^1.2.1" + }, + "dependencies": { + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + } + } + }, "@openzeppelin/upgrades": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades/-/upgrades-2.8.0.tgz", @@ -627,6 +726,217 @@ "defer-to-connect": "^1.0.1" } }, + "@truffle/blockchain-utils": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.0.18.tgz", + "integrity": "sha512-XnRu5p1QO9krJizOeBY5WfzPDvEOmCnOT5u6qF8uN3Kkq9vcH3ZqW4XTuzz9ERZNpZfWb3UJx4PUosgeHLs5vw==", + "dev": true, + "requires": { + "source-map-support": "^0.5.16" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "@truffle/contract": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.2.3.tgz", + "integrity": "sha512-nC6BNvUTDWt1zceDQkrIodaYgwN5UIau5tMfSM4FuOYMAHKxytN7s9fC6vLzyTFzFHohyQ0fEmsCEbRNDGjhAQ==", + "dev": true, + "requires": { + "@truffle/blockchain-utils": "^0.0.18", + "@truffle/contract-schema": "^3.1.0", + "@truffle/error": "^0.0.8", + "@truffle/interface-adapter": "^0.4.6", + "bignumber.js": "^7.2.1", + "ethereum-ens": "^0.8.0", + "ethers": "^4.0.0-beta.1", + "exorcist": "^1.0.1", + "source-map-support": "^0.5.16", + "web3": "1.2.1", + "web3-core-helpers": "1.2.1", + "web3-core-promievent": "1.2.1", + "web3-eth-abi": "1.2.1", + "web3-utils": "1.2.1" + }, + "dependencies": { + "@truffle/error": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.8.tgz", + "integrity": "sha512-x55rtRuNfRO1azmZ30iR0pf0OJ6flQqbax1hJz+Avk1K5fdmOv5cr22s9qFnwTWnS6Bw0jvJEoR0ITsM7cPKtQ==", + "dev": true + }, + "@truffle/interface-adapter": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.4.6.tgz", + "integrity": "sha512-FZAUb7tx/7VbxpAbo70+K2v22j1O7y4BwhWypRwYpf1YbE2C1OCo/L8zInaW5LfzRd2BEsfb2GjUgbK9VaFrDA==", + "dev": true, + "requires": { + "bn.js": "^4.11.8", + "ethers": "^4.0.32", + "source-map-support": "^0.5.16", + "web3": "1.2.1" + }, + "dependencies": { + "ethers": { + "version": "4.0.47", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.47.tgz", + "integrity": "sha512-hssRYhngV4hiDNeZmVU/k5/E8xmLG8UpcNUzg6mb7lqhgpFPH/t7nuv20RjRrEf0gblzvi2XwR5Te+V3ZFc9pQ==", + "dev": true, + "requires": { + "aes-js": "3.0.0", + "bn.js": "^4.4.0", + "elliptic": "6.5.2", + "hash.js": "1.1.3", + "js-sha3": "0.5.7", + "scrypt-js": "2.0.4", + "setimmediate": "1.0.4", + "uuid": "2.0.1", + "xmlhttprequest": "1.8.0" + } + } + } + }, + "bignumber.js": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", + "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==", + "dev": true + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + }, + "scrypt-js": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.4.tgz", + "integrity": "sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw==", + "dev": true + }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", + "dev": true + } + } + }, + "@truffle/contract-schema": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@truffle/contract-schema/-/contract-schema-3.1.0.tgz", + "integrity": "sha512-eCMc1CwAmxIpQDsuGM9rCp4q/6GMcdQLTw3Tzd1qufyuti0vWGQwJbBAgSvfofr9ItXHueGwn7I5lVsIbOVYpQ==", + "dev": true, + "requires": { + "ajv": "^6.10.0", + "crypto-js": "^3.1.9-1", + "debug": "^4.1.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "@truffle/error": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.0.7.tgz", @@ -1449,6 +1759,12 @@ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -2541,6 +2857,26 @@ } } }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chai-bn": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.2.1.tgz", + "integrity": "sha512-01jt2gSXAw7UYFPT5K8d7HYjdXj2vyeIuE+0T/34FWzlNcVbs1JkPxRu7rYMfQnJhrHT8Nr6qjSf5ZwwLU2EYg==", + "dev": true + }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -2559,6 +2895,12 @@ "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "dev": true }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -2927,6 +3269,12 @@ "randomfill": "^1.0.3" } }, + "crypto-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", + "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==", + "dev": true + }, "d": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", @@ -3063,6 +3411,15 @@ } } }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -3910,6 +4267,28 @@ } } }, + "ethereum-ens": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/ethereum-ens/-/ethereum-ens-0.8.0.tgz", + "integrity": "sha512-a8cBTF4AWw1Q1Y37V1LSCS9pRY4Mh3f8vCg5cbXCCEJ3eno1hbI/+Ccv9SZLISYpqQhaglP3Bxb/34lS4Qf7Bg==", + "dev": true, + "requires": { + "bluebird": "^3.4.7", + "eth-ens-namehash": "^2.0.0", + "js-sha3": "^0.5.7", + "pako": "^1.0.4", + "underscore": "^1.8.3", + "web3": "^1.0.0-beta.34" + }, + "dependencies": { + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", + "dev": true + } + } + }, "ethereumjs-abi": { "version": "0.6.7", "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.7.tgz", @@ -4001,6 +4380,31 @@ } } }, + "ethjs-abi": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.1.tgz", + "integrity": "sha1-4KepOn6BFjqUR3utVu3lJKtt5TM=", + "dev": true, + "requires": { + "bn.js": "4.11.6", + "js-sha3": "0.5.5", + "number-to-bn": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=", + "dev": true + }, + "js-sha3": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", + "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=", + "dev": true + } + } + }, "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -4074,6 +4478,26 @@ "strip-eof": "^1.0.0" } }, + "exorcist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/exorcist/-/exorcist-1.0.1.tgz", + "integrity": "sha1-eTFuPEiFhFSQ97tAXA5bXbEWfFI=", + "dev": true, + "requires": { + "is-stream": "~1.1.0", + "minimist": "0.0.5", + "mkdirp": "~0.5.1", + "mold-source-map": "~0.4.0" + }, + "dependencies": { + "minimist": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", + "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", + "dev": true + } + } + }, "expand-brackets": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", @@ -4842,25 +5266,25 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "resolved": false, "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "resolved": false, "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "optional": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "resolved": false, "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "resolved": false, "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "optional": true, "requires": { @@ -4870,13 +5294,13 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "resolved": false, "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "resolved": false, "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "optional": true, "requires": { @@ -4886,37 +5310,37 @@ }, "chownr": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "resolved": false, "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "resolved": false, "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "resolved": false, "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "resolved": false, "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "optional": true }, "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "resolved": false, "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "optional": true, "requires": { @@ -4925,25 +5349,25 @@ }, "deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "resolved": false, "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "resolved": false, "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "resolved": false, "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "resolved": false, "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "optional": true, "requires": { @@ -4952,13 +5376,13 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "resolved": false, "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "resolved": false, "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "optional": true, "requires": { @@ -4974,7 +5398,7 @@ }, "glob": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "resolved": false, "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "optional": true, "requires": { @@ -4988,13 +5412,13 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "resolved": false, "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "resolved": false, "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "optional": true, "requires": { @@ -5003,7 +5427,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "resolved": false, "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "optional": true, "requires": { @@ -5012,7 +5436,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "resolved": false, "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "optional": true, "requires": { @@ -5022,19 +5446,19 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "resolved": false, "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "optional": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "resolved": false, "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "optional": true }, "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", + "resolved": false, "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "optional": true, "requires": { @@ -5043,13 +5467,13 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "resolved": false, "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "resolved": false, "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "optional": true, "requires": { @@ -5058,13 +5482,13 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": false, "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "optional": true }, "minipass": { "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", + "resolved": false, "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", "optional": true, "requires": { @@ -5074,7 +5498,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", + "resolved": false, "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", "optional": true, "requires": { @@ -5083,7 +5507,7 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": false, "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "optional": true, "requires": { @@ -5092,13 +5516,13 @@ }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "resolved": false, "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "optional": true }, "needle": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "resolved": false, "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", "optional": true, "requires": { @@ -5109,7 +5533,7 @@ }, "node-pre-gyp": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", + "resolved": false, "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", "optional": true, "requires": { @@ -5127,7 +5551,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "resolved": false, "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "optional": true, "requires": { @@ -5137,13 +5561,13 @@ }, "npm-bundled": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "resolved": false, "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", "optional": true }, "npm-packlist": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", + "resolved": false, "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", "optional": true, "requires": { @@ -5153,7 +5577,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "resolved": false, "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "optional": true, "requires": { @@ -5165,19 +5589,19 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "resolved": false, "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "resolved": false, "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "resolved": false, "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "optional": true, "requires": { @@ -5186,19 +5610,19 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": false, "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "resolved": false, "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "optional": true, "requires": { @@ -5208,19 +5632,19 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": false, "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "resolved": false, "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "optional": true }, "rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "resolved": false, "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "optional": true, "requires": { @@ -5232,7 +5656,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": false, "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "optional": true } @@ -5240,7 +5664,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": false, "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "optional": true, "requires": { @@ -5255,7 +5679,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "resolved": false, "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "optional": true, "requires": { @@ -5264,43 +5688,43 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "resolved": false, "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "resolved": false, "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "resolved": false, "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "optional": true }, "semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "resolved": false, "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "resolved": false, "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "resolved": false, "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": false, "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "optional": true, "requires": { @@ -5311,7 +5735,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": false, "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "optional": true, "requires": { @@ -5320,7 +5744,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "resolved": false, "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "optional": true, "requires": { @@ -5329,13 +5753,13 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "resolved": false, "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "optional": true }, "tar": { "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", + "resolved": false, "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", "optional": true, "requires": { @@ -5350,13 +5774,13 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "resolved": false, "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "resolved": false, "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "optional": true, "requires": { @@ -5365,13 +5789,13 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "resolved": false, "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "optional": true }, "yallist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "resolved": false, "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", "optional": true } @@ -6066,6 +6490,12 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -7725,6 +8155,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, "lodash.toarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", @@ -8322,6 +8758,24 @@ "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.10.1.tgz", "integrity": "sha512-w22rOL5ZYu6HbUehB5deurghGM0hS/xBVyHMGKOuQctkk93J9z9VEOhDsiWrXOprVNQpP9uzGKdl8v9mFspKuw==" }, + "mold-source-map": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mold-source-map/-/mold-source-map-0.4.0.tgz", + "integrity": "sha1-z2fgsxxHq5uttcnCVlGGISe7gxc=", + "dev": true, + "requires": { + "convert-source-map": "^1.1.0", + "through": "~2.2.7" + }, + "dependencies": { + "through": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/through/-/through-2.2.7.tgz", + "integrity": "sha1-bo4hIAGR1OtqmfbwEN9Gqhxusr0=", + "dev": true + } + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -8765,6 +9219,12 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, "parse-asn1": { "version": "5.1.4", "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", @@ -8895,6 +9355,12 @@ "pinkie-promise": "^2.0.0" } }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -11498,6 +11964,12 @@ "websocket": "^1.0.28" } }, + "try-require": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/try-require/-/try-require-1.2.1.tgz", + "integrity": "sha1-NEiaLKwMCcHMEO2RugEVlNQzO+I=", + "dev": true + }, "tsort": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", @@ -11530,6 +12002,12 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -12086,7 +12564,7 @@ }, "dependencies": { "websocket": { - "version": "github:web3-js/WebSocket-Node#905deb4812572b344f5801f8c9ce8bb02799d82e", + "version": "github:web3-js/WebSocket-Node#b134a75541b5db59668df81c03e926cd5f325077", "from": "github:web3-js/WebSocket-Node#polyfill/globalThis", "requires": { "debug": "^2.2.0", diff --git a/eth-contracts/package.json b/eth-contracts/package.json index 1861e5e683b..e73c907560a 100644 --- a/eth-contracts/package.json +++ b/eth-contracts/package.json @@ -39,6 +39,7 @@ "truffle-hdwallet-provider": "^1.0.13" }, "devDependencies": { + "@openzeppelin/test-helpers": "^0.5.5", "async": "^2.6.1", "babel-register": "^6.26.0", "bignumber.js": "8.0.1", diff --git a/eth-contracts/test/serviceProvider.test.js b/eth-contracts/test/serviceProvider.test.js index 74180f40b30..4c5cd06e656 100644 --- a/eth-contracts/test/serviceProvider.test.js +++ b/eth-contracts/test/serviceProvider.test.js @@ -1,5 +1,6 @@ import * as _lib from './_lib/lib.js' const encodeCall = require('../utils/encodeCall') +const { expectEvent } = require('@openzeppelin/test-helpers') const AudiusToken = artifacts.require('AudiusToken') const Registry = artifacts.require('Registry') @@ -149,6 +150,9 @@ contract('ServiceProvider test', async (accounts) => { account, { from: account }) + await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'RegisteredServiceProvider', { _owner: account }) + await expectEvent.inTransaction(tx.tx, Staking, 'Staked', { user: account, amount: amount }) + let args = tx.logs.find(log => log.event === 'RegisteredServiceProvider').args args.stakedAmountInt = fromBn(args._stakeAmount) args.spID = fromBn(args._spID) @@ -162,12 +166,12 @@ contract('ServiceProvider test', async (accounts) => { increase, { from: account }) + let expectedNewStake = (await staking.totalStakedFor(account)).add(increase) let tx = await serviceProviderFactory.increaseStake( increase, { from: account }) - let args = tx.logs.find(log => log.event === 'UpdatedStakeAmount').args - // console.dir(args, { depth: 5 }) + await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'UpdatedStakeAmount', { _owner: account, _stakeAmount: expectedNewStake }) } const getStakeAmountForAccount = async (account) => { @@ -479,7 +483,7 @@ contract('ServiceProvider test', async (accounts) => { 'Minimum stake threshold exceeded') }) - it('increases stake value', async () => { + it.only('increases stake value', async () => { // Confirm initial amount in staking contract assert.equal(await getStakeAmountForAccount(stakerAccount), DEFAULT_AMOUNT) From 8b0dabf1110702fb4b2bc1e64f92846a1cb8ef11 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 20:16:50 -0400 Subject: [PATCH 05/14] - --- eth-contracts/test/serviceProvider.test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth-contracts/test/serviceProvider.test.js b/eth-contracts/test/serviceProvider.test.js index 4c5cd06e656..e199c7a3426 100644 --- a/eth-contracts/test/serviceProvider.test.js +++ b/eth-contracts/test/serviceProvider.test.js @@ -143,6 +143,7 @@ contract('ServiceProvider test', async (accounts) => { // Approve staking transfer await token.approve(staking.address, amount, { from: account }) + let expectedNewStake = (await staking.totalStakedFor(account)).add(amount) let tx = await serviceProviderFactory.register( type, endpoint, @@ -150,7 +151,7 @@ contract('ServiceProvider test', async (accounts) => { account, { from: account }) - await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'RegisteredServiceProvider', { _owner: account }) + await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'RegisteredServiceProvider', { _owner: account, _stakeAmount: expectedNewStake }) await expectEvent.inTransaction(tx.tx, Staking, 'Staked', { user: account, amount: amount }) let args = tx.logs.find(log => log.event === 'RegisteredServiceProvider').args From 442f9595465fa103691fe6ce6a7a966cea357827 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Wed, 6 May 2020 20:31:56 -0400 Subject: [PATCH 06/14] More event validation --- eth-contracts/test/serviceProvider.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth-contracts/test/serviceProvider.test.js b/eth-contracts/test/serviceProvider.test.js index e199c7a3426..8ac613421f1 100644 --- a/eth-contracts/test/serviceProvider.test.js +++ b/eth-contracts/test/serviceProvider.test.js @@ -180,13 +180,15 @@ contract('ServiceProvider test', async (accounts) => { } const decreaseRegisteredProviderStake = async (decrease, account) => { + let expectedNewStake = (await staking.totalStakedFor(account)).sub(decrease) // Approve token transfer from staking contract to account let tx = await serviceProviderFactory.decreaseStake( decrease, { from: account }) let args = tx.logs.find(log => log.event === 'UpdatedStakeAmount').args - // console.dir(args, { depth: 5 }) + await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'UpdatedStakeAmount', { _owner: account, _stakeAmount: expectedNewStake }) + await expectEvent.inTransaction(tx.tx, Staking, 'Unstaked', { user: account, amount: decrease }) } const deregisterServiceProvider = async (type, endpoint, account) => { @@ -484,7 +486,7 @@ contract('ServiceProvider test', async (accounts) => { 'Minimum stake threshold exceeded') }) - it.only('increases stake value', async () => { + it('increases stake value', async () => { // Confirm initial amount in staking contract assert.equal(await getStakeAmountForAccount(stakerAccount), DEFAULT_AMOUNT) From 14981d9aee428685e5b50e693e41b40628bb79f3 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 13:16:27 -0400 Subject: [PATCH 07/14] Fix tests --- eth-contracts/test/serviceProvider.test.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eth-contracts/test/serviceProvider.test.js b/eth-contracts/test/serviceProvider.test.js index 8ac613421f1..b6f0ebff488 100644 --- a/eth-contracts/test/serviceProvider.test.js +++ b/eth-contracts/test/serviceProvider.test.js @@ -143,6 +143,10 @@ contract('ServiceProvider test', async (accounts) => { // Approve staking transfer await token.approve(staking.address, amount, { from: account }) + // Convert to BN if necessary + if(!web3.utils.isBN(amount)) { + amount = web3.utils.toBN(amount) + } let expectedNewStake = (await staking.totalStakedFor(account)).add(amount) let tx = await serviceProviderFactory.register( type, @@ -152,7 +156,9 @@ contract('ServiceProvider test', async (accounts) => { { from: account }) await expectEvent.inTransaction(tx.tx, ServiceProviderFactory, 'RegisteredServiceProvider', { _owner: account, _stakeAmount: expectedNewStake }) - await expectEvent.inTransaction(tx.tx, Staking, 'Staked', { user: account, amount: amount }) + if (amount > 0) { + await expectEvent.inTransaction(tx.tx, Staking, 'Staked', { user: account, amount: amount }) + } let args = tx.logs.find(log => log.event === 'RegisteredServiceProvider').args args.stakedAmountInt = fromBn(args._stakeAmount) @@ -180,6 +186,9 @@ contract('ServiceProvider test', async (accounts) => { } const decreaseRegisteredProviderStake = async (decrease, account) => { + if(!web3.utils.isBN(decrease)) { + decrease = web3.utils.toBN(decrease) + } let expectedNewStake = (await staking.totalStakedFor(account)).sub(decrease) // Approve token transfer from staking contract to account let tx = await serviceProviderFactory.decreaseStake( From eb01a67112425326a18323cf0c8dc4ea65e4efed Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 15:11:55 -0400 Subject: [PATCH 08/14] Use oz-helpers for time operations --- eth-contracts/test/_lib/lib.js | 26 ---------------------- eth-contracts/test/claimsManager.test.js | 24 +++++++------------- eth-contracts/test/delegateManager.test.js | 20 +++++------------ eth-contracts/test/governance.test.js | 5 +++-- 4 files changed, 17 insertions(+), 58 deletions(-) diff --git a/eth-contracts/test/_lib/lib.js b/eth-contracts/test/_lib/lib.js index e20b997aa80..392cfd89b7e 100644 --- a/eth-contracts/test/_lib/lib.js +++ b/eth-contracts/test/_lib/lib.js @@ -87,29 +87,3 @@ export const assertRevert = async (blockOrPromise, expectedReason) => { const expectedMsgFound = error.message.indexOf(expectedReason) >= 0 assert.isTrue(expectedMsgFound, `Expected revert reason not found. Expected '${expectedReason}'. Found '${error.message}'`) } - -/** */ -export const advanceBlock = (web3) => { - return new Promise((resolve, reject) => { - web3.currentProvider.send({ - jsonrpc: '2.0', - method: 'evm_mine', - id: new Date().getTime() - }, (err, result) => { - if (err) { return reject(err) } - const newBlockHash = web3.eth.getBlock('latest').hash - - return resolve(newBlockHash) - }) - }) -} - -export const advanceToTargetBlock = async (targetBlockNumber, web3) => { - let currentBlock = await web3.eth.getBlock('latest') - let currentBlockNum = currentBlock.number - while (currentBlockNum < targetBlockNumber) { - await advanceBlock(web3) - currentBlock = await web3.eth.getBlock('latest') - currentBlockNum = currentBlock.number - } -} diff --git a/eth-contracts/test/claimsManager.test.js b/eth-contracts/test/claimsManager.test.js index 15455aea638..d77486d9162 100644 --- a/eth-contracts/test/claimsManager.test.js +++ b/eth-contracts/test/claimsManager.test.js @@ -1,5 +1,6 @@ import * as _lib from './_lib/lib.js' const encodeCall = require('../utils/encodeCall') +const { time } = require('@openzeppelin/test-helpers') const AudiusToken = artifacts.require('AudiusToken') const Registry = artifacts.require('Registry') @@ -176,18 +177,12 @@ contract('ClaimsManager', async (accounts) => { claimsManager.initiateRound({ from: controllerAddress }), 'Required block difference not met') - let currentBlock = await getLatestBlock() - let currentBlockNum = currentBlock.number let lastClaimBlock = await claimsManager.getLastFundBlock() let claimDiff = await claimsManager.getFundingRoundBlockDiff() let nextClaimBlock = lastClaimBlock.add(claimDiff) // Advance blocks to the next valid claim - while (currentBlockNum < nextClaimBlock) { - await _lib.advanceBlock(web3) - currentBlock = await getLatestBlock() - currentBlockNum = currentBlock.number - } + await time.advanceBlockTo(nextClaimBlock) // No change expected after block diff totalStaked = await staking.totalStaked() @@ -223,19 +218,16 @@ contract('ClaimsManager', async (accounts) => { // Stake default amount await approveTransferAndStake(DEFAULT_AMOUNT, staker) - let currentBlock = await getLatestBlock() - let currentBlockNum = currentBlock.number + // Initiate 1st claim + await claimsManager.initiateRound({ from: controllerAddress }) + let lastClaimBlock = await claimsManager.getLastFundBlock() let claimDiff = await claimsManager.getFundingRoundBlockDiff() let twiceClaimDiff = claimDiff.mul(new BN('2')) - let nextClaimBlock = lastClaimBlock.add(twiceClaimDiff) + let nextClaimBlockTwiceDiff = lastClaimBlock.add(twiceClaimDiff) - // Advance blocks to the next valid claim - while (currentBlockNum < nextClaimBlock) { - await _lib.advanceBlock(web3) - currentBlock = await getLatestBlock() - currentBlockNum = currentBlock.number - } + // Advance blocks to the target + await time.advanceBlockTo(nextClaimBlockTwiceDiff) // Initiate claim await claimsManager.initiateRound({ from: controllerAddress }) diff --git a/eth-contracts/test/delegateManager.test.js b/eth-contracts/test/delegateManager.test.js index 86f2d87a2e6..e52d9174485 100644 --- a/eth-contracts/test/delegateManager.test.js +++ b/eth-contracts/test/delegateManager.test.js @@ -1,5 +1,6 @@ import * as _lib from './_lib/lib.js' const encodeCall = require('../utils/encodeCall') +const { time } = require('@openzeppelin/test-helpers') const Registry = artifacts.require('Registry') const AudiusToken = artifacts.require('AudiusToken') @@ -397,10 +398,7 @@ contract('DelegateManager', async (accounts) => { ) // Advance to valid block - await _lib.advanceToTargetBlock( - fromBn(undelegateRequestInfo.lockupExpiryBlock), - web3 - ) + await time.advanceBlockTo(undelegateRequestInfo.lockupExpiryBlock) // Undelegate stake delegateManager.undelegateStake({ from: delegatorAccount1 }) @@ -787,10 +785,7 @@ contract('DelegateManager', async (accounts) => { 'Expect request to match undelegate amount') // Advance to valid block - await _lib.advanceToTargetBlock( - fromBn(undelegateRequestInfo.lockupExpiryBlock), - web3 - ) + await time.advanceBlockTo(undelegateRequestInfo.lockupExpiryBlock) let currentBlock = await web3.eth.getBlock('latest') let currentBlockNum = currentBlock.number assert.isTrue( @@ -975,10 +970,7 @@ contract('DelegateManager', async (accounts) => { 'Expect request to match undelegate amount') // Advance to valid block - await _lib.advanceToTargetBlock( - fromBn(undelegateRequestInfo.lockupExpiryBlock), - web3 - ) + await time.advanceBlockTo(undelegateRequestInfo.lockupExpiryBlock) let currentBlock = await web3.eth.getBlock('latest') let currentBlockNum = currentBlock.number assert.isTrue( @@ -1071,7 +1063,7 @@ contract('DelegateManager', async (accounts) => { let failUndelegateAmount = minDelegateStake.sub(toWei(30)) await delegateManager.requestUndelegateStake(stakerAccount, failUndelegateAmount, { from: delegatorAccount1 }) let undelegateRequestInfo = await delegateManager.getPendingUndelegateRequest(delegatorAccount1) - await _lib.advanceToTargetBlock(fromBn(undelegateRequestInfo.lockupExpiryBlock), web3) + await time.advanceBlockTo(undelegateRequestInfo.lockupExpiryBlock) await _lib.assertRevert( delegateManager.undelegateStake({ from: delegatorAccount1 }), 'Minimum delegation amount' @@ -1082,7 +1074,7 @@ contract('DelegateManager', async (accounts) => { // Undelegate all stake and confirm min delegation amount does not prevent withdrawal await delegateManager.requestUndelegateStake(stakerAccount, minDelegateStake, { from: delegatorAccount1 }) undelegateRequestInfo = await delegateManager.getPendingUndelegateRequest(delegatorAccount1) - await _lib.advanceToTargetBlock(fromBn(undelegateRequestInfo.lockupExpiryBlock), web3) + await time.advanceBlockTo(undelegateRequestInfo.lockupExpiryBlock) // Finalize undelegation, confirm operation is allowed await delegateManager.undelegateStake({ from: delegatorAccount1 }) diff --git a/eth-contracts/test/governance.test.js b/eth-contracts/test/governance.test.js index 3b4c2e8e3e7..944ea3efab7 100644 --- a/eth-contracts/test/governance.test.js +++ b/eth-contracts/test/governance.test.js @@ -3,6 +3,7 @@ const BigNum = require('bignumber.js') import * as _lib from './_lib/lib.js' const encodeCall = require('../utils/encodeCall') +const { time } = require('@openzeppelin/test-helpers') const Registry = artifacts.require('Registry') const AudiusToken = artifacts.require('AudiusToken') @@ -457,7 +458,7 @@ contract('Governance.sol', async (accounts) => { // Advance blocks to the next valid claim proposalStartBlockNumber = parseInt(_lib.parseTx(submitProposalTxReceipt).event.args.startBlockNumber) - await _lib.advanceToTargetBlock(proposalStartBlockNumber + votingPeriod, web3) + await time.advanceBlockTo(proposalStartBlockNumber + votingPeriod) }) it('Confirm proposal evaluated correctly + transaction executed', async () => { @@ -657,7 +658,7 @@ contract('Governance.sol', async (accounts) => { // Advance blocks to after proposal evaluation period const proposalStartBlock = parseInt(_lib.parseTx(submitTxReceipt).event.args.startBlockNumber) - await _lib.advanceToTargetBlock(proposalStartBlock + votingPeriod, web3) + await time.advanceBlockTo(proposalStartBlock + votingPeriod) // Call evaluateProposalOutcome() const evaluateTxReceipt = await governance.evaluateProposalOutcome(proposalId, { from: proposerAddress }) From 9e356acaad3c10ee0f7e476f09accef0bbe286db Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 16:31:43 -0400 Subject: [PATCH 09/14] Minor nit --- eth-contracts/test/_lib/lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth-contracts/test/_lib/lib.js b/eth-contracts/test/_lib/lib.js index db22c050840..19f361e680d 100644 --- a/eth-contracts/test/_lib/lib.js +++ b/eth-contracts/test/_lib/lib.js @@ -111,7 +111,7 @@ export const abiDecode = (types, data) => { } export const keccak256 = (values) => { - return ethers.utils.keccak256(values); + return ethers.utils.keccak256(values) } export const registerServiceProvider = async (token, staking, serviceProviderFactory, type, endpoint, amount, account) => { From f088e4a7d968b5af3f619d817e5b01311ac31698 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 17:15:44 -0400 Subject: [PATCH 10/14] Write addr info to file --- eth-contracts/.gitignore | 1 + eth-contracts/migrations/2_token_migration.js | 3 ++- .../migrations/3_registry_migration.js | 1 + .../migrations/9_output_address_info.js | 21 +++++++++++++++++++ eth-contracts/migrations/migrate-output.json | 1 + 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 eth-contracts/migrations/9_output_address_info.js create mode 100644 eth-contracts/migrations/migrate-output.json diff --git a/eth-contracts/.gitignore b/eth-contracts/.gitignore index c1b943b1259..893718cb824 100644 --- a/eth-contracts/.gitignore +++ b/eth-contracts/.gitignore @@ -9,3 +9,4 @@ build/ coverage/ coverage.json coverage.zip +migrations/migration-output.json diff --git a/eth-contracts/migrations/2_token_migration.js b/eth-contracts/migrations/2_token_migration.js index d53e3f566fc..9745c9ad2ff 100644 --- a/eth-contracts/migrations/2_token_migration.js +++ b/eth-contracts/migrations/2_token_migration.js @@ -23,5 +23,6 @@ module.exports = (deployer, network, accounts) => { // Export to env for reference in future migrations process.env.tokenAddress = tokenProxy.address + console.log(`tokenAddress: ${process.env.tokenAddress}`) }) -} \ No newline at end of file +} diff --git a/eth-contracts/migrations/3_registry_migration.js b/eth-contracts/migrations/3_registry_migration.js index 2d513289d9e..8ebeaae8731 100644 --- a/eth-contracts/migrations/3_registry_migration.js +++ b/eth-contracts/migrations/3_registry_migration.js @@ -23,5 +23,6 @@ module.exports = (deployer, network, accounts) => { // Export to env for reference in future migrations process.env.registryAddress = registryProxy.address + console.log(`registryAddress: ${process.env.registryAddress}`) }) } diff --git a/eth-contracts/migrations/9_output_address_info.js b/eth-contracts/migrations/9_output_address_info.js new file mode 100644 index 00000000000..bb15ffd1b46 --- /dev/null +++ b/eth-contracts/migrations/9_output_address_info.js @@ -0,0 +1,21 @@ +const fs = require('fs-extra') +const path = require('path') + +// Migration to output token and registry addresses +module.exports = (deployer, network, accounts) => { + deployer.then(async () => { + const tokenAddress = process.env.tokenAddress + const registryAddress = process.env.registryAddress + let outputValues = { + tokenAddress, + registryAddress + } + const outputFilePath = path.join(__dirname, 'migration-output.json') + fs.removeSync(outputFilePath) + fs.writeFile(outputFilePath, JSON.stringify(outputValues), (err) => { + if (err != null) { + console.log(err) + } + }) + }) +} diff --git a/eth-contracts/migrations/migrate-output.json b/eth-contracts/migrations/migrate-output.json new file mode 100644 index 00000000000..d34088fccce --- /dev/null +++ b/eth-contracts/migrations/migrate-output.json @@ -0,0 +1 @@ +{"tokenAddress":"0x9Ab43041C5dcd477Dd36cB3874C0fCf7535A846b","registryAddress":"0x7d41633b18dF33674a49260bCAFb27E6B1a4b6dD","controllerAddress":null,"proxyDeployerAddress":null,"proxyAdminAddress":null} \ No newline at end of file From 67665437965b09f81985824d2c3855cdda31fb1b Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 17:16:45 -0400 Subject: [PATCH 11/14] Migration update --- eth-contracts/scripts/migrate-contracts.js | 25 +++++++++++++--------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/eth-contracts/scripts/migrate-contracts.js b/eth-contracts/scripts/migrate-contracts.js index 90db321fb14..af98c0e70f6 100644 --- a/eth-contracts/scripts/migrate-contracts.js +++ b/eth-contracts/scripts/migrate-contracts.js @@ -8,6 +8,7 @@ const Registry = artifacts.require('Registry') const AudiusIdentityService = 'identity-service' const AudiusContentService = 'content-service' const AudiusCreatorNode = 'creator-node' +const AudiusEthContracts = 'eth-contracts' const Libs = 'libs' @@ -66,14 +67,17 @@ async function createDir (dir) { */ const outputJsonConfigFile = async (outputFilePath) => { try { - const audiusToken = await AudiusToken.deployed() - const registry = await Registry.deployed() + let migrationOutputPath = path.join(getDirectoryRoot(AudiusEthContracts), 'migrations', 'migration-output.json') + if (!fs.existsSync(migrationOutputPath)) { + console.log('Failed to find migration output') + throw new Error('Failed to find migration output') + } + const addressInfo = require(migrationOutputPath) let outputDictionary = {} - outputDictionary['audiusTokenAddress'] = audiusToken.address - outputDictionary['registryAddress'] = registry.address + outputDictionary['audiusTokenAddress'] = addressInfo.tokenAddress + outputDictionary['registryAddress'] = addressInfo.registryAddress outputDictionary['ownerWallet'] = await getDefaultAccount() outputDictionary['allWallets'] = await web3.eth.getAccounts() - fs.writeFile(outputFilePath, JSON.stringify(outputDictionary), (err) => { if (err != null) { console.log(err) @@ -88,28 +92,29 @@ const outputJsonConfigFile = async (outputFilePath) => { /** Replace eth-contracts artifacts in libs with new ABIs and config */ module.exports = async callback => { const libsDirRoot = path.join(getDirectoryRoot(Libs), 'eth-contracts') + console.log(libsDirRoot) fs.removeSync(libsDirRoot) await copyBuildDirectory(path.join(libsDirRoot, '/ABIs')) - outputJsonConfigFile(path.join(libsDirRoot, '/config.json')) + await outputJsonConfigFile(path.join(libsDirRoot, '/config.json')) // output to Identity Service try { - outputJsonConfigFile(path.join(getDirectoryRoot(AudiusIdentityService), '/eth-contract-config.json')) + await outputJsonConfigFile(path.join(getDirectoryRoot(AudiusIdentityService), '/eth-contract-config.json')) } catch (e) { console.log("Identity service doesn't exist, probably running via E2E setup scripts", e) } // output to Creator Node try { - outputJsonConfigFile(path.join(getDirectoryRoot(AudiusCreatorNode), '/eth-contract-config.json')) + await outputJsonConfigFile(path.join(getDirectoryRoot(AudiusCreatorNode), '/eth-contract-config.json')) } catch (e) { console.log("Creator node doesn't exist, probably running via E2E setup scripts", e) } // special case for content service which isn't run locally for E2E test or during front end dev try { - outputJsonConfigFile(path.join(getDirectoryRoot(AudiusContentService), '/eth-contract-config.json')) + await outputJsonConfigFile(path.join(getDirectoryRoot(AudiusContentService), '/eth-contract-config.json')) } catch (e) { console.log("Content service folder doesn't exist, probably running via E2E setup scripts", e) } @@ -118,5 +123,5 @@ module.exports = async callback => { if (!fs.existsSync(dappOutput)) { fs.mkdirSync(dappOutput, { recursive: true }) } - outputJsonConfigFile(path.join(dappOutput, '/eth-config.json')) + await outputJsonConfigFile(path.join(dappOutput, '/eth-config.json')) } From 6bf9b1c785f5e9f46d4e69488dd0480dd4a2378f Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 17:29:13 -0400 Subject: [PATCH 12/14] Try and update ownerWallet --- eth-contracts/migrations/9_output_address_info.js | 10 +++++++++- eth-contracts/scripts/migrate-contracts.js | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/eth-contracts/migrations/9_output_address_info.js b/eth-contracts/migrations/9_output_address_info.js index bb15ffd1b46..96ea4d66fb5 100644 --- a/eth-contracts/migrations/9_output_address_info.js +++ b/eth-contracts/migrations/9_output_address_info.js @@ -1,17 +1,25 @@ const fs = require('fs-extra') const path = require('path') +const contractConfig = require('../contract-config.js') + // Migration to output token and registry addresses module.exports = (deployer, network, accounts) => { deployer.then(async () => { + const config = contractConfig[network] + const proxyAdminAddress = config.proxyAdminAddress || accounts[10] + const proxyDeployerAddress = config.proxyDeployerAddress || accounts[11] const tokenAddress = process.env.tokenAddress const registryAddress = process.env.registryAddress let outputValues = { tokenAddress, - registryAddress + registryAddress, + proxyAdminAddress, + proxyDeployerAddress } const outputFilePath = path.join(__dirname, 'migration-output.json') fs.removeSync(outputFilePath) + console.log(`Migration output values: ${outputValues}`) fs.writeFile(outputFilePath, JSON.stringify(outputValues), (err) => { if (err != null) { console.log(err) diff --git a/eth-contracts/scripts/migrate-contracts.js b/eth-contracts/scripts/migrate-contracts.js index af98c0e70f6..016a1af367b 100644 --- a/eth-contracts/scripts/migrate-contracts.js +++ b/eth-contracts/scripts/migrate-contracts.js @@ -12,11 +12,6 @@ const AudiusEthContracts = 'eth-contracts' const Libs = 'libs' -const getDefaultAccount = async () => { - let accounts = await web3.eth.getAccounts() - return accounts[0] -} - /** dirName is directory name of the audius repo that you're trying to get the path to */ const getDirectoryRoot = (dirName) => { const dir = path.join(__dirname, '../../') @@ -76,7 +71,7 @@ const outputJsonConfigFile = async (outputFilePath) => { let outputDictionary = {} outputDictionary['audiusTokenAddress'] = addressInfo.tokenAddress outputDictionary['registryAddress'] = addressInfo.registryAddress - outputDictionary['ownerWallet'] = await getDefaultAccount() + outputDictionary['ownerWallet'] = addressInfo.proxyDeployerAddress outputDictionary['allWallets'] = await web3.eth.getAccounts() fs.writeFile(outputFilePath, JSON.stringify(outputDictionary), (err) => { if (err != null) { From d2c656ff901a7a269eb17c816ce9a064fcb9aa87 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 17:33:40 -0400 Subject: [PATCH 13/14] Remove file --- eth-contracts/migrations/migrate-output.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 eth-contracts/migrations/migrate-output.json diff --git a/eth-contracts/migrations/migrate-output.json b/eth-contracts/migrations/migrate-output.json deleted file mode 100644 index d34088fccce..00000000000 --- a/eth-contracts/migrations/migrate-output.json +++ /dev/null @@ -1 +0,0 @@ -{"tokenAddress":"0x9Ab43041C5dcd477Dd36cB3874C0fCf7535A846b","registryAddress":"0x7d41633b18dF33674a49260bCAFb27E6B1a4b6dD","controllerAddress":null,"proxyDeployerAddress":null,"proxyAdminAddress":null} \ No newline at end of file From 6cf74ab90527ead5e6d2656aefd6c7f2aff19494 Mon Sep 17 00:00:00 2001 From: Hareesh Nagaraj Date: Thu, 7 May 2020 19:57:16 -0400 Subject: [PATCH 14/14] Remove log stmts --- eth-contracts/migrations/2_token_migration.js | 1 - eth-contracts/migrations/3_registry_migration.js | 1 - eth-contracts/scripts/migrate-contracts.js | 1 - 3 files changed, 3 deletions(-) diff --git a/eth-contracts/migrations/2_token_migration.js b/eth-contracts/migrations/2_token_migration.js index 9745c9ad2ff..2c15ce84bd9 100644 --- a/eth-contracts/migrations/2_token_migration.js +++ b/eth-contracts/migrations/2_token_migration.js @@ -23,6 +23,5 @@ module.exports = (deployer, network, accounts) => { // Export to env for reference in future migrations process.env.tokenAddress = tokenProxy.address - console.log(`tokenAddress: ${process.env.tokenAddress}`) }) } diff --git a/eth-contracts/migrations/3_registry_migration.js b/eth-contracts/migrations/3_registry_migration.js index 8ebeaae8731..2d513289d9e 100644 --- a/eth-contracts/migrations/3_registry_migration.js +++ b/eth-contracts/migrations/3_registry_migration.js @@ -23,6 +23,5 @@ module.exports = (deployer, network, accounts) => { // Export to env for reference in future migrations process.env.registryAddress = registryProxy.address - console.log(`registryAddress: ${process.env.registryAddress}`) }) } diff --git a/eth-contracts/scripts/migrate-contracts.js b/eth-contracts/scripts/migrate-contracts.js index 016a1af367b..f91f945db25 100644 --- a/eth-contracts/scripts/migrate-contracts.js +++ b/eth-contracts/scripts/migrate-contracts.js @@ -78,7 +78,6 @@ const outputJsonConfigFile = async (outputFilePath) => { console.log(err) } }) - console.log(outputDictionary) } catch (e) { console.log(e) }