Skip to content

Commit

Permalink
add debug hashMessage function to SmartWalletFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
mortelli committed Jan 13, 2022
1 parent 7ffcabd commit cf1ad78
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
14 changes: 14 additions & 0 deletions contracts/factory/SmartWalletFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ contract SmartWalletFactory is ISmartWalletFactory {
return nonces[from];
}

function hashMessage(address owner,
address recoverer,
uint256 index,
bytes calldata sig
) external returns (bytes32){
bytes32 _hash = keccak256(abi.encodePacked(
address(this),
owner,
recoverer,
index
));
return _hash;
}

function createUserSmartWallet(
address owner,
address recoverer,
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions types/truffle-contracts/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4853,6 +4853,37 @@ export interface SmartWalletFactoryInstance extends Truffle.ContractInstance {

nonce(from: string | BN, txDetails?: Truffle.TransactionDetails): Promise<BN>;

hashMessage: {
(
owner: string | BN,
recoverer: string | BN,
index: number | BN | string,
sig: string,
txDetails?: Truffle.TransactionDetails
): Promise<Truffle.TransactionResponse>;
call(
owner: string | BN,
recoverer: string | BN,
index: number | BN | string,
sig: string,
txDetails?: Truffle.TransactionDetails
): Promise<string>;
sendTransaction(
owner: string | BN,
recoverer: string | BN,
index: number | BN | string,
sig: string,
txDetails?: Truffle.TransactionDetails
): Promise<string>;
estimateGas(
owner: string | BN,
recoverer: string | BN,
index: number | BN | string,
sig: string,
txDetails?: Truffle.TransactionDetails
): Promise<number>;
};

createUserSmartWallet: {
(
owner: string | BN,
Expand Down

0 comments on commit cf1ad78

Please sign in to comment.