Skip to content

Commit

Permalink
chore: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Jul 24, 2024
1 parent fdf6c2b commit c5298a1
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 21 deletions.
8 changes: 2 additions & 6 deletions src/contracts/misc/ArbGhoSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ contract ArbGhoSteward is Ownable, IArbGhoSteward {
function updateRateLimit(
uint64 remoteChainSelector,
bool outboundEnabled,
uint128 outboundCapacity,
uint128 outboundCapacity,
uint128 outboundRate,
bool inboundEnabled,
uint128 inboundCapacity,
Expand All @@ -122,11 +122,7 @@ contract ArbGhoSteward is Ownable, IArbGhoSteward {
capacity: outboundCapacity,
rate: outboundRate
}),
RateLimiter.Config({
isEnabled: inboundEnabled,
capacity: inboundCapacity,
rate: inboundRate
})
RateLimiter.Config({isEnabled: inboundEnabled, capacity: inboundCapacity, rate: inboundRate})
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/contracts/misc/RiskCouncilControlled.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ contract RiskCouncilControlled {
require(riskCouncil != address(0), 'INVALID_RISK_COUNCIL');
COUNCIL = riskCouncil;
}

/**
* @dev Only Risk Council can call functions marked by this modifier.
*/
modifier onlyRiskCouncil() {
require(COUNCIL == msg.sender, 'INVALID_CALLER');
_;
}
}
}
15 changes: 11 additions & 4 deletions src/contracts/misc/deps/Dependencies.sol
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,6 @@ abstract contract UpgradeableBurnMintTokenPoolAbstract is UpgradeableTokenPool {
}
}


/// @notice Implements Token Bucket rate limiting.
/// @dev uint128 is safe for rate limiter state.
/// For USD value rate limiting, it can adequately store USD value in 18 decimals.
Expand Down Expand Up @@ -1059,10 +1058,14 @@ library RateLimiter {
/// - Implementation of Initializable to allow upgrades
/// - Move of allowlist and router definition to initialization stage
/// - Inclusion of rate limit admin who may configure rate limits in addition to owner
contract UpgradeableBurnMintTokenPool is Initializable, UpgradeableBurnMintTokenPoolAbstract, ITypeAndVersion {
contract UpgradeableBurnMintTokenPool is
Initializable,
UpgradeableBurnMintTokenPoolAbstract,
ITypeAndVersion
{
error Unauthorized(address caller);

string public constant override typeAndVersion = "BurnMintTokenPool 1.4.0";
string public constant override typeAndVersion = 'BurnMintTokenPool 1.4.0';

/// @notice The address of the rate limiter admin.
/// @dev Can be address(0) if none is configured.
Expand All @@ -1084,7 +1087,11 @@ contract UpgradeableBurnMintTokenPool is Initializable, UpgradeableBurnMintToken
/// @param owner The address of the owner
/// @param allowlist A set of addresses allowed to trigger lockOrBurn as original senders
/// @param router The address of the router
function initialize(address owner, address[] memory allowlist, address router) public virtual initializer {
function initialize(
address owner,
address[] memory allowlist,
address router
) public virtual initializer {
if (owner == address(0)) revert ZeroAddressNotAllowed();
if (router == address(0)) revert ZeroAddressNotAllowed();
_transferOwnership(owner);
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/misc/interfaces/IArbGhoSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface IArbGhoSteward {
function updateRateLimit(
uint64 remoteChainSelector,
bool outboundEnabled,
uint128 outboundCapacity,
uint128 outboundCapacity,
uint128 outboundRate,
bool inboundEnabled,
uint128 inboundCapacity,
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/misc/interfaces/IGhoStewardV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ interface IGhoStewardV2 {
function updateRateLimit(
uint64 remoteChainSelector,
bool outboundEnabled,
uint128 outboundCapacity,
uint128 outboundCapacity,
uint128 outboundRate,
bool inboundEnabled,
uint128 inboundCapacity,
Expand Down
3 changes: 2 additions & 1 deletion src/test/TestArbGhoSteward.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {RateLimiter} from 'src/contracts/misc/deps/Dependencies.sol';
contract TestArbGhoSteward is TestGhoBase {
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;

RateLimiter.Config rateLimitConfig = RateLimiter.Config({isEnabled: true, capacity: type(uint128).max, rate: 1e15});
RateLimiter.Config rateLimitConfig =
RateLimiter.Config({isEnabled: true, capacity: type(uint128).max, rate: 1e15});

event ChainConfigured(
uint64 remoteChainSelector,
Expand Down
9 changes: 3 additions & 6 deletions src/test/TestGhoStewardV2.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {RateLimiter} from '../contracts/misc/deps/Dependencies.sol';
contract TestGhoStewardV2 is TestGhoBase {
using ReserveConfiguration for DataTypes.ReserveConfigurationMap;

RateLimiter.Config rateLimitConfig = RateLimiter.Config({isEnabled: true, capacity: type(uint128).max, rate: 1e15});
RateLimiter.Config rateLimitConfig =
RateLimiter.Config({isEnabled: true, capacity: type(uint128).max, rate: 1e15});

event ChainConfigured(
uint64 remoteChainSelector,
Expand Down Expand Up @@ -863,11 +864,7 @@ contract TestGhoStewardV2 is TestGhoBase {

function testUpdateRateLimit() public {
vm.expectEmit(false, false, false, true);
emit ChainConfigured(
2,
rateLimitConfig,
rateLimitConfig
);
emit ChainConfigured(2, rateLimitConfig, rateLimitConfig);
vm.prank(RISK_COUNCIL);
GHO_STEWARD_V2.updateRateLimit(
2,
Expand Down

0 comments on commit c5298a1

Please sign in to comment.