Skip to content

Commit

Permalink
Small type fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eloi010 committed Jun 20, 2023
1 parent 9875821 commit 9bf0894
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions contracts/core/managed/ManagedOpenfortFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract ManagedOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Deploy a new account for _admin with a nonce.
*/
function createAccountWithNonce(address _admin, bytes calldata _nonce) external returns (address account) {
function createAccountWithNonce(address _admin, bytes32 _nonce) external returns (address account) {
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
account = getAddressWithNonce(_admin, _nonce);

Expand All @@ -51,7 +51,7 @@ contract ManagedOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Return the address of an account that would be deployed with the given admin signer and nonce.
*/
function getAddressWithNonce(address _admin, bytes calldata _nonce) public view returns (address) {
function getAddressWithNonce(address _admin, bytes32 _nonce) public view returns (address) {
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
return Create2.computeAddress(
salt,
Expand Down
4 changes: 2 additions & 2 deletions contracts/core/static/StaticOpenfortFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ contract StaticOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Deploy a new account for _admin and a given nonce.
*/
function createAccountWithNonce(address _admin, bytes calldata _nonce) external returns (address account) {
function createAccountWithNonce(address _admin, bytes32 _nonce) external returns (address account) {
address impl = accountImplementation;
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
account = Clones.predictDeterministicAddress(impl, salt);
Expand All @@ -50,7 +50,7 @@ contract StaticOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Return the address of an account that would be deployed with the given admin signer and nonce.
*/
function getAddressWithNonce(address _admin, bytes calldata _nonce) public view returns (address) {
function getAddressWithNonce(address _admin, bytes32 _nonce) public view returns (address) {
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
return Clones.predictDeterministicAddress(accountImplementation, salt);
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/core/upgradeable/UpgradeableOpenfortFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contract UpgradeableOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Deploy a new account for _admin with a nonce.
*/
function createAccountWithNonce(address _admin, bytes calldata _nonce) external returns (address account) {
function createAccountWithNonce(address _admin, bytes32 _nonce) external returns (address account) {
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
account = getAddressWithNonce(_admin, _nonce);

Expand All @@ -51,7 +51,7 @@ contract UpgradeableOpenfortFactory is IBaseOpenfortFactory {
/*
* @notice Return the address of an account that would be deployed with the given admin signer and nonce.
*/
function getAddressWithNonce(address _admin, bytes calldata _nonce) public view returns (address) {
function getAddressWithNonce(address _admin, bytes32 _nonce) public view returns (address) {
bytes32 salt = keccak256(abi.encode(_admin, _nonce));
return Create2.computeAddress(
salt,
Expand Down
4 changes: 2 additions & 2 deletions contracts/interfaces/IBaseOpenfortFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ interface IBaseOpenfortFactory {
error ZeroAddressNotAllowed();

/// @notice Deploys a new Account for admin.
function createAccountWithNonce(address _admin, bytes calldata _nonce) external returns (address account);
function createAccountWithNonce(address _admin, bytes32 _nonce) external returns (address account);

/// @notice Returns the address of the Account implementation.
function accountImplementation() external view returns (address);

/// @notice Returns the address of an Account that would be deployed with the given admin and nonce.
function getAddressWithNonce(address _admin, bytes calldata _nonce) external view returns (address);
function getAddressWithNonce(address _admin, bytes32 _nonce) external view returns (address);
}
1 change: 1 addition & 0 deletions script/deployUpgradeableAccounts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ contract UpgradeableOpenfortDeploy is Script {

UpgradeableOpenfortFactory upgradeableOpenfortFactory =
new UpgradeableOpenfortFactory{salt: versionSalt}(address(entryPoint), address(upgradeableOpenfortAccount));
(upgradeableOpenfortFactory);
// address account1 = upgradeableOpenfortFactory.accountImplementation();

// The first call should create a new account, while the second will just return the corresponding account address
Expand Down

0 comments on commit 9bf0894

Please sign in to comment.