Skip to content

Commit

Permalink
Forge fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rrecuero authored and fedealconada committed Jan 4, 2024
1 parent c796d7c commit 66d8780
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
9 changes: 6 additions & 3 deletions script/test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ contract KintoDeployTestCounter is AASetup, KYCSignature, UserOp {
address computed =
_walletFactory.getContractAddress(bytes32(0), keccak256(abi.encodePacked(type(Counter).creationCode)));
if (!isContract(computed)) {
address created = _walletFactory.deployContract(deployerPublicKey, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0));
address created = _walletFactory.deployContract(
deployerPublicKey, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0)
);
console.log("Deployed Counter contract at", created);
} else {
console.log("Counter already deployed at", computed);
Expand Down Expand Up @@ -201,8 +203,9 @@ contract KintoDeployETHPriceIsRight is AASetup, KYCSignature, UserOp {
bytes32(0), keccak256(abi.encodePacked(type(ETHPriceIsRight).creationCode))
);
if (!isContract(computed)) {
address created =
_walletFactory.deployContract(deployerPublicKey, 0, abi.encodePacked(type(ETHPriceIsRight).creationCode), bytes32(0));
address created = _walletFactory.deployContract(
deployerPublicKey, 0, abi.encodePacked(type(ETHPriceIsRight).creationCode), bytes32(0)
);
console.log("Deployed ETHPriceIsRight contract at", created);
} else {
console.log("ETHPriceIsRight already deployed at", computed);
Expand Down
5 changes: 4 additions & 1 deletion src/interfaces/IKintoWalletFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ interface IKintoWalletFactory {

function createAccount(address owner, address recoverer, uint256 salt) external returns (IKintoWallet ret);

function deployContract(address contractOwner, uint256 amount, bytes memory bytecode, bytes32 salt) external payable returns (address);
function deployContract(address contractOwner, uint256 amount, bytes memory bytecode, bytes32 salt)
external
payable
returns (address);

function deployContractByWallet(uint256 amount, bytes memory bytecode, bytes32 salt)
external
Expand Down
8 changes: 5 additions & 3 deletions test/DeployTests.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ contract DeveloperDeployTest is Create2Helper, UserOp, AATestScaffolding {
deployAAScaffolding(_owner, _kycProvider, _recoverer);
vm.startPrank(_owner);

address created = _walletFactory.deployContract(_owner, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0));
address created =
_walletFactory.deployContract(_owner, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0));
_counter = Counter(created);

created =
_walletFactory.deployContract(_owner, 0, abi.encodePacked(type(CounterInitializable).creationCode), bytes32(0));
created = _walletFactory.deployContract(
_owner, 0, abi.encodePacked(type(CounterInitializable).creationCode), bytes32(0)
);

// deploy _proxy contract and point it to _implementation
_proxyc = new UUPSProxy{salt: 0}(address(created), "");
Expand Down
3 changes: 2 additions & 1 deletion test/KintoWalletFactory.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ contract KintoWalletFactoryTest is Create2Helper, UserOp, AATestScaffolding {
vm.startPrank(_owner);
address computed =
_walletFactory.getContractAddress(bytes32(0), keccak256(abi.encodePacked(type(Counter).creationCode)));
address created = _walletFactory.deployContract(_owner, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0));
address created =
_walletFactory.deployContract(_owner, 0, abi.encodePacked(type(Counter).creationCode), bytes32(0));
assertEq(computed, created);
assertEq(Counter(created).count(), 0);
Counter(created).increment();
Expand Down

0 comments on commit 66d8780

Please sign in to comment.