Skip to content

Commit

Permalink
Fixes solhint warning, removes system test job, removes legacy deploy…
Browse files Browse the repository at this point in the history
…ment scripts
  • Loading branch information
vzotova committed Sep 19, 2023
1 parent b66fbee commit 0a3597d
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 5,057 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,6 @@ jobs:
if: github.ref != 'refs/heads/dapp-development'
run: yarn test

contracts-system-tests:
needs: contracts-detect-changes
if: |
needs.contracts-detect-changes.outputs.system-tests == 'true'
&& github.ref != 'refs/heads/dapp-development'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
# Using fixed version, because 18.16 was sometimes causing issues with
# artifacts generation during `hardhat compile` - see
# https://github.com/NomicFoundation/hardhat/issues/3877
node-version: "18.15.0"
cache: "yarn"

- name: Install dependencies
run: yarn install

- name: Build contracts
run: yarn build

- name: Run system tests
env:
FORKING_URL: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }}
run: yarn test:system

contracts-deployment-dry-run:
runs-on: ubuntu-latest
steps:
Expand Down
38 changes: 19 additions & 19 deletions contracts/governance/BaseTokenholderGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ contract BaseTokenholderGovernor is
return super.supportsInterface(interfaceId);
}

function proposalDeadline(uint256 proposalId)
public
view
virtual
override(IGovernor, Governor, GovernorPreventLateQuorum)
returns (uint256)
{
return super.proposalDeadline(proposalId);
}

function _execute(
uint256 proposalId,
address[] memory targets,
Expand All @@ -141,25 +151,6 @@ contract BaseTokenholderGovernor is
return super._cancel(targets, values, calldatas, descriptionHash);
}

function _executor()
internal
view
override(Governor, GovernorTimelockControl)
returns (address)
{
return super._executor();
}

function proposalDeadline(uint256 proposalId)
public
view
virtual
override(IGovernor, Governor, GovernorPreventLateQuorum)
returns (uint256)
{
return super.proposalDeadline(proposalId);
}

function _castVote(
uint256 proposalId,
address account,
Expand All @@ -173,4 +164,13 @@ contract BaseTokenholderGovernor is
{
return super._castVote(proposalId, account, support, reason);
}

function _executor()
internal
view
override(Governor, GovernorTimelockControl)
returns (address)
{
return super._executor();
}
}
4 changes: 2 additions & 2 deletions contracts/staking/TokenStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
address public governance;
uint96 public minTStakeAmount;
uint256 public authorizationCeiling;
uint96 public legacyStakeDiscrepancyPenalty;
uint256 public legacyStakeDiscrepancyRewardMultiplier;
uint96 private legacyStakeDiscrepancyPenalty;
uint256 private legacyStakeDiscrepancyRewardMultiplier;

uint256 public notifiersTreasury;
uint256 public notificationReward;
Expand Down
17 changes: 9 additions & 8 deletions contracts/test/SimplePREApplicationStub.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
pragma solidity ^0.8.0;

contract SimplePREApplicationStub {

struct StakingProviderInfo {
address operator;
bool operatorConfirmed;
uint256 operatorStartTimestamp;
}

mapping(address => StakingProviderInfo) public stakingProviderInfo;

event OperatorBonded(
address indexed stakingProvider,
address indexed operator,
Expand All @@ -14,14 +23,6 @@ contract SimplePREApplicationStub {
address indexed operator
);

struct StakingProviderInfo {
address operator;
bool operatorConfirmed;
uint256 operatorStartTimestamp;
}

mapping(address => StakingProviderInfo) public stakingProviderInfo;

function bondOperator(address _stakingProvider, address _operator)
external
{
Expand Down
34 changes: 17 additions & 17 deletions contracts/test/TokenStakingTestSet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ contract ApplicationMock is IApplication {
);
}

function availableRewards(address) external pure returns (uint96) {
return 0;
}

function minimumAuthorization() external pure returns (uint96) {
return 0;
}

function involuntaryAuthorizationDecrease(
address stakingProvider,
uint96,
Expand All @@ -97,14 +105,6 @@ contract ApplicationMock is IApplication {
}
stakingProviderStruct.authorized = toAmount;
}

function availableRewards(address) external pure returns (uint96) {
return 0;
}

function minimumAuthorization() external pure returns (uint96) {
return 0;
}
}

contract BrokenApplicationMock is ApplicationMock {
Expand Down Expand Up @@ -216,15 +216,6 @@ contract LegacyTokenStaking is TokenStaking {
setLegacyStakingProvider(stakingProvider, stakingProvider, payable(stakingProvider), stakingProvider);
}

function setLegacyStakingProvider(address stakingProvider, address owner, address payable beneficiary, address authorizer) public {
StakingProviderInfo storage stakingProviderStruct = stakingProviders[
stakingProvider
];
stakingProviderStruct.owner = owner;
stakingProviderStruct.authorizer = authorizer;
stakingProviderStruct.beneficiary = beneficiary;
}

function addLegacyStake(address stakingProvider, uint96 keepInTStake, uint96 nuInTStake) external {
StakingProviderInfo storage stakingProviderStruct = stakingProviders[
stakingProvider
Expand All @@ -248,4 +239,13 @@ contract LegacyTokenStaking is TokenStaking {
authorization.authorized += amount;
}

function setLegacyStakingProvider(address stakingProvider, address owner, address payable beneficiary, address authorizer) public {
StakingProviderInfo storage stakingProviderStruct = stakingProviders[
stakingProvider
];
stakingProviderStruct.owner = owner;
stakingProviderStruct.authorizer = authorizer;
stakingProviderStruct.beneficiary = beneficiary;
}

}
31 changes: 0 additions & 31 deletions deploy/00_resolve_keep_registry.ts

This file was deleted.

51 changes: 0 additions & 51 deletions deploy/00_resolve_keep_token.ts

This file was deleted.

31 changes: 0 additions & 31 deletions deploy/00_resolve_keep_token_staking.ts

This file was deleted.

48 changes: 0 additions & 48 deletions deploy/00_resolve_nucypher_staking_escrow.ts

This file was deleted.

Loading

0 comments on commit 0a3597d

Please sign in to comment.