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 2f8aa67
Show file tree
Hide file tree
Showing 24 changed files with 245 additions and 5,214 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();
}
}
65 changes: 32 additions & 33 deletions contracts/staking/IStaking.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ interface IStaking {
/// called by the application that was previously requested to
/// decrease the authorization for that staking provider.
/// Returns resulting authorized amount for the application.
function approveAuthorizationDecrease(
address stakingProvider
) external returns (uint96);
function approveAuthorizationDecrease(address stakingProvider)
external
returns (uint96);

/// @notice Decreases the authorization for the given `stakingProvider` on
/// the given disabled `application`, for all authorized amount.
Expand Down Expand Up @@ -186,14 +186,14 @@ interface IStaking {
function unstakeKeep(address stakingProvider) external;

/// @notice Sets the legacy NU staking contract active stake amount cached
/// in T staking contract to 0. Reverts if there is at least one
/// authorization higher than the sum of remaining legacy NU stake
/// and liquid T stake for that staking provider or if the untaked
/// amount is higher than the cached legacy stake amount. If succeeded,
/// the legacy NU stake can be partially or fully undelegated on
/// the legacy staking contract. This function allows to unstake
/// from NU staking contract and still being able to operate in
/// T network and earning rewards based on the liquid T staked.
/// in T staking contract to 0. Reverts if there is at least one
/// authorization higher than the sum of remaining legacy NU stake
/// and liquid T stake for that staking provider or if the untaked
/// amount is higher than the cached legacy stake amount. If succeeded,
/// the legacy NU stake can be partially or fully undelegated on
/// the legacy staking contract. This function allows to unstake
/// from NU staking contract and still being able to operate in
/// T network and earning rewards based on the liquid T staked.
/// Can be called only by the delegation owner or the staking provider.
function unstakeNu(address stakingProvider) external;

Expand All @@ -220,10 +220,8 @@ interface IStaking {

/// @notice Withdraw some amount of T tokens from notifiers treasury.
/// Can only be called by the governance.
function withdrawNotificationReward(
address recipient,
uint96 amount
) external;
function withdrawNotificationReward(address recipient, uint96 amount)
external;

/// @notice Adds staking providers to the slashing queue along with the
/// amount that should be slashed from each one of them. Can only be
Expand Down Expand Up @@ -256,26 +254,29 @@ interface IStaking {

/// @notice Returns the authorized stake amount of the staking provider for
/// the application.
function authorizedStake(
address stakingProvider,
address application
) external view returns (uint96);
function authorizedStake(address stakingProvider, address application)
external
view
returns (uint96);

/// @notice Returns staked amount of T, Keep and Nu for the specified
/// staking provider.
/// @dev All values are in T denomination
function stakes(
address stakingProvider
)
function stakes(address stakingProvider)
external
view
returns (uint96 tStake, uint96 keepInTStake, uint96 nuInTStake);
returns (
uint96 tStake,
uint96 keepInTStake,
uint96 nuInTStake
);

/// @notice Returns start staking timestamp.
/// @dev This value is set at most once.
function getStartStakingTimestamp(
address stakingProvider
) external view returns (uint256);
function getStartStakingTimestamp(address stakingProvider)
external
view
returns (uint256);

/// @notice Returns staked amount of NU for the specified staking provider.
function stakedNu(address stakingProvider) external view returns (uint256);
Expand All @@ -285,9 +286,7 @@ interface IStaking {
/// @return owner Stake owner address.
/// @return beneficiary Beneficiary address.
/// @return authorizer Authorizer address.
function rolesOf(
address stakingProvider
)
function rolesOf(address stakingProvider)
external
view
returns (
Expand Down Expand Up @@ -318,10 +317,10 @@ interface IStaking {
/// stake type is the minimum amount of stake of the given type
/// needed to satisfy the maximum application authorization given the
/// staked amounts of the other stake types for that staking provider.
function getMinStaked(
address stakingProvider,
StakeType stakeTypes
) external view returns (uint96);
function getMinStaked(address stakingProvider, StakeType stakeTypes)
external
view
returns (uint96);

/// @notice Returns available amount to authorize for the specified application
function getAvailableToAuthorize(
Expand Down
Loading

0 comments on commit 2f8aa67

Please sign in to comment.