Closed duanlixin closed 11 months ago
Hello, You should follow our Discord here : https://discord.com/channels/793094838509764618/927918707613786162 The recent upgrade of Argent X accounts to Cairo 1 have some impacts. Everything is explained there.
Hello, You should follow our Discord here : https://discord.com/channels/793094838509764618/927918707613786162 The recent upgrade of Argent X accounts to Cairo 1 have some impacts. Everything is explained there.
It's necessary to subscribe first to Starknet Discord : https://discord.gg/qypnmzkhbc
You can also have a look here : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/3.createNewArgentXaccount.ts
You can also have a look here : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/3.createNewArgentXaccount.ts
Yes, I've followed the instruction in the link you provided. I change contractAXclassHash to 0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003. But it still failed. Error as below: node_modules/starknet/src/provider/sequencer.ts:240 throw new GatewayError(responseBody.message, responseBody.code); ^ GatewayError: Execution was reverted; failure reason: [0x617267656e742f696e76616c69642d6f776e65722d736967].
Use this code to decode the message : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/decodeError.ts
Error code as below: console.log("Decoded message =", shortString.decodeShortString("0x617267656e742f696e76616c69642d6f776e65722d736967"));
Console after decode as below: Decoded message = argent/invalid-owner-sig
Use this code to decode the message : https://github.com/PhilippeR26/starknet.js-workshop-typescript/blob/main/src/scripts/decodeError.ts
Thanks bro. It fixed. It's due to the lack of parameter "1". The sample code in doc lack of the parameter.
import { Account, CallData, Provider, constants, ec, hash } from 'starknet';
const deployAxAccount = async () => {
// connect provider
const provider = new Provider({ sequencer: { network: constants.NetworkName.SN_MAIN } });
//new Argent X account v0.2.3
const contractAXclassHash = '0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003';
const privateKeyAX = process.env.AX_ACCOUNT_PRIVATE_KEY || '';
const AXcontractAddress = process.env.AX_ACCOUNT_CONTRACT_ADDRESS || '';
const starkKeyPubAX = ec.starkCurve.getStarkKey(privateKeyAX);
const ConstructorAXCallData = CallData.compile({
owner: starkKeyPubAX,
guardian: '0'
});
const accountAX = new Account(provider, AXcontractAddress, privateKeyAX, '1');
const accountAXAddress = hash.calculateContractAddressFromHash(starkKeyPubAX, contractAXclassHash, ConstructorAXCallData, 0);
console.log('Precalculated account address=', accountAXAddress);
// Calculate future address of the ArgentX account
const deployAccountPayload = {
classHash: contractAXclassHash,
constructorCalldata: ConstructorAXCallData,
contractAddress: AXcontractAddress,
addressSalt: starkKeyPubAX,
};
const { transaction_hash: AXdAth, contract_address: accountAXFinalAdress } = await accountAX.deployAccount(deployAccountPayload);
console.log("Final address =",accountAXFinalAdress);
await provider.waitForTransaction(AXdAth);
console.log('✅ ArgentX wallet deployed.');
};
deployAxAccount();
Describe the bug
Starknet has upgraded to version 5.19.5. And in this new version, I can bridge funds from Ethereum to the Starknet account successfully, but failed to deploy the Starknet account(specially, Argent account) with my code in the next step.
To Reproduce
code here
error here
Expected behavior
I want to deploy this Argent account successful.
Screenshots
Additional context
I have a doubtful question,the argentXproxyClassHash is inconsistent