Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
rrecuero committed Jan 30, 2024
1 parent 2901495 commit 9a9ec9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/wallet/KintoWalletFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,13 @@ contract KintoWalletFactory is Initializable, UUPSUpgradeable, OwnableUpgradeabl
* @param target The target address
*/
function sendMoneyToAccount(address target) external payable override {
bool isPrivileged = owner() == msg.sender || IAccessControl(address(kintoID)).hasRole(kintoID.KYC_PROVIDER_ROLE(), msg.sender);
bool isPrivileged =
owner() == msg.sender || IAccessControl(address(kintoID)).hasRole(kintoID.KYC_PROVIDER_ROLE(), msg.sender);
require(isPrivileged || kintoID.isKYC(msg.sender), "KYC or Provider role required");
bool isContract = target.code.length > 0;
require(target != address(0) && ((kintoID.isKYC(target) || isContract) || isPrivileged), "Invalid target address");
require(
target != address(0) && ((kintoID.isKYC(target) || isContract) || isPrivileged), "Invalid target address"
);
(bool sent,) = target.call{value: msg.value}("");
require(sent, "Failed to send Ether");
}
Expand Down
2 changes: 1 addition & 1 deletion test/KintoWalletFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ contract KintoWalletFactoryTest is SharedSetup {
function testSendMoneyToAccount_When_CallerKYCAndTargetContract() public {
vm.deal(_kycProvider, 1 ether);
vm.prank(_kycProvider);
uint beforeBalance = address(_kintoWallet).balance;
uint256 beforeBalance = address(_kintoWallet).balance;
_walletFactory.sendMoneyToAccount{value: 1e18}(address(_kintoWallet));
assertEq(address(_kintoWallet).balance, beforeBalance + 1e18);
}
Expand Down

0 comments on commit 9a9ec9c

Please sign in to comment.