Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 133
[eth-contracts] Vendored contract removal + StakingInterface consumption#414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
77d2dddc84960d9223e1311a298c2f8201809b87b4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -5,4 +5,7 @@ | ||
| .npmrc | ||
| ganache_log.txt | ||
| node_modules/ | ||
| build/ | ||
| build/ | ||
| coverage/ | ||
| coverage.json | ||
| coverage.zip | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| module.exports = { | ||
| providerOptions: { | ||
| 'total_accounts': 20 | ||
| } | ||
| } | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,18 @@ | ||
| pragma solidity ^0.5.0; | ||
| import "./ERCStaking.sol"; | ||
| import "./StakingInterface.sol"; | ||
| import "./Checkpointing.sol"; | ||
| import "../service/interface/registry/RegistryInterface.sol"; | ||
| import "@openzeppelin/contracts-ethereum-package/contracts/math/SafeMath.sol"; | ||
| import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/SafeERC20.sol"; | ||
| import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol"; | ||
| import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Burnable.sol"; | ||
| import "../res/IsContract.sol"; | ||
| import "../res/TimeHelpers.sol"; | ||
| import "../service/registry/RegistryContract.sol"; | ||
| /** NOTE - will call RegistryContract.constructor, which calls Ownable constructor */ | ||
| contract Staking is RegistryContract, ERCStaking, ERCStakingHistory, IsContract, TimeHelpers { | ||
| contract Staking is RegistryContract, StakingInterface, IsContract { | ||
| using SafeMath for uint256; | ||
| using Checkpointing for Checkpointing.History; | ||
| using SafeERC20 for ERC20; | ||
| @@ -96,7 +95,7 @@ contract Staking is RegistryContract, ERCStaking, ERCStakingHistory, IsContract, | ||
| bytes("")); // TODO: RM bytes requirement if unused | ||
| // Update claim history even if no value claimed | ||
| accounts[_stakerAccount].claimHistory.add64(getBlockNumber64(), _amount); | ||
| accounts[_stakerAccount].claimHistory.add(block.number, _amount); | ||
SidSethi marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } | ||
| /** | ||
| @@ -385,7 +384,7 @@ contract Staking is RegistryContract, ERCStaking, ERCStakingHistory, IsContract, | ||
| } | ||
| // add new value to account history | ||
| accounts[_accountAddress].stakedHistory.add64(getBlockNumber64(), newStake); | ||
| accounts[_accountAddress].stakedHistory.add(block.number, newStake); | ||
| } | ||
| function _modifyTotalStaked(uint256 _by, bool _increase) internal { | ||
| @@ -399,17 +398,6 @@ contract Staking is RegistryContract, ERCStaking, ERCStakingHistory, IsContract, | ||
| } | ||
| // add new value to total history | ||
| totalStakedHistory.add64(getBlockNumber64(), newStake); | ||
| } | ||
| function _transfer(address _from, address _to, uint256 _amount) internal { | ||
| // transferring 0 staked tokens is invalid | ||
| require(_amount > 0, ERROR_AMOUNT_ZERO); | ||
| // update stakes | ||
| _modifyStakeBalance(_from, _amount, false); | ||
| _modifyStakeBalance(_to, _amount, true); | ||
| emit StakeTransferred(_from,_amount, _to); | ||
| totalStakedHistory.add(block.number, newStake); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit but why not set this to 50 to be consistent with ganache setup?
also throwing a link to here https://github.com/sc-forks/solidity-coverage#config-options would be helpful for future ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i actually didn't want to run 50 for coverage purposes but it might be worth adding