From 37599079c24a1e3636faaeadc8690e35af0ebe38 Mon Sep 17 00:00:00 2001 From: Victoria Date: Mon, 24 Jul 2023 23:08:35 +0400 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Manuel Montenegro Co-authored-by: David Núñez Co-authored-by: Derek Pierre --- contracts/contracts/Adjudicator.sol | 4 +--- contracts/contracts/TACoApplication.sol | 10 +++++----- .../contracts/coordination/IUpdatableStakeInfo.sol | 4 ++-- scripts/deploy_taco_application.py | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/contracts/contracts/Adjudicator.sol b/contracts/contracts/Adjudicator.sol index d8b4a2cf..a2be80c9 100644 --- a/contracts/contracts/Adjudicator.sol +++ b/contracts/contracts/Adjudicator.sol @@ -43,8 +43,6 @@ contract Adjudicator { mapping (address => uint256) public penaltyHistory; mapping (bytes32 => bool) public evaluatedCFrags; - uint256[50] private reservedSlots; - /** * @param _hashAlgorithm Hashing algorithm * @param _basePenalty Base for the penalty calculation @@ -155,7 +153,7 @@ contract Adjudicator { SignatureVerifier.hashEIP191(stamp, bytes1(0x45)), // Currently, we use version E (0x45) of EIP191 signatures _operatorIdentityEvidence); address stakingProvider = application.stakingProviderFromOperator(operator); - require(stakingProvider != address(0), "Operator must be related to a provider"); + require(stakingProvider != address(0), "Operator must be associated with a provider"); // 5. Check that staking provider can be slashed uint96 stakingProviderValue = application.authorizedStake(stakingProvider); diff --git a/contracts/contracts/TACoApplication.sol b/contracts/contracts/TACoApplication.sol index 1a704161..952fde43 100644 --- a/contracts/contracts/TACoApplication.sol +++ b/contracts/contracts/TACoApplication.sol @@ -153,8 +153,8 @@ contract TACoApplication is IApplication, OwnableUpgradeable { * @param _tStaking T token staking contract * @param _minimumAuthorization Amount of minimum allowable authorization * @param _minOperatorSeconds Min amount of seconds while an operator can't be changed - * @param _rewardDuration Duration of one reward cycle - * @param _deauthorizationDuration Duration of decreasing authorization + * @param _rewardDuration Duration of one reward cycle in seconds + * @param _deauthorizationDuration Duration of decreasing authorization in seconds */ constructor( IERC20 _token, @@ -229,7 +229,7 @@ contract TACoApplication is IApplication, OwnableUpgradeable { } /** - * @notice Set Set adjudicator contract. If zero then slashing is disabled + * @notice Set adjudicator contract. If zero then slashing is disabled */ function setAdjudicator(address _adjudicator) external onlyOwner { require(address(_adjudicator) != address(adjudicator), "New address must not be equal to the current one"); @@ -285,7 +285,7 @@ contract TACoApplication is IApplication, OwnableUpgradeable { } /** - * @notice Returns amount of reward for the staking provider + * @notice Returns amount of reward in T units for the staking provider * @param _stakingProvider Staking provider address */ function availableRewards(address _stakingProvider) public view returns (uint96) { @@ -598,7 +598,7 @@ contract TACoApplication is IApplication, OwnableUpgradeable { /** * @notice Bond operator * @param _stakingProvider Staking provider address - * @param _operator Operator address. Must be a real address, not a contract + * @param _operator Operator address. Must be an EOA, not a contract address */ function bondOperator(address _stakingProvider, address _operator) external onlyOwnerOrStakingProvider(_stakingProvider) updateReward(_stakingProvider) diff --git a/contracts/contracts/coordination/IUpdatableStakeInfo.sol b/contracts/contracts/coordination/IUpdatableStakeInfo.sol index bf4da557..8410b08e 100644 --- a/contracts/contracts/coordination/IUpdatableStakeInfo.sol +++ b/contracts/contracts/coordination/IUpdatableStakeInfo.sol @@ -3,8 +3,8 @@ pragma solidity ^0.8.0; /** -* @title StakeInfo -* @notice StakeInfo +* @title IUpdatableStakeInfo +* @notice Interface for x-chain interactions between application and coordinator */ interface IUpdatableStakeInfo { diff --git a/scripts/deploy_taco_application.py b/scripts/deploy_taco_application.py index 5cc516b6..b21d911d 100644 --- a/scripts/deploy_taco_application.py +++ b/scripts/deploy_taco_application.py @@ -20,7 +20,7 @@ def main(account_id=None): t_token = deployments_config.get("t_token") # TODO deploy proxy - pre_app = project.TACoApplication.deploy( + taco_app = project.TACoApplication.deploy( t_token, t_staking, deployments_config.get("pre_min_authorization"), @@ -30,4 +30,4 @@ def main(account_id=None): sender=deployer, publish=deployments_config.get("verify"), ) - return pre_app + return taco_app