Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix outdated documentation links #659

Merged
merged 7 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (account *Account) SignDeclareTransaction(ctx context.Context, tx *rpc.Decl
// - error: an error if any
func (account *Account) TransactionHashDeployAccount(tx rpc.DeployAccountType, contractAddress *felt.Felt) (*felt.Felt, error) {

// https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#deploy_account_transaction
// https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/#deploy_account_transaction
switch txn := tx.(type) {
case rpc.DeployAccountTxn:
calldata := []*felt.Felt{txn.ClassHash, txn.ContractAddressSalt}
Expand All @@ -187,7 +187,7 @@ func (account *Account) TransactionHashDeployAccount(tx rpc.DeployAccountType, c
return nil, err
}

// https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#deploy_account_hash_calculation
// https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/#v1_deprecated_hash_calculation
thiagodeev marked this conversation as resolved.
Show resolved Hide resolved
return hash.CalculateTransactionHashCommon(
PREFIX_DEPLOY_ACCOUNT,
versionFelt,
Expand Down Expand Up @@ -219,7 +219,7 @@ func (account *Account) TransactionHashDeployAccount(tx rpc.DeployAccountType, c
if err != nil {
return nil, err
}
// https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#deploy_account_hash_calculation
// https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/#v3_hash_calculation_3
return crypto.PoseidonArray(
PREFIX_DEPLOY_ACCOUNT,
txnVersionFelt,
Expand Down Expand Up @@ -253,7 +253,7 @@ func (account *Account) TransactionHashDeployAccount(tx rpc.DeployAccountType, c
// If the transaction type is unsupported, the function returns an error.
func (account *Account) TransactionHashInvoke(tx rpc.InvokeTxnType) (*felt.Felt, error) {

// https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#v0_hash_calculation
// https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/#v0_unsupported_hash_calculation
switch txn := tx.(type) {
case rpc.InvokeTxnV0:
if txn.Version == "" || len(txn.Calldata) == 0 || txn.MaxFee == nil || txn.EntryPointSelector == nil {
Expand Down
4 changes: 2 additions & 2 deletions hash/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func CalculateTransactionHashCommon(
// - *felt.Felt: a pointer to a felt.Felt object that represents the calculated hash.
// - error: an error object if there was an error during the hash calculation.
func ClassHash(contract rpc.ContractClass) *felt.Felt {
// https://docs.starknet.io/documentation/architecture_and_concepts/Smart_Contracts/class-hash/
// https://docs.starknet.io/architecture-and-concepts/smart-contracts/class-hash/

Version := "CONTRACT_CLASS_V" + contract.ContractClassVersion
ContractClassVersionHash := new(felt.Felt).SetBytes([]byte(Version))
Expand All @@ -68,7 +68,7 @@ func ClassHash(contract rpc.ContractClass) *felt.Felt {
SierraProgamHash := curve.PoseidonArray(contract.SierraProgram...)
ABIHash := curve.StarknetKeccak([]byte(contract.ABI))

// https://docs.starknet.io/documentation/architecture_and_concepts/Network_Architecture/transactions/#deploy_account_hash_calculation
// https://docs.starknet.io/architecture-and-concepts/network-architecture/transactions/#deploy_account_hash_calculation
return curve.PoseidonArray(ContractClassVersionHash, ExternalHash, L1HandleHash, ConstructorHash, ABIHash, SierraProgamHash)
}

Expand Down