Skip to content

Commit

Permalink
fix: forge format
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Joseph (JET) committed Oct 1, 2024
1 parent 93b2f93 commit 2997dab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
8 changes: 6 additions & 2 deletions src/components/MultiSigTransaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ abstract contract MultiSigTransaction is User, IMultiSigTransaction {
* @param token The ERC20 token address.
* @return The token balance of the contract.
*/
function getTokenBalance(address token) public view returns (uint256) {
function getTokenBalance(
address token
) public view returns (uint256) {
AddressUtils.requireValidTokenAddress(token);
return IERC20(token).balanceOf(address(this));
}
Expand Down Expand Up @@ -214,7 +216,9 @@ abstract contract MultiSigTransaction is User, IMultiSigTransaction {
) public validTransaction(transactionId) validExecutor {
Transaction storage txn = _transactions[transactionId];
if (txn.isExecuted) revert TransactionAlreadyExecuted(transactionId);
if (txn.approvals.current() < signatoryThreshold) revert InsufficientApprovals(signatoryThreshold, txn.approvals.current());
if (txn.approvals.current() < signatoryThreshold) {
revert InsufficientApprovals(signatoryThreshold, txn.approvals.current());
}
if (hasRole(OWNER_ROLE, _msgSender())) {
if (!approvals[transactionId][_msgSender()]) revert TransactionNotApproved(transactionId);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/roles/SignerRole.sol
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ abstract contract SignerRole is AccessControl, ISignerRole {
uint256 signerIndex = ArraysUtils.arrayElementIndexLookup(signer, _signers);
ArraysUtils.removeElementFromArray(signerIndex, _signers);
_signerCount.decrement();

emit SignerRemoved(signer);
}
}
12 changes: 2 additions & 10 deletions src/interfaces/IMultiSigTransaction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ interface IMultiSigTransaction {
* @param token The token contract address (0x0 for ETH).
* @param amount The received token amount.
*/
event FundsReceived(
address indexed from,
address token,
uint256 amount
);
event FundsReceived(address indexed from, address token, uint256 amount);

/**
* @dev Event emitted when a transaction is initiated.
Expand All @@ -59,11 +55,7 @@ interface IMultiSigTransaction {
* @param value The value to be transferred.
*/
event TransactionInitiated(
uint256 indexed transactionId,
address indexed initiator,
address indexed target,
address token,
uint256 value
uint256 indexed transactionId, address indexed initiator, address indexed target, address token, uint256 value
);

/**
Expand Down
20 changes: 4 additions & 16 deletions src/libraries/ArraysUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ library ArraysUtils {
* @param array The array to lookup
* @return index The index of the found element
*/
function arrayElementIndexLookup(
uint256 element,
uint256[] memory array
) internal pure returns (uint256 index) {
function arrayElementIndexLookup(uint256 element, uint256[] memory array) internal pure returns (uint256 index) {
index = 0;
while (array[index] != element) {
index++;
Expand All @@ -36,10 +33,7 @@ library ArraysUtils {
* @param array The array to lookup
* @return index The index of the found element
*/
function arrayElementIndexLookup(
address element,
address[] memory array
) internal pure returns (uint256 index) {
function arrayElementIndexLookup(address element, address[] memory array) internal pure returns (uint256 index) {
index = 0;
while (array[index] != element) {
index++;
Expand All @@ -54,10 +48,7 @@ library ArraysUtils {
* Requirements:
* - Ensures the `index` is available in the given array
*/
function removeElementFromArray(
uint256 index,
uint256[] storage array
) internal {
function removeElementFromArray(uint256 index, uint256[] storage array) internal {
if (index > array.length) revert ArrayIndexOutOfBound(index);
for (uint256 i = index; i < array.length - 1; i++) {
array[i] = array[i + 1];
Expand All @@ -74,10 +65,7 @@ library ArraysUtils {
* Requirements:
* - Ensures the `index` is available in the given array
*/
function removeElementFromArray(
uint256 index,
address[] storage array
) internal {
function removeElementFromArray(uint256 index, address[] storage array) internal {
if (index > array.length) revert ArrayIndexOutOfBound(index);
for (uint256 i = index; i < array.length - 1; i++) {
array[i] = array[i + 1];
Expand Down

0 comments on commit 2997dab

Please sign in to comment.