Hinkal Protocol

QuantstampFiles named in the report

Quantstamp reviewed Hinkal (Hinkal Protocol) on 29 Sep 2023: 37 findings, 0 critical; 32 marked fixed, 4 acknowledged, 1 open.

No open critical findings
Open the reportOpen Hinkal’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings37

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High004
Medium115
Low0323
MediumDeposited Funds Can Be Drained by a Compromised OwnerOpen

Some contracts restrict critical operations to an `owner` role. The owner of the `VerifierFacade` contract controls the registered verifier contracts used for verifying ZK proofs. If the owner is compromised, the attacker can register a malicious contract that always returns `true` regardless of input. As a result, the ZK proof verification is disabled, and the attacker can claim that they own a commitment belonging to other users and transfer the funds to themselves. An overview of all privileged roles is as follows: **The contract `AccessToken.sol` gives the following privileges:** 1. The address `owner` can update the minting fee to an arbitrary value via the function `setMintingFee()`. 2. The address `owner` can blacklist an access key by removing it from the current Merkle Tree, via the function `blacklistAccessKey()`. After that, the blacklisted access key will not be able to submit a transaction to Hinkal. 3. The address `owner` can blacklist an address via the function `blacklistAddress()`. After that, the blacklisted address will not be able to add a new access token to Hinkal or to call the function `HinkalBase.register()`. 4. The address `owner` can remove an address from the blacklist via the function `blacklistAddress()`. 5. The address `owner` can withdraw all native tokens owned by the contract which represents the fee to mint an access token via the function `withdraw()`. 6. The address `owner` is used to authorize via a signature a new access token before it is added to the system via the function `addToken()`. **The contract `ERC20TokenRegistry.sol` gives the following privileges:** 1. The address `owner` can enable or disable the usage of the contract as a filter of ERC20 tokens in Hinkal transactions via the function `changeState()`. 2. The address `owner` can add a new token address to be supported for Hinkal transactions via the function `addERCToken()`. 3. The address `owner` can remove a token address to be supported for Hinkal transactions via the function `removeToken()`. 4. The address `owner` can set a limit to the amount of tokens that can be spent for a given token address in a Hinkal transaction via the function `setTokenLimit()`. **The contract `Hinkal.sol` gives the following privileges:** 1. The address `owner` can register an external action to be supported for Hinkal transactions via the function `registerExternalAction()`. After that, the address will be whitelisted and it will be possible to make an external call to that address in `Hinkal_internalRunExternalAction()`. 2. The address `owner` can revoke an external action to be supported for Hinkal transactions via the function `removeExternalAction()`. After that, it will be possible anymore to make an external call to that address in `Hinkal_internalRunExternalAction()`. **The contract `HinkalBase.sol` gives the following privileges:** 1. The address `owner` can register an arbitrary address to be the new `hinkalHelper` via the function `setHinkalHelper()`. After that, the result of core flows in the protocol can change based on the code of that new contract, since it stores: * The list of all registered access tokens; * The list of allowed relayers; * The list of allowed tokens, with their associated maximum limit; **The contract `RelayStore.sol` gives the following privileges:** 1. The address `owner` can update the relayer fee to a value between `0` and `500`, which means between `0` and `5%` via the function `setRelayPercentage()`. 2. The address `owner` can remove a relayer via the function `removeRelay()`. 3. The address `owner` can add or update an existing relayer via the function `addOrSetRelay()`. The relayer has two attributes: a `URL` and a `priority`. **The contract `VerifierFacade.sol` gives the following privileges:** 1. The address `owner` can add a new verifier contract based on its address and identified by a given ID to be supported by the contract via the function `registerVerifier()`. 2. The address `owner` can remove a verifier contract identified by a given ID to be supported by the contract via the function `removeVerifier()`.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (126)

  • SwapperM.circom
  • contracts/types/IHinkalHelper.sol
  • swapperMO2x2x1.circom
  • contracts/types/Dimensions.sol
  • contracts/types/IVerifier1x2x1.sol
  • contracts/types/IVerifier2x2x1.sol
  • swapperM1x2x1.circom
  • contracts/types/IVerifierToken1x1x1.sol
  • contracts/types/IHinkalHelper.sol
  • contracts/types/CircomData.sol
  • SwapperMO.circom
  • contracts/types/IMerkle.sol
  • contracts/verifiers/Verifier4x2x1.sol
  • contracts/HinkalBase.sol
  • swapperM4x2x1.circom
  • contracts/types/IHinkal.sol
  • contracts/types/IVerifierFacade.sol
  • contracts/types/IPoseidon2.sol
  • contracts/Transferer.sol
  • contracts/Transferer.sol
  • contracts/MerkleRemovable.sol
  • contracts/types/IVerifierO2x2x1.sol
  • contracts/types/IHinkalBase.sol
  • contracts/verifiers/Verifier1x2x1.sol
  • contracts/MerkleBase.sol
  • swapperMO5x2x1.circom
  • swapperM3x2x1.circom
  • Signature.circom
  • contracts/HinkalHelper.sol
  • contracts/verifiers/VerifierO2x2x1.sol
  • contracts/types/IRelayStore.sol
  • contracts/types/IVerifier4x2x1.sol
  • contracts/types/IVerifier3x2x1.sol
  • contracts/types/ICircomDataBuilder.sol
  • contracts/types/IPoseidon2.sol
  • contracts/types/IVerifierO2x2x1.sol
  • SwapperToken.circom
  • swapperM4x2x1.circom
  • contracts/HinkalBase.sol
  • contracts/HinkalHelper.sol
  • contracts/Merkle.sol
  • contracts/verifiers/VerifierO3x2x1.sol
  • swapperMO3x2x1.circom
  • contracts/types/IVerifierO3x2x1.sol
  • contracts/RelayStore.sol
  • contracts/Signer.sol
  • contracts/Signer.sol
  • contracts/types/IERC20TokenRegistry.sol
  • SwapperToken.circom
  • contracts/types/IVerifier5x2x1.sol
  • contracts/verifiers/Verifier5x2x1.sol
  • contracts/verifiers/Verifier4x2x1.sol
  • swapperM2x2x1.circom
  • contracts/types/IHinkal.sol
  • swapperMO3x2x1.circom
  • contracts/types/ITransactHook.sol
  • contracts/verifiers/VerifierToken1x1x1.sol
  • contracts/RelayStore.sol
  • swapperToken1x1x1.circom
  • contracts/verifiers/Verifier2x2x1.sol
  • contracts/types/IVerifierToken1x1x1.sol
  • swapperMO2x2x1.circom
  • contracts/types/IVerifierO5x2x1.sol
  • contracts/verifiers/VerifierO5x2x1.sol
  • SwapperMO.circom
  • contracts/MerkleBase.sol
  • contracts/verifiers/VerifierToken1x1x1.sol
  • contracts/types/IVerifier.sol
  • contracts/verifiers/VerifierO4x2x1.sol
  • contracts/types/IMerkle.sol
  • Signature.circom
  • contracts/CircomDataBuilder.sol
  • MerkleRootCalculator.circom
  • contracts/types/IVerifierO5x2x1.sol
  • swapperMO5x2x1.circom
  • swapperM5x2x1.circom
  • swapperMO4x2x1.circom
  • contracts/ERC20TokenRegistry.sol
  • contracts/AccessToken.sol
  • contracts/verifiers/Verifier5x2x1.sol
  • AccessTokenChecker.circom
  • contracts/verifiers/VerifierO3x2x1.sol
  • contracts/types/IVerifier3x2x1.sol
  • contracts/verifiers/VerifierO5x2x1.sol
  • contracts/ERC20TokenRegistry.sol
  • MerkleRootCalculator.circom
  • contracts/MerkleRemovable.sol
  • contracts/AccessToken.sol
  • contracts/types/IVerifierO4x2x1.sol
  • contracts/types/Dimensions.sol
  • contracts/types/IVerifier1x2x1.sol
  • SwapperM.circom
  • contracts/verifiers/Verifier3x2x1.sol
  • swapperToken1x1x1.circom
  • contracts/Hinkal.sol
  • contracts/types/CircomData.sol
  • contracts/types/IAccessToken.sol
  • contracts/VerifierFacade.sol
  • contracts/types/IVerifierFacade.sol
  • swapperMO4x2x1.circom
  • swapperM5x2x1.circom
  • contracts/Hinkal.sol
  • contracts/types/IHinkalBase.sol
  • contracts/types/IVerifier5x2x1.sol
  • contracts/verifiers/Verifier1x2x1.sol
  • contracts/verifiers/VerifierO4x2x1.sol
  • contracts/types/IERC20TokenRegistry.sol
  • contracts/types/IVerifierO4x2x1.sol
  • contracts/Merkle.sol
  • contracts/verifiers/Verifier3x2x1.sol
  • contracts/types/IVerifier.sol
  • contracts/types/IVerifier2x2x1.sol
  • contracts/types/ITransactHook.sol
  • contracts/types/IRelayStore.sol
  • contracts/verifiers/VerifierO2x2x1.sol
  • contracts/types/IAccessToken.sol
  • swapperM2x2x1.circom
  • swapperM1x2x1.circom
  • contracts/types/ICircomDataBuilder.sol
  • contracts/VerifierFacade.sol
  • swapperM3x2x1.circom
  • contracts/types/IVerifier4x2x1.sol
  • contracts/verifiers/Verifier2x2x1.sol
  • AccessTokenChecker.circom
  • contracts/types/IVerifierO3x2x1.sol
  • contracts/CircomDataBuilder.sol

Part of Hinkal’s security record

Hinkal
Audits2 audits by 2 firmsLast audit Feb 2024, by Zokyo.
Critical findingsNo open critical findingsAcross 2 reports.
Open Hinkal’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us