Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/fix oz code inspector issues #14

Merged
merged 6 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/contracts/test/helpers/DeploymentHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ contract DeploymentHelper is Test {
SimpleWallet simpleWalletImpl = new SimpleWallet();
ERC1967Proxy simpleWalletProxy = new ERC1967Proxy(
address(simpleWalletImpl),
abi.encodeWithSelector(
simpleWalletImpl.initialize.selector,
signer,
address(verifier),
address(dkim),
address(emailAuthImpl)
abi.encodeCall(
simpleWalletImpl.initialize,
(
signer,
address(verifier),
address(dkim),
address(emailAuthImpl)
)
)
);
simpleWallet = SimpleWallet(payable(address(simpleWalletProxy)));
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts/test/helpers/SimpleWallet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.12;

import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {EmailAccountRecovery} from "../../src/EmailAccountRecovery.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";

contract SimpleWallet is OwnableUpgradeable, EmailAccountRecovery {
enum GuardianStatus {
Expand Down Expand Up @@ -54,7 +55,7 @@ contract SimpleWallet is OwnableUpgradeable, EmailAccountRecovery {
uint256 amount
) public onlyNotRecoveringOwner {
require(address(this).balance >= amount, "insufficient balance");
payable(to).transfer(amount);
Address.sendValue(payable(to), amount);
}

function withdraw(uint256 amount) public onlyNotRecoveringOwner {
Expand Down
7 changes: 2 additions & 5 deletions packages/contracts/test/helpers/StructHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ contract StructHelper is DeploymentHelper {

vm.mockCall(
address(verifier),
abi.encodeWithSelector(
Verifier.verifyEmailProof.selector,
emailProof
),
abi.encodeCall(Verifier.verifyEmailProof, (emailProof)),
abi.encode(true)
);
}
}
}
Loading