NEWTON
Asked
3 months ago
74
views
0
Hey! With starknetjs(4.15.1) I am trying to declare a contract on devnet(0.4.2) using one of predeployed accounts:
const account = new Account(
provider, '0x33507ff2edf12c12c73d0b6d1d90de9fac12a355de1097ab305249612451919',
ec.getKeyPair('0x1de9ea6670d3da1fc735df5ef7697fb9')
);
...
const response = await account.declare({contract, classHash})
In return I get:
GatewayError: Error at pc=0:124:
Signature (190318159909676960154007463740407923762489366165178197276822367516441018681, 1481560316189074241501727945883196969140908548840364106059171525936237675551), is invalid, with respect to the public key 1739835831186746845112715264902076958080619051586179661985458614041125785393, and the message hash 1015445806423683747697120201561835375586563571781789449937604429244570518935.
Cairo traceback (most recent call last):
Unknown location (pc=0:615)
Unknown location (pc=0:600)
Unknown location (pc=0:245)
0x4529...d70f89
asked
3 months ago
0
Accepted answer
Account and declare code look fine. I can see two possible issues: The first one is an issue with reading the JSON contract file and the second one is a mismatch in the Account - Key Pair.
It is good practice to run devnet with a flag
-seed 0
so that we can reproduce the same account and key.
This is how we parse json
json.parse(
fs.readFileSync(path.resolve(__dirname, `../__mocks__/${name}.json`)).toString('ascii')
);
json needs to support bigint we use
'json-bigint'
https://github.com/0xs34n/starknet.js/blob/develop/src/utils/json.ts
Toni Tabak
answered
3 months ago
StarknetPy Error in get_balance_sync (StarknetErrorCode.ENTRY_POINT_NOT_FOUND_IN_CONTRACT)
Why does range_check_ptr chek for [0, 2^128) instead of [0, P/2)
What is the inefficiency in this cairo code using alloc_locals
Invalid response while using `ec.getKeyPair("copy
How can I connect a StarkNet account using starknetjs?
Cairo: Getting the zero address
What is SHARP in Cairo Language?
How can I connect a StarkNet account using starknetjs?
What is Starknet.js?
Which account does protostar deploy command from?
How can I use meta-class of contract (starknetjs) for interaction?
Are transpiled contracts only interactable with the warp cli?
Is there a javascript version of StarkEx playground?
Does anyone know how to print a uint256 in protostar tests?