Replies: 1 comment
-
This problem is solved |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
Testnet
Provide a brief description of the functionality you're trying to implement.
I'm trying to implement safe's Social recovery contract !
What is the specific issue or error you're encountering?
While execution of a transaction to one of the socialrecoverymodule, there's two transactions being passed instead of one !
Can you share the error messages or logs you're receiving, if any?
charan@Charans-MacBook-Pro Wallet-main 2 % yarn hardhat deploy-zksync --script deploy/guardian/deploy-recover.ts
yarn run v1.22.19
warning ../../package.json: No license field
$ '/Users/charan/Downloads/Wallet-main 2/node_modules/.bin/hardhat' deploy-zksync --script deploy/guardian/deploy-recover.ts
{
nonce: 0,
gasPrice: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0x0633e8', _isBigNumber: true },
to: '0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02',
value: BigNumber { _hex: '0x00', _isBigNumber: true },
data: '0x064e2d0e000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ec370aef52ab373db7fb29fda42e585f8cb22439000000000000000000000000df77dc810a7bb80027b9d01f97b055086b347e32',
chainId: 280,
v: 596,
r: '0x00dc27512a21b67cd5abf261df6587354ac47fc97a6010fa032feaba7e46a5da',
s: '0x6bfe033e783446b0bfbb4b18110c47f6fc75ca23c9794356c2c0adab11efddc3',
from: '0x24ba16869524157EBdDcb0a8446af063972D7924',
hash: '0x80a454eb15f14694f6ec34731e5bbf61975b5564eea84a2b7a7f0be519f171f0',
type: null,
confirmations: 0,
wait: [Function (anonymous)],
waitFinalize: [AsyncFunction (anonymous)]
}
{
nonce: 2,
gasPrice: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0x030d40', _isBigNumber: true },
to: '0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02',
value: BigNumber { _hex: '0x00', _isBigNumber: true },
data: '0x064e2d0e000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ec370aef52ab373db7fb29fda42e585f8cb22439000000000000000000000000df77dc810a7bb80027b9d01f97b055086b347e32',
chainId: 280,
v: 596,
r: '0x00dc27512a21b67cd5abf261df6587354ac47fc97a6010fa032feaba7e46a5da',
s: '0x6bfe033e783446b0bfbb4b18110c47f6fc75ca23c9794356c2c0adab11efddc3',
from: '0xae22FFc7e301C60176b0E4da9A6095b14d204ebC',
hash: '0x80a454eb15f14694f6ec34731e5bbf61975b5564eea84a2b7a7f0be519f171f0',
type: 113,
confirmations: 0,
wait: [Function (anonymous)],
waitFinalize: [AsyncFunction (anonymous)],
customData: {
gasPerPubdata: 50000,
customSignature: Uint8Array(130) [
135, 48, 32, 128, 107, 40, 2, 211, 218, 108, 18, 43,
4, 254, 123, 7, 204, 154, 44, 52, 185, 22, 202, 147,
46, 141, 140, 218, 232, 240, 103, 61, 33, 22, 193, 176,
11, 202, 217, 119, 41, 54, 50, 227, 246, 149, 75, 114,
213, 235, 166, 236, 135, 215, 176, 0, 151, 53, 222, 204,
120, 242, 215, 232, 27, 140, 47, 63, 39, 160, 137, 79,
172, 117, 165, 164, 78, 74, 88, 74, 101, 253, 91, 207,
79, 201, 218, 203, 144, 76, 177, 22, 35, 135, 168, 137,
124, 20, 89, 201,
... 30 more items
]
}
}
An unexpected error occurred:
Error: transaction failed [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (transactionHash="0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3", transaction={"type":113,"nonce":2,"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x0ee6b280"},"maxFeePerGas":{"type":"BigNumber","hex":"0x0ee6b280"},"gasLimit":{"type":"BigNumber","hex":"0x030d40"},"to":"0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02","value":{"type":"BigNumber","hex":"0x00"},"data":"0x064e2d0e000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ec370aef52ab373db7fb29fda42e585f8cb22439000000000000000000000000df77dc810a7bb80027b9d01f97b055086b347e32","chainId":{"type":"BigNumber","hex":"0x0118"},"from":"0xae22FFc7e301C60176b0E4da9A6095b14d204ebC","customData":{"gasPerPubdata":{"type":"BigNumber","hex":"0xc350"},"factoryDeps":[],"customSignature":"0x873020806b2802d3da6c122b04fe7b07cc9a2c34b916ca932e8d8cdae8f0673d2116c1b00bcad977293632e3f6954b72d5eba6ec87d7b0009735decc78f2d7e81b8c2f3f27a0894fac75a5a44e4a584a65fd5bcf4fc9dacb904cb1162387a8897c1459c9e8ad9e9a4d9040d14ced3c04e8917c737d55cf91d8eaf7ea09b7ecd5851b"},"hash":"0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3","confirmations":0}, receipt={"to":"0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02","from":"0xae22FFc7e301C60176b0E4da9A6095b14d204ebC","contractAddress":null,"transactionIndex":0,"root":"0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc","gasUsed":{"type":"BigNumber","hex":"0x01e1de"},"logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","blockHash":"0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc","transactionHash":"0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3","logs":[{"transactionIndex":0,"blockNumber":11055520,"transactionHash":"0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3","address":"0x000000000000000000000000000000000000800A","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc","0x0000000000000000000000000000000000000000000000000000000000008001"],"data":"0x00000000000000000000000000000000000000000000000000002d79883d2000","logIndex":0,"blockHash":"0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc"},{"transactionIndex":0,"blockNumber":11055520,"transactionHash":"0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3","address":"0x000000000000000000000000000000000000800A","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000008001","0x000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc"],"data":"0x0000000000000000000000000000000000000000000000000000116d26cbd500","logIndex":1,"blockHash":"0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc"}],"blockNumber":11055520,"confirmations":1,"cumulativeGasUsed":{"type":"BigNumber","hex":"0x00"},"effectiveGasPrice":{"type":"BigNumber","hex":"0x0ee6b280"},"status":0,"type":113,"l2ToL1Logs":[],"byzantium":true}, code=CALL_EXCEPTION, version=providers/5.7.2)
at Logger.makeError (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Provider. (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/providers/src.ts/base-provider.ts:1549:24)
at step (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/providers/lib/base-provider.js:48:23)
at Object.next (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/providers/lib/base-provider.js:29:53)
at fulfilled (/Users/charan/Downloads/Wallet-main 2/node_modules/@ethersproject/providers/lib/base-provider.js:20:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: 'transaction failed',
code: 'CALL_EXCEPTION',
transactionHash: '0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3',
transaction: {
type: 113,
nonce: 2,
maxPriorityFeePerGas: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
maxFeePerGas: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
gasLimit: BigNumber { _hex: '0x030d40', _isBigNumber: true },
to: '0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02',
value: BigNumber { _hex: '0x00', _isBigNumber: true },
data: '0x064e2d0e000000000000000000000000ae22ffc7e301c60176b0e4da9a6095b14d204ebc0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ec370aef52ab373db7fb29fda42e585f8cb22439000000000000000000000000df77dc810a7bb80027b9d01f97b055086b347e32',
chainId: BigNumber { _hex: '0x0118', _isBigNumber: true },
from: '0xae22FFc7e301C60176b0E4da9A6095b14d204ebC',
customData: {
gasPerPubdata: [BigNumber],
factoryDeps: [],
customSignature: '0x873020806b2802d3da6c122b04fe7b07cc9a2c34b916ca932e8d8cdae8f0673d2116c1b00bcad977293632e3f6954b72d5eba6ec87d7b0009735decc78f2d7e81b8c2f3f27a0894fac75a5a44e4a584a65fd5bcf4fc9dacb904cb1162387a8897c1459c9e8ad9e9a4d9040d14ced3c04e8917c737d55cf91d8eaf7ea09b7ecd5851b',
paymasterParams: undefined
},
hash: '0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3',
confirmations: 0,
wait: [Function (anonymous)],
waitFinalize: [AsyncFunction (anonymous)]
},
receipt: {
to: '0xf9FA2DA93292E651cEa6FdCb3fB73B18084AEA02',
from: '0xae22FFc7e301C60176b0E4da9A6095b14d204ebC',
contractAddress: null,
transactionIndex: 0,
root: '0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc',
gasUsed: BigNumber { _hex: '0x01e1de', _isBigNumber: true },
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
blockHash: '0x448d3257a3e454504156e78bac9f1f62501de24337984ee63046ec4a12aec0cc',
transactionHash: '0x3089ecd31cda132312f37411316dd86f120d35dab9a1596afce75d0eda0428b3',
logs: [ [Object], [Object] ],
blockNumber: 11055520,
confirmations: 1,
cumulativeGasUsed: BigNumber { _hex: '0x00', _isBigNumber: true },
effectiveGasPrice: BigNumber { _hex: '0x0ee6b280', _isBigNumber: true },
status: 0,
type: 113,
l2ToL1Logs: [],
byzantium: true
}
}
error Command failed with exit code 1.
Have you made any recent changes to the contract before encountering this issue?
changes made to the AA implementations are
-> Owner manager
-> the account validation function (checkNsignatures with signaturesplit(including POS))
-> execute userops from module using Address.functioncallwithvalue
-> Modulemanager (safe implementation)
Are there any external libraries or contracts that your contract interacts with?
The same implementation of social recovery is being implemented and for the swc signature validation is being done using safe's checkNsignature's method !!! The owners of the multisig will be maintained by the owner manager !!!
Can you provide the relevant portions of your contract code where the issue is occurring?
The script calling the function of confirmRecovery:
let aaTx = await account.confirmRecovery(accountContract,["0xec370aeF52Ab373DB7FB29Fda42e585F8cb22439","0xdF77DC810A7bb80027b9D01F97B055086b347E32"],"1",false);
console.log(aaTx);
aaTx = {
...aaTx,
// deploy a new account using the multisig
from: accountContract,
chainId: (await provider.getNetwork()).chainId,
nonce: await provider.getTransactionCount(accountContract),
type: 113,
customData: {
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
} as types.Eip712Meta,
value: ethers.BigNumber.from(0),
};
aaTx.gasPrice = await provider.getGasPrice();
aaTx.gasLimit = ethers.BigNumber.from(200000);
const signedTxHash = EIP712Signer.getSignedDigest(aaTx);
const signature = ethers.utils.concat([
// Note, that
signMessage
wouldn't work here, since we don't want// the signed hash to be prefixed with
\x19Ethereum Signed Message:\n
ethers.utils.joinSignature(owner1._signingKey().signDigest(signedTxHash)),
ethers.utils.joinSignature(owner2._signingKey().signDigest(signedTxHash)),
]);
aaTx.customData = {
...aaTx.customData,
customSignature: signature,
};
console.log(aaTx)
const sentTx = await provider.sendTransaction(utils.serialize(aaTx));
await sentTx.wait();
console.log(" guardian recovery ")
Have you tried to isolate the problem, and if so, what were the results?
I couldn't figure out because with the same implementation, the first function call "addguardian" went through alright !
require(isGuardian(_wallet, msg.sender), "SM: sender not a guardian");
require(_newOwners.length > 0, "SM: owners cannot be empty");
require(_newThreshold > 0 && _newOwners.length >= _newThreshold, "SM: invalid new threshold");
//
uint256 _nonce = nonce(_wallet);
bytes32 recoveryHash = keccak256(encodeRecoveryData(_wallet, _newOwners, _newThreshold, _nonce));
confirmedHashes[recoveryHash][msg.sender] = true;
//
if (!_execute) return;
uint256 guardiansThreshold = threshold(_wallet);
uint256 _approvalCount = getRecoveryApprovals(_wallet, _newOwners, _newThreshold);
require(_approvalCount >= guardiansThreshold, "SM: confirmed signatures less than threshold");
_executeRecovery(_wallet, _newOwners, _newThreshold, _approvalCount);
}
A normal confirmrecovery function call goes through and the function call is succesfull but there's 2 attempts to the same function call automatically. The above script only calls it once and I'm sure of the script.
What steps have you already taken to try to resolve the issue?
These functions went through fine without implementing checkNsignatures of safe validation method. Before integrating that, I used the https://era.zksync.io/docs/dev/tutorials/custom-aa-tutorial.html contracts.
Please clarify these 2 questions :
Why does few contract calls get implemented twice in THE TESTNET is there a problem with the validation method. Zero compilation errors and all the functions calls gets through except few (https://goerli.explorer.zksync.io/address/0xae22FFc7e301C60176b0E4da9A6095b14d204ebC)
--> /// @param signatures concatenated rsv signatures
function signatureSplit(bytes memory signatures, uint256 pos) internal pure returns (uint8 v, bytes32 r, bytes32 s) {
// solhint-disable-next-line no-inline-assembly
/// @solidity memory-safe-assembly
assembly {
let signaturePos := mul(0x41, pos)
r := mload(add(signatures, add(signaturePos, 0x20)))
s := mload(add(signatures, add(signaturePos, 0x40)))
v := byte(0, mload(add(signatures, add(signaturePos, 0x60))))
}
}
) public view returns (bool){
address lastOwner = address(0);
address currentOwner;
uint8 v;
bytes32 r;
bytes32 s;
uint256 i;
for (i = 0; i < requiredSignatures; i++) {
Does transactions be initated from other modules without using executeTransactionFromOutside ?? and I'm calling Address.delegate call and address.functioncallwithvalue functions for changing owners from the owner manger to the multisig account!
Repo Link (Optional)
No response
Additional Details
No response
Beta Was this translation helpful? Give feedback.
All reactions