diff --git a/.gitignore b/.gitignore index 192a3d4fd..dba739fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ cache/ config/geth/data/ backup docker/volumes +**/tmp #hardhat coverage coverage diff --git a/doc/deprecated/api.md b/doc/deprecated/api.md deleted file mode 100644 index 4159ad284..000000000 --- a/doc/deprecated/api.md +++ /dev/null @@ -1,186 +0,0 @@ -# nightfall-client - -## GET /healthcheck - -Used to test if the server is up. - -### Parameters: - -None - -### Response - -status code 200. - -## POST /incoming-viewing-key - -subscribe to block proposed event with the provided incoming viewing key for optimist2 such that -this key will be used to decrypt secrets send to the blockchain as part of a transfer transaction - -### Parameters - -```js -{ - zkpPrivateKeys: // the array of private keys which will be used to decrypt messages - nullifierKeys: // the array of secrets required to create nullifier for a commitment being spent. Required to store nullifier for a commitment being created in DB -} -``` - -### Response - -`status:` to show if the subscription with the key is a `success` - -## GET /contract-address/{contractName} - -Used to get the address of a particular blockchain contract. This is mostly for testing use. - -### Parameters - -`contractName:` The name of the solidity contract (case sensitive) without the `.sol` extension, -e.g. `Shield`. - -### Response - -`address:` The requested contract address, as a hex string - -## POST /deposit - -Creates a transaction to make Layer 2 token from a Layer 1 ERC20, ERC721 or ERC1155 token. - -### Parameters - -```js -{ - ercAddress: // the address of the Layer 1 ERCx token contract - tokenType: // type of token - ERC20/ERC721/ERC1155 - tokenId: // the ID of the token ('0x00' for ERC20 tokens) - value: // the value of the token ('0x00' for ERC721 tokens) - fee: // the amount that the transactor will pay to a proposer to incorporate the transaction in a Layer 2 block. -} -``` - -### Response - -`txDataToSign:` abi-encoded transaction data. This should be signed and sent to the blockchain by -the calling application, along with the fee for the Proposer (as `msg.value`). Note that the -Shield.sol contract will attempt to take the value being transacted into escrow (whether an -ERC20/1155 value or an ERC721 non fungible token). Thus, before the deposit endpoint is called, the -Shield contract must be approved by the user to make the withdrawal (using the relevant ERCx -`approve` function). - -## POST /transfer - -Creates a transaction to transfer ownership of a ZKP-shielded asset between two owners (identified -by their zkp public key). - -### Parameters - -```js -{ - offchain: // sends the transfer transaction directly to a proposer instead of the smart contract if set to true - ercAddress: // the address of the ERCx contract holding the equivalent Layer 1 tokens - tokenType: // type of token - ERC20/ERC721/ERC1155 - value: // value of token to be sent - tokenID: // the identity of the token to be transferred (`0x00 for an ERC20`) - compressedZkpPublicKey: // recipients' respective compressed zkp public key - fee: // amount to pay proposer -} -``` - -### Response - -`txDataToSign:` abi-encoded transaction data. This should be signed and sent to the blockchain by -the calling application, along with the fee for the Proposer (as `msg.value`). - -## POST /withdraw - -Creates a transaction to convert a ZKP-shielded token back to a conventional Layer 1 token. A -current limitation is that a ZKP commitment of the exact value must exist. You may need to make a -transfer to yourself of the exact value you wish to withdraw, if there isn't already a commitment of -the correct value. - -### Parameters - -```js -{ - offchain: // sends the transfer transaction directly to a proposer instead of the smart contract if set to true - ercAddress: // the address of the ERCx contract holding the equivalent Layer 1 tokens - tokenType: // type of token - ERC20/ERC721/ERC1155 - tokenID: // the identity of the token to be transferred (`0x00 for an ERC20`) - value: // value of token to be withdrawn - recipientAddress: // Ethereum address of the Layer 1 token recipient - fee: // amount to pay proposer -} -``` - -### Response - -`txDataToSign:` abi-encoded transaction data. This should be signed and sent to the blockchain by -the calling application, along with the fee for the Proposer (as `msg.value`). - -# nightfall-optimist - -## POST /proposer/register - -Creates a transaction to register a Proposer, so that they can start producing blocks. - -## Parameters - -```js -{ - address: // the address of the proposer to register, as a hex string -} -``` - -## Response - -`txDataToSign:` abi-encoded transaction data. This should be signed and sent to the blockchain by -the calling application (along with the proposer bond value). - -## POST /challenger/add - -Adds the address of a challenger that this `nightfall-optimist` instance should create challenges -for. This information is needed so that `nightfall-optimist` can check that a challenge commit has -been posted to the blockchain successfully, and therefore it can send the reveal. Multiple -challenger addresses can be added. - -## Parameters - -```js -{ - challenger: // the address of the challenger -} -``` - -## Response - -`txDataToSign:` abi-encoded transaction data. This should be signed and sent to the blockchain by -the calling application. - -# Notes - -- Unless otherwise stated, all values should be formatted as 32 byte hex strings, padding with - leading zeros as needed and preceeded by `0x`. The `general-number` package provides a convenient - method for converting various types to 32 byte strings. -- Unsigned challenge transactions and Layer 2 block creation transactions are emitted by a websocket - from `nightfall-optimist` back to the Challenger/Proposer. These must be signed and sent to the - blockchain to either raise a challenger or to create a new block. This cannot be done by - `nightfall-optimist` because it does not have access to Ethereum private keys. See the test suite - `adversary.test.mjs` for an example of this working. The basic code is: - -```js -connection = new WebSocket(optimistWsUrl); -connection.onopen = () => { - connection.send('challenge'); - connection.send('blocks'); -}; -connection.onmessage = async message => { - // let txReceipt; - txQueue.push(async () => { - const msg = JSON.parse(message.data); - const { type, txDataToSign } = msg; - if (type === 'block') { - //sign a block transaction and send to blockchain - else if type === 'challenge' - //sign a challenge transaction and send to blockchain -``` diff --git a/doc/deprecated/architecture.md b/doc/deprecated/architecture.md deleted file mode 100644 index 59240b955..000000000 --- a/doc/deprecated/architecture.md +++ /dev/null @@ -1,78 +0,0 @@ -# Nightfall_3 - -Nightfall_3 makes the [nightfall](https://github.com/EYBlockchain/nightfall) solution more developer -friendly and much more Gas efficient. A developer can use Nightfall_3 to make ZKP transactions -without ever having to worry about the underlying cryptography: no hashes to generate, no -commitments to manage, no salts... As far as possible it's just like transferring a conventional -ERCx token. - -The use of an optimistic rollup reduces the Gas use by a factor of approximately 80. This has become -increasingly necessary in the current climate of high ETH values and high Gas costs. - -You may be wondering what happened to Nightfall_2. Nightfall_2 has no rollup capability and so we -decided to move directly to Nightfall_3. - -To achieve that we've made a number of changes. - -- The `nightlite` library has been withdrawn. It had two main drawbacks: a developer using the - library still had to do a _large_ amount of work to generate ZKP transactions and these required - considerable knowledge of how ZKPs work; and the advent of the `Timber` Merkle tree manager - required the library to access a `Timber` microservice before it could be used. This created a - really odd dependency for the library. -- The GUI has been removed. It's pointless except as a technology demonstrator but requires - significant code maintenance. -- The Circom components have been factored out to a separate microservice that pulls - proof-generation work from a queue. The proof generation is the main rate limiting step (by far). - This architecture enables easy autoscaling of Circom workers. -- A `nightfall-client` microservice has been created when enables ZKP transactions to be enacted - with simple API calls. This is the endpoint for creating transactions with Nightfall ZKPs. - -The container infrastructure is summarised in this image. Volume mounts are shown too: -![here](nightfall_3_architecture.png) - -## Infrastructure - -Nightfall_3 comprises five containerised microservices. These are stored in a monorepo for -convenience and can be brought up using a docker-compose yaml file for development purposes. - -## The Nightfall_3 Microservices - -The set of services that together form Nighfall_2 are as follows: - -- _`nightfall-client`_: The endpoint for making ZKP transactions. Calls to this API allow Deposit - (to Layer 2), Transfer (within Layer 2) and Withdraw (removal back to Layer 1). No computation of - crypto primitives, tracking of commitments or other ZKP weirdness is required to use the service. - Commitment data is optionally stored in a volume mounted to the `nightfall-client` so the caller - does not need to manage this data unless they really want to. In a multi-user situation, each - organisation/unit would deploy their own nightfall-client. -- _`circom-microservice`_: Encapsulates the Circom binary and allows interaction through simple API - calls (`/generate-zkp-keys`, `/generate-proof`, `/verify`). The user never needs to interact - directly with this container though. It interfaces via AMQP and operates as a worker for - `nightfall-client`'s work queue, sharing state between all instances of the microservice. In a - multi-user situation, each organisation/unit would deploy multiple `circom-microservices` attached - to a `nightfall-client` and would autoscale their number. It also exposes an http interface. -- _`timber`_: The Timber microservice is similar to the existing - [microservice](https://github.com/EYBlockchain/timber) but has additional functionality to enable - rollback of the commitment database in the case of a successful challenge and compatibility with a - Layer 2 Block . Timber manages an off-chain commitment Merkle tree. This approach is _much_ - cheaper than holding all of the tree on-chain. Again, the user never interacts directly with this - container. There would be one of these for each organisation in a multiuser situation, unless more - were required for resilience. -- _`nightfall-deployer`_: A container that initialises the Nightfall solution and then exits. It - compiles and deploys the Solidity contracts to the blockchain, and compiles the ZKP dsls and - performs a trusted setup. There would only ever be one ephemeral instance of `nightfall-deployer` - for each main net deployment. -- _`nightfall-optimist`_: Is the main endpoint for Proposers and Challengers. It listens to - blockchain events to determine when transactions have been posted (or sent directly) and - automatically assembles them into Layer 2 Blocks when one of the Proposer addresses it is managing - is the active Proposer. It also listens to Block proposal events and check each Layer 2 Block that - is posted to the blockchain. If any are flawed, it automatically launches a challenge. It is - possible to disable either of the Proposer or Challenger functionalities if required to suit - individual implementations (for example one may wish to be a Challenger but not a Proposer or to - use a separate pod for issuing Challenges). - -Note that `nightfall_3` does not hold any Ethereum private keys, for security reasons. Therefore, -calls to its endpoints return an unsigned Ethereum Layer 1 transaction when it needs to change the -blockchain state. It expects these to be signed by the calling application and submitted to the -blockchain on its behalf. `nightfall-optimist`, `nightfall-client` and `timber` only listen to the -blockchain; they never directly change its state. diff --git a/doc/deprecated/chain-reorgs.md b/doc/deprecated/chain-reorgs.md deleted file mode 100644 index da5ecf6a5..000000000 --- a/doc/deprecated/chain-reorgs.md +++ /dev/null @@ -1,188 +0,0 @@ -# How Nightfall_3 Copes with Chain Reorganisations - -A chain reorganisation happens when the local node realises that it is not in consensus with the canonical chain -and it abandons the chain branch it was operating on for the heavier canonical chain. - -When this happens, there are a number of Layer 1 changes. Nightfall_3 must update its Layer 2 record so that it -is consistent with the new layer two state. - -For clarity we will call the branch that is to be abandoned in favour of the new consensus the `uncle` branch -and the new, heavier branch which is part of the canonical chain, the `canonical` branch. - -## The effect of a reorg on Layer 1 - -The transactions in the uncle branch are returned to the mempool and, from the point of view of the local node -are replaced by those in the canonical branch. Eventually they will be re-mined and this may not be in the -same order that they were originally created (although nonces are respected). Thus dependencies between -the transactions may cause some to revert even though they worked on the uncle branch. - -## The effect of a reorg on Layer 2 - -The L2 state is held both in Optimist and Timber (soon these will be combined). The state is updated in response -to L1 emitting blockchain events, which the L2 code listens for, for example a BlockProposed event. These are -all defined in Structures.sol. - -When a L1 chain reorg happens, the following will be seen by the listeners: - -1) The events in the uncle branch will be replayed except that they will trigger a 'changed' rather than a 'data' -event type, and the event object will have a `.removed` property, which is set to `true` (NF_3 uses the property -value rather than the event type). - -2) The events in the canonical branch will be played to them in the order they appear on the canonical branch. - -3) The L1 transactions that were in the uncle branch will re-play as they are re-mined from the Mempool. Most -of these transactions will emit L2 events which will not necessarily be in the original order, although nonce -order for each `fromAddress` will be respected. - -## Handling a chain reorg (no rollback) - -When there is a reorg which does not revert a L2 rollback, the situation is simplified. We will treat this case -first. - -### Layer 1 (smart contract state) - -From the point of view of the local node, we see L2 Block hashes sequentially added to the blockchain record. -Suppose that the local node has the following L2 blockHash record: -``` -H_0, H_1 ... H_r, H_s ... H_n -``` -Let's further suppose there is a heavier chain segment out there with alternative facts: -``` -H_0, H_1 ... H_r, H'_s ... H'_m -``` -Note that the chains differ (fork) just after H_r. After that point, they no longer agree on the blockchain record. - -Eventually, there will be a chain reorg and the heavier branch will become the canonical chain. At that point, the -local node will agree that the correct chain is: -``` -H_0, H_1 ... H_r, H'_s ... H'_m -``` -and there will be a set of L1 transactions in the Mempool, corresponding to those on the now defunct uncle branch: -``` -H_s ... H_n -``` -The next thing that will happen is that the miners will pick up the transactions in the mempool; we say that they -will be 're-mined'. Note however that each Block struct (see Structures.sol) contains the hash of the previous block -and the ordinal number of the block. The `proposeBlock` function checks these for correctness before adding a block hash -to the `blockHashes` array. In this case, certainly the previous block hash check and probably the block number hash -will fail and the transaction will revert. Effectively, these uncle transactions will be cleared from the Mempool -and no state changes will result. This is exactly what we want to achieve. - -Any L2 transactions that were submitted to the uncle chain will also be re-mined. Their L1 transactions will all -succeed and they will be re-notarised to the blockchain. They may or may not be valid depending on whether they -have dependencies on earlier transactions that no longer exist, or now occur later because they were re-mined out -of order. - -### Layer 2 (Optimist) - -Firstly, Optimist sees the event removals. When it receives a BlockProposed event removal, it finds the block in its -database and sets the block's L1 block number to null. This indicates to NF_3 that the Block hash has been removed from the L1 chain. -You might imagine we could just delete these blocks, but we can't. We'll explain why in a bit. - -Next, Optimist sees the new events (if any) come in from the canonical chain. It will check these and they should pass its -checks because they will fit on the existing blocks at the L2 blockNumber they have. - -Finally, BlockProposed events will come from the re-mining of the transactions that were on the uncle branch. There -will only be these if there were no BlockProposed events on the canonical branch - otherwise the transactions -will revert at layer 1 (see previous section) and never emit an event. - -If such events do exist (and this is quite likely if there aren't many NF_3 transactions on the chain), then they will -pass the NF_3 checks and the L2 blocks will be added to the database. However, their L2 transactions will also be re-mined. -These are potentially still perfectly valid and will pass NF_3's checks. This is, however, a problem. Being valid, these L2 -transactions will trigger the block assembler. This creates another block containing the same transactions (one block coming -from the re-mine, one from the block assembler). That will be seen as a L2 transaction replay attack by Optimist. To prevent -that we: -1) trap incoming transactions (function `checkAlreadyInBlock` has this job) -2) see if they already exist in a block. If yes, check that the blocks L1 block number is null, otherwise throw a duplicate -transaction challenge. This check is why we cannot delete the removed block (above) and instead set its L1 blocknumber to null. -If we did delete the block, and these transactions were re-mined before the block containing them was re-mined, we'd think -they were new transactions. -3) If they are already in a block and we've determined they aren't really duplicates, then we set their mempool -property to `false`. That will prevent the block assembler from picking them up and creating yet another block with them in. -Eventually their original block will be re-mined, if it hasn't been already. The timelines will be restored and -all will be well once more. - -### Layer 2 (Timber) - -Like Optimist, Timber firstly sees the event removals. Remember that Timber does not really understand the concept of L2 blocks -and transactions. Therefore it simply filters L2 BlockProposed event calldata to extract commitment data, on which it operates. -When Timber receives a removal for a `BlockProposed` event, it computes the `leafCount` (number of leaves in the Merkle Tree) -which existed before the commitments in the removed block were added. It then calls its `rollback` function to reset the -Merkle tree back to the point just before the removed L2 block's commitments were added. This is slightly inefficient in -that it may call rollback more times than absolutely necessary. For now though, it has the benefit of simplicity. - -The next thing that happens is that events from the new canonical branch are emitted. Timber will add any commitments -associated with the `BlockProposed` events into its tree. - -Finally, any re-mined `BlockProposed` events will be added. These will only appear if they pass the L1 checks and are -compatible with the new blocks added by the canonical chain. - -### Layer 2 (Client) - -Client tracks the commitments owned by its user(s). It will record whether a commitment is spent or not. Specifically, -it remembers: - -1) If a Deposit transaction has been successfully computed (`.isDeposited`) -2) If the transaction has made it on chain as part of a Block (`.isOnChain`) -3) If it has been nullified locally (`.isNullified`) -4) If the nullification has made it on chain as part of a Block (`.isNullifiedOnChain`) -5) If the commitment has been selected for spending but not yet nullified (`isPendingNullification`) - -If a chain reorganisation happens then it may well change the status of some of these transactions. Changes to -the L2 Block record are relevant, this being the only event that Client subscribes to (other than the rollback which -we will consider later) Here is specifically how Client responds: - -First, the event removals are created. If a `BlockProposed` event is removed, then we need to mark the transactions -that were in that block (assuming they are 'our' transactions and therefore in the Client database) accordingly. - -Removal of a block means that commitments and nullifiers which were on-chain (in the sense of being in a proposed block) -no longer are. Thus we update `.isOnChain` and `.isNullifiedOnChain` to `-1` (these properties hold a blockNumber -when set, so they're no simply boolean). - -This is the simplest approach that we can take, but it's not the full story because the locally determine state -(`.isNullified`, `isPendingNullification`) is not reset. That means that these commitments will not be reused -by Client in new transactions. That's ok because eventually the transactions will be picked up again by a -Proposer and placed in a new block. If we were to clear their internal state then they may be re-spent before -this happens. That would create an invalid transaction. - -A potential complication arises if dependent L2 transactions are taken off-chain. This is because a Proposer -may attempt to re-incorporate them into a block in the wrong order (e.g. incorporating a transfer before the -deposit which enabled it). If that happens, the dependent transaction will fail the Proposer's check and will -be dropped. That's ok though because this mimics the behaviour that an L1 dependent transaction would experience in a -chain-reorganisation. - -### Effect of Rollback events - -Thus far, we have only considered the issue of `blockProposed` events being removed an replayed. However, we should also consider the -removal of a `rollback` event. - -When a `rollback` happens, as the result of an existing challenge, all the L2 block hashes within the scope of a rollback will be removed from -the blockchain record. Thus we might have the following: -``` -H_0, H_1 ... H_p, H_q ... H_r ... H_n before rollback - -H_0, H_1 ... H_p after rollback -``` -So the rollback removes all hashes later than `H_p` We then add new block hashes as the chain progresses: -``` -chain 1: H_0, H_1 ... H_p, H'_q ... H'_r ... H'_t -``` -Where the new block hashes are completely different from the old, removed ones, and the chain will generally be of a different length. -Now imagine a chain fork where the rollback never happened. The chain looks like this: -``` -chain 2: H_0, H_1 ... H_p, H_q ... H_r ... H_m -``` -Suppose this is the heavier chain. Thus, this will become the canonical chain when the reorganisation happens. What happens to the -Layer 2 state in Optimist? - -let's consider the actual transactions: -``` -chain 1: propose(H_p), ...propose(H_r), ...propose(H_n), challenge(H_q), propose(H'_q), ...propose(H'_r), ...propose(H'_t) -chain 2: propose(H_p), ...propose(H_r), ...propose(H_n), ...propose(H_m) -``` - -First of all, removal events will be received. This will remove the respective `proposeBlock` calls (`H'_q...H'_t`) from the L2 database (or, -more accurately it will set their L1 block number to null). Then the new 'chain 2' events will be played. These will be the ones after `propose(H_n)`. -Then, the events that were removed will be re-mined. The re-mined `proposeBlocks` will revert because none of them can be attached after H_m. However, the `challenge(H_q)` will succeed and will force a rollback to H_p. -That is correct behaviour because all of the blocks after H_p on chain 2 are in fact invalid (because H_q is invalid). - diff --git a/doc/deprecated/diagrams/Deposit.png b/doc/deprecated/diagrams/Deposit.png deleted file mode 100644 index 11e553cc7..000000000 Binary files a/doc/deprecated/diagrams/Deposit.png and /dev/null differ diff --git a/doc/deprecated/diagrams/README.md b/doc/deprecated/diagrams/README.md deleted file mode 100644 index 0658575e4..000000000 --- a/doc/deprecated/diagrams/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Diagrams -The diagrams contained in this folder are generated using the Websequencediagrams [website](https://www.websequencediagrams.com/). Each diagram has a file `.webseqdiagram` containing the source-code of the diagram, as well an image generated from the source-code. For changing the diagram, one should go to the Websequencediagram website, paste the source-code on the left panel and change it accordingly. After changing, please, remember of save the source-code into the respective diagram file and push the updates. - -## The Deposit diagram -![Deposit diagram](Deposit.png "Deposit diagram") - diff --git a/doc/deprecated/diagrams/deposit.webseqdiagram b/doc/deprecated/diagrams/deposit.webseqdiagram deleted file mode 100644 index f362a5740..000000000 --- a/doc/deprecated/diagrams/deposit.webseqdiagram +++ /dev/null @@ -1,14 +0,0 @@ -title Deposit - -Transactor->Client: transactionData = deposit(args) -Client->Client: prepareCommitment() -note right of Client: Generates a random number for creating the commitment. It returns when the Commitment hash is greather than BN128_GROUP_ORDER -Client->CircomWorker: proof = generateProof(args) -Client->Client: shieldContractInstance = getContractInstance(SHIELD_CONTRACT_NAME) -Client->Client: optimisticDepositTransaction = newTransaction(args) -Client->Transaction: transformedTransaction = buildSolidityStruct(optimisticDepositTransaction) -Client->ShieldContract: rawTransaction = submitTransaction(transformedTransaction) -Client->Client: storeCommitment(commitment, nullifierKey) -note right of Client: This operation saves the commitment to the DB into the COMMITMENTS collection -Transactor->Web3: signedTransaction = signTransaction(transactionData, privateKey) -Transactor->Web3: transactionReceived = sendSignedTransaction(signedTransaction) diff --git a/doc/deprecated/how_it_works.md b/doc/deprecated/how_it_works.md deleted file mode 100644 index c54905e90..000000000 --- a/doc/deprecated/how_it_works.md +++ /dev/null @@ -1,171 +0,0 @@ -# How Nightfall zk optimistic rollup works - -## Actors - -There are three actors involved in the process: - -- Transactors -- Proposers -- Challengers - -A `Transactor` is a normal customer of the service. They wish to make `Transactions` i.e. Deposit, -Transfer, Withdraw. Anyone can be a Transactor. They pay a fee for the service. - -A `Proposer` proposes new updates to the state of the Shield contract. By _state_, we mean -specifically the storage variables that are associated with a zkp transaction: nullifiers, and -commitment roots. Update proposals contain many `Transactions`, rolled up into a layer 2 `Block` and -only a hash of the final state, that would exist after all the Transactions in the Block were -processed, is stored. The system could be configured with a maximum number of proposers. Anyone can -become a Proposer if this maximum number is not reached but they must post a minimum stake that is -also configured in the system. All these parameters could be updated according to a multisig -administrator contract. The stake is intended to incentivise good behaviour and also is the base to -calculate the proposer set for the selection of next proposer. Using a similar approach to Polygon -proposer selection protocol, with proposer set based on staking, and Tendermint’s proposer selection -based in a weighted round robin algorithm, Nightfall will select next proposer. Every time the -current proposer propose a block part of this stake is blocked, which is paid to a successful -challenger. Proposers make money by providing correct blocks and collecting fees from transactors. -They are somewhat analogous to Miners in a conventional blockchain although the way they operate is -completely different. - -A `Challenger` challenges the correctness of a proposed block. Anyone can be a Challenger. They make -money from correct challenges. - -## Contracts - -The following contracts are relevant (others play no specific role in the optimistic rollup process -and have the same functionality as conventional nightfall). - -- `Shield.sol` - this enables a user to submit a transaction for processing by a Proposer. If it's a - deposit Transaction, it will take payment. It also allows anyone to request that the state of the - Shield contract (commitment root and nullifier lists) is updated. When the state is updated, any - withdrawals in the update will be processed (we don't yet allow immediate withdrawal; one needs to - wait until a block is finalised). Note that there is no fundamental need to post a transfer or - withdraw transaction to the blockchain: it's simply acting as a message board for proposers to - pick up the transaction and incorporate it into a layer 2 Block. These days, that's a lot of Gas - for a bit of convenience. Therefore this functionality can be disabled and transfer transactions - sent directly to a proposer endpoint (see below). -- `Proposers.sol` - functionality for registering, deregistering, paying and changing the current - proposer and, most importantly, proposing a new Layer 2 Block to the blockchain. -- `Challenges.sol` - functionality to enable a Block to be challenged as incorrect in some way. -- `MerkleTree_Computations.sol` - A stateless (pure function) version of the original - `MerkleTree.sol`, used by `Challenges.sol` to help compute challenged blocks on-chain. -- `Utils.sol` - collects together functionality which is either used in multiple contracts or which, - if left inline, would affect readability of code. -- `Config.sol` - holds constants rather like a Nodejs config file. Also has some parameters that - could be configure with a multisig administrator contract. -- `Structures.sol` - defines global structs, enums, events, mappings and state variables. It makes - these easier to find. - -## Operation - -We assume that several Proposers have registered with the system, posting a bond (I set this at 10 -ETH) to do so. - -### Transaction posting - -#### **On-chain** - -The process starts with a Transactor creating a transaction by calling `submitTransaction` on -`Shield.sol`. The Transactor pays a fee to the Shield contract for the Transaction, which can be -anything the Transactor decides. Ultimately this will be paid to the Proposer that incorporates the -Transaction in a Block. The higher the fee, the more likely a Proposer is to pick up the -Transaction. - -The Transaction call causes a Transaction event to be posted, containing the details of the -Transaction. If the Transaction is a Deposit, the Shield contract takes payment of the layer 1 ERC -token in question. - -#### **Off-chain** - -Transfer and Withdraw transactions have the option of being submitted directly to listening -proposers rather than being submitted on-chain via the above process. These off-chain transactions -will save transactors the on-chain submission cost (~45k gas), but requires a greater degree of -trust from transactors with the proposers they choose to connect to. It is easier for bad acting -proposers to censor transactions received off-chain than those received on-chain. - -### Transaction receival - -When proposers receive any transactions, they perform a range of checks to validate that the -transaction is well-formed and that the proof verifies against the public inputs hash. - -If this is true in both cases, the transaction is added to proposer's mempool to be considered in a -`Block`. - -### Block assembly and submission - -Proposers wait until the Shield contract assigns them as the current proposer (presently this is -done by simple rotation, we feel this should be random but we can't actually see a problem with -rotation). - -The current proposer looks at the available Transactions and chooses one. Normally this would be the -one with the highest fee. They compute the new commitment Merkle-tree that _would_ come into being -_were_ this transaction to be added to the Shield contract next. - -The current Proposer repeats this process n times, until they have assembled a Block, which contains -the hashes of the Transactions included in the Block and the commitment Merkle-tree root as it would -exist after processing all the transaction in the block (Commitment Root). - -They then call `Proposers.proposeBlock(...)` and pass in the Block struct that they have just -assembled. The hash of this Block is then stored in a queue consisting of a linked-list of Block -hashes. They have to stake a `BLOCK_STAKE` to do this, which is additional to their bond. - -The submission triggers emission of NewLeaf/NewLeaves events for a Timber listener. The Timber -listener must realise that these new leaves may be removed after a successful challenge and thus -must incorporate logic to wait for finalisation. - -### Challenges - -The blocks will be challengeable in the queue for a week, during which time their correctness may be -challenged by calling one of the challenging functions in `Challenges.sol`. The challenger will need -to pass in Block struct and the Transaction structs that are contained in the block, because the -blockchain does not retain these. `Challenges.sol` will confirm this data against its stored Block -hashes and then do an on-chain computation to determine the correctness of the challenge (the -details of the computation being dependent on the type of challenge). The challenges that can be -made are: - -- INVALID_PROOF - the proof given in a transaction does not verify as true; -- INVALID_PUBLIC_INPUT_HASH - the public input hash of a transaction is not the correct hash of the - public inputs; -- HISTORIC_ROOT_EXISTS - the root of the commitment Merkle Tree used to create the transaction proof - has never existed; -- DUPLICATE_NULLIFIER - A nullifier, given as part of a Transaction is present in the list of spent - nullifiers; -- HISTORIC_ROOT_INVALID - the updated commitment root that results from processing the transactions - in the Block is not correct. -- DUPLICATE_TRANSACTION - An identical transaction included in this block has already been included - in a prior block. -- TRANSACTION_TYPE_INVALID - The transaction is not well-formed based on the transaction type (e.g. - DEPOSIT, TRANSFER, WITHDRAWAL). - -Should the challenge succeed, i.e. the on-chain computation shows it to be a valid challenge, then -the following actions are taken by `Challenges.sol`: - -- The hash of the Block in question and all subsequent Blocks are removed from the queue; -- The Block stake, submitted by the Proposer, is paid to the Challenger; -- The Transactors with a Transaction in the Block are reimbursed the fee that they would have paid - to the Proposer and any escrowed funds held by the Shield contract in the case of a Deposit - transaction. -- The Proposer is delisted. - -### State incorporation - -We don't explicitly incorporate new state. Any block that is more than a week old is assumed final. -`Shield.withdraw` can be called to withdraw funds from a finalised block. For this reason, Blocks -that are final cannot be challenged. - -## Avoiding front-running attacks - -Challengers submit valid challenges using a 'commit-reveal' scheme to mitigate the risk that their -challenge can be front-run. The Challenger does not challenge immediately but provides a salted hash -of the Challenge information. This hash is saved against the sender's address. - -Once that transaction has gone through, the Challenger sends the complete Challenge information -along with the salt. The contract then checks: - -- the data sent is the pre-image of the hash, once the salt is added. -- the originating address is the same for both transactions - -A front-runner would be alerted that a challenge has been made but would have to find the flawed -Block themselves and front-run before the challenge hash is written to the blockchain. This is not -completely impossible but they have very little time to find the flawed Block and so are unlikely to -succeed, or rather they have no more chance of succeeding than anyone else, which is fair game. diff --git a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.eot deleted file mode 100644 index 5d20d9163..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.svg deleted file mode 100644 index 3ed7be4bc..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.woff deleted file mode 100644 index 1205787b0..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Bold-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.eot deleted file mode 100644 index 1f639a15f..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.svg deleted file mode 100644 index 6a2607b9d..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.woff deleted file mode 100644 index ed760c062..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-BoldItalic-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.eot deleted file mode 100644 index 0c8a0ae06..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.svg deleted file mode 100644 index e1075dcc2..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.svg +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.woff deleted file mode 100644 index ff652e643..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Italic-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-Light-webfont.eot deleted file mode 100644 index 14868406a..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-Light-webfont.svg deleted file mode 100644 index 11a472ca8..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.svg +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-Light-webfont.woff deleted file mode 100644 index e78607481..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Light-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.eot deleted file mode 100644 index 8f445929f..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.svg deleted file mode 100644 index 431d7e354..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.svg +++ /dev/null @@ -1,1835 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.woff deleted file mode 100644 index 43e8b9e6c..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-LightItalic-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.eot b/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.eot deleted file mode 100644 index 6bbc3cf58..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.eot and /dev/null differ diff --git a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.svg b/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.svg deleted file mode 100644 index 25a395234..000000000 --- a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.svg +++ /dev/null @@ -1,1831 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.woff b/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.woff deleted file mode 100644 index e231183dc..000000000 Binary files a/doc/deprecated/lib/fonts/OpenSans-Regular-webfont.woff and /dev/null differ diff --git a/doc/deprecated/lib/scripts/linenumber.js b/doc/deprecated/lib/scripts/linenumber.js deleted file mode 100644 index 4354785ce..000000000 --- a/doc/deprecated/lib/scripts/linenumber.js +++ /dev/null @@ -1,25 +0,0 @@ -/*global document */ -(() => { - const source = document.getElementsByClassName('prettyprint source linenums'); - let i = 0; - let lineNumber = 0; - let lineId; - let lines; - let totalLines; - let anchorHash; - - if (source && source[0]) { - anchorHash = document.location.hash.substring(1); - lines = source[0].getElementsByTagName('li'); - totalLines = lines.length; - - for (; i < totalLines; i++) { - lineNumber++; - lineId = `line${lineNumber}`; - lines[i].id = lineId; - if (lineId === anchorHash) { - lines[i].className += ' selected'; - } - } - } -})(); diff --git a/doc/deprecated/lib/scripts/prettify/Apache-License-2.0.txt b/doc/deprecated/lib/scripts/prettify/Apache-License-2.0.txt deleted file mode 100644 index d64569567..000000000 --- a/doc/deprecated/lib/scripts/prettify/Apache-License-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/doc/deprecated/lib/scripts/prettify/lang-css.js b/doc/deprecated/lib/scripts/prettify/lang-css.js deleted file mode 100644 index 041e1f590..000000000 --- a/doc/deprecated/lib/scripts/prettify/lang-css.js +++ /dev/null @@ -1,2 +0,0 @@ -PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", -/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/doc/deprecated/lib/scripts/prettify/prettify.js b/doc/deprecated/lib/scripts/prettify/prettify.js deleted file mode 100644 index eef5ad7e6..000000000 --- a/doc/deprecated/lib/scripts/prettify/prettify.js +++ /dev/null @@ -1,28 +0,0 @@ -var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; -(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= -[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), -l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, -q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, -q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, -"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), -a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} -for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], -"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], -H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], -J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ -I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), -["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", -/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), -["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", -hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= -!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p th:last-child { border-right: 1px solid #ddd; } - -.ancestors, .attribs { color: #999; } -.ancestors a, .attribs a -{ - color: #999 !important; - text-decoration: none; -} - -.clear -{ - clear: both; -} - -.important -{ - font-weight: bold; - color: #950B02; -} - -.yes-def { - text-indent: -1000px; -} - -.type-signature { - color: #aaa; -} - -.name, .signature { - font-family: Consolas, Monaco, 'Andale Mono', monospace; -} - -.details { margin-top: 14px; border-left: 2px solid #DDD; } -.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } -.details dd { margin-left: 70px; } -.details ul { margin: 0; } -.details ul { list-style-type: none; } -.details li { margin-left: 30px; padding-top: 6px; } -.details pre.prettyprint { margin: 0 } -.details .object-value { padding-top: 0; } - -.description { - margin-bottom: 1em; - margin-top: 1em; -} - -.code-caption -{ - font-style: italic; - font-size: 107%; - margin: 0; -} - -.source -{ - border: 1px solid #ddd; - width: 80%; - overflow: auto; -} - -.prettyprint.source { - width: inherit; -} - -.source code -{ - font-size: 100%; - line-height: 18px; - display: block; - padding: 4px 12px; - margin: 0; - background-color: #fff; - color: #4D4E53; -} - -.prettyprint code span.line -{ - display: inline-block; -} - -.prettyprint.linenums -{ - padding-left: 70px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.prettyprint.linenums ol -{ - padding-left: 0; -} - -.prettyprint.linenums li -{ - border-left: 3px #ddd solid; -} - -.prettyprint.linenums li.selected, -.prettyprint.linenums li.selected * -{ - background-color: lightyellow; -} - -.prettyprint.linenums li * -{ - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; -} - -.params .name, .props .name, .name code { - color: #4D4E53; - font-family: Consolas, Monaco, 'Andale Mono', monospace; - font-size: 100%; -} - -.params td.description > p:first-child, -.props td.description > p:first-child -{ - margin-top: 0; - padding-top: 0; -} - -.params td.description > p:last-child, -.props td.description > p:last-child -{ - margin-bottom: 0; - padding-bottom: 0; -} - -.disabled { - color: #454545; -} diff --git a/doc/deprecated/lib/styles/prettify-jsdoc.css b/doc/deprecated/lib/styles/prettify-jsdoc.css deleted file mode 100644 index 5a2526e37..000000000 --- a/doc/deprecated/lib/styles/prettify-jsdoc.css +++ /dev/null @@ -1,111 +0,0 @@ -/* JSDoc prettify.js theme */ - -/* plain text */ -.pln { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* string content */ -.str { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a keyword */ -.kwd { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a comment */ -.com { - font-weight: normal; - font-style: italic; -} - -/* a type name */ -.typ { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a literal value */ -.lit { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* punctuation */ -.pun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp open bracket */ -.opn { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* lisp close bracket */ -.clo { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a markup tag name */ -.tag { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute name */ -.atn { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a markup attribute value */ -.atv { - color: #006400; - font-weight: normal; - font-style: normal; -} - -/* a declaration */ -.dec { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* a variable name */ -.var { - color: #000000; - font-weight: normal; - font-style: normal; -} - -/* a function name */ -.fun { - color: #000000; - font-weight: bold; - font-style: normal; -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; -} diff --git a/doc/deprecated/lib/styles/prettify-tomorrow.css b/doc/deprecated/lib/styles/prettify-tomorrow.css deleted file mode 100644 index b6f92a78d..000000000 --- a/doc/deprecated/lib/styles/prettify-tomorrow.css +++ /dev/null @@ -1,132 +0,0 @@ -/* Tomorrow Theme */ -/* Original theme - https://github.com/chriskempson/tomorrow-theme */ -/* Pretty printing styles. Used with prettify.js. */ -/* SPAN elements with the classes below are added by prettyprint. */ -/* plain text */ -.pln { - color: #4d4d4c; } - -@media screen { - /* string content */ - .str { - color: #718c00; } - - /* a keyword */ - .kwd { - color: #8959a8; } - - /* a comment */ - .com { - color: #8e908c; } - - /* a type name */ - .typ { - color: #4271ae; } - - /* a literal value */ - .lit { - color: #f5871f; } - - /* punctuation */ - .pun { - color: #4d4d4c; } - - /* lisp open bracket */ - .opn { - color: #4d4d4c; } - - /* lisp close bracket */ - .clo { - color: #4d4d4c; } - - /* a markup tag name */ - .tag { - color: #c82829; } - - /* a markup attribute name */ - .atn { - color: #f5871f; } - - /* a markup attribute value */ - .atv { - color: #3e999f; } - - /* a declaration */ - .dec { - color: #f5871f; } - - /* a variable name */ - .var { - color: #c82829; } - - /* a function name */ - .fun { - color: #4271ae; } } -/* Use higher contrast and text-weight for printable form. */ -@media print, projection { - .str { - color: #060; } - - .kwd { - color: #006; - font-weight: bold; } - - .com { - color: #600; - font-style: italic; } - - .typ { - color: #404; - font-weight: bold; } - - .lit { - color: #044; } - - .pun, .opn, .clo { - color: #440; } - - .tag { - color: #006; - font-weight: bold; } - - .atn { - color: #404; } - - .atv { - color: #060; } } -/* Style */ -/* -pre.prettyprint { - background: white; - font-family: Consolas, Monaco, 'Andale Mono', monospace; - font-size: 12px; - line-height: 1.5; - border: 1px solid #ccc; - padding: 10px; } -*/ - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin-top: 0; - margin-bottom: 0; } - -/* IE indents via margin-left */ -li.L0, -li.L1, -li.L2, -li.L3, -li.L4, -li.L5, -li.L6, -li.L7, -li.L8, -li.L9 { - /* */ } - -/* Alternate shading for lines */ -li.L1, -li.L3, -li.L5, -li.L7, -li.L9 { - /* */ } diff --git a/doc/deprecated/mythril.md b/doc/deprecated/mythril.md deleted file mode 100644 index 08578b37c..000000000 --- a/doc/deprecated/mythril.md +++ /dev/null @@ -1,185 +0,0 @@ -Tests using **Mythril**. Issues were found only in **State.sol** and **Proposers.sol** contratcts, here is the report: - -# Analysis results for #Proposers.sol - -## Dependence on predictable environment variable -- SWC ID: 116 -- Severity: Low -- Contract: Proposers -- Function name: `withdrawBond()` -- PC address: 1641 -- Estimated Gas Usage: 3089 - 38735 - -### Description - -A control flow decision is made based on The block.timestamp environment variable. -The block.timestamp environment variable is used to determine a control flow decision. Note that the values of variables like coinbase, gaslimit, block number and timestamp are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers know hashes of earlier blocks. Don't use any of those environment variables as sources of randomness and be aware that use of these variables introduces a certain level of trust into miners. -In file: Proposers.sol:101 - -### Code - -``` -require( - bond.time + COOLING_OFF_PERIOD < block.timestamp, - 'It is too soon to withdraw your bond' - ) -``` - -## Action Taken - -NO-ACTION: The timestamp can be changed by a miner by ~15 seconds. This does not affect the integrity of a bond withdrawal. - -### Initial State: - -Account: [CREATOR], balance: 0x410c0400000883, nonce:0, storage:{} -Account: [ATTACKER], balance: 0x0, nonce:0, storage:{} - -### Transaction Sequence - -Caller: [CREATOR], calldata: , value: 0x0 -Caller: [SOMEGUY], function: withdrawBond(), txdata: 0x66eb9cec, value: 0x0 - - -## Dependence on predictable environment variable -- SWC ID: 120 -- Severity: Low -- Contract: Proposers -- Function name: `changeCurrentProposer()` -- PC address: 2726 -- Estimated Gas Usage: 2312 - 37299 - -### Description - -A control flow decision is made based on The block.number environment variable. -The block.number environment variable is used to determine a control flow decision. Note that the values of variables like coinbase, gaslimit, block number and timestamp are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers know hashes of earlier blocks. Don't use any of those environment variables as sources of randomness and be aware that use of these variables introduces a certain level of trust into miners. -In file: Proposers.sol:27 - -### Code - -``` -require( - block.number - state.getProposerStartBlock() > ROTATE_PROPOSER_BLOCKS, - "It's too soon to rotate the proposer" - ) -``` - -## Action Taken - -NO-ACTION: A malicious miner could change the time at which the block appears slightly (as measured by the block timestamp) and this may affect (within ~15), the apparent time at which a block appears but that has no affect on the integrity of the proposer rotation. - -### Initial State: - -Account: [CREATOR], balance: 0x20d9fbd, nonce:0, storage:{} -Account: [ATTACKER], balance: 0x0, nonce:0, storage:{} - -### Transaction Sequence - -Caller: [CREATOR], calldata: , value: 0x0 -Caller: [SOMEGUY], function: changeCurrentProposer(), txdata: 0x77603f4a, value: 0x0 - - -## Dependence on predictable environment variable -- SWC ID: 120 -- Severity: Low -- Contract: Proposers -- Function name: `changeCurrentProposer()` -- PC address: 12890 -- Estimated Gas Usage: 2276 - 37263 - -### Description - -A control flow decision is made based on The block.number environment variable. -The block.number environment variable is used to determine a control flow decision. Note that the values of variables like coinbase, gaslimit, block number and timestamp are predictable and can be manipulated by a malicious miner. Also keep in mind that attackers know hashes of earlier blocks. Don't use any of those environment variables as sources of randomness and be aware that use of these variables introduces a certain level of trust into miners. -In file: #utility.yul:613 - -### Code - -``` -th_t_array$_t_uint64_$2_memory_ptr(va -``` - -## Action Taken - -NO-ACTION: Unclear which code is being referred to here but it seems to be a re-statement of the previous concern. - -### Initial State: - -Account: [CREATOR], balance: 0x1, nonce:0, storage:{} -Account: [ATTACKER], balance: 0x0, nonce:0, storage:{} - -### Transaction Sequence - -Caller: [CREATOR], calldata: , value: 0x0 -Caller: [ATTACKER], function: changeCurrentProposer(), txdata: 0x77603f4a, value: 0x0 - -_______________________________________________________________________________________ -# Analysis results for State.sol - -## External Call To User-Supplied Address -- SWC ID: 107 -- Severity: Low -- Contract: State -- Function name: `withdraw()` -- PC address: 7199 -- Estimated Gas Usage: 19133 - 114407 - -### Description - -A call to a user-supplied address is executed. -An external message call to an address specified by the caller is executed. Note that the callee account might contain arbitrary code and could re-enter any function within this contract. Reentering the contract in an intermediate state may lead to unexpected behaviour. Make sure that no state modifications are executed after this call and/or reentrancy guards are in place. -In file: State.sol:233 - -### Code - -``` -payable(msg.sender).call{value: amount}('') -``` - -## Action Taken - -NO-ACTION: This function uses a reentrancy guard. - -### Initial State: - -Account: [CREATOR], balance: 0x1000400016dd5, nonce:0, storage:{} -Account: [ATTACKER], balance: 0x21080490920482001, nonce:0, storage:{} - -### Transaction Sequence - -Caller: [CREATOR], calldata: , value: 0x0 -Caller: [ATTACKER], function: withdraw(), txdata: 0x3ccfd60b, value: 0x0 - - -## State access after external call -- SWC ID: 107 -- Severity: Medium -- Contract: State -- Function name: `withdraw()` -- PC address: 7328 -- Estimated Gas Usage: 19133 - 114407 - -### Description - -Write to persistent state following external call -The contract account state is accessed after an external call to a user defined address. To prevent reentrancy issues, consider accessing the state only before the call, especially if the callee is untrusted. Alternatively, a reentrancy lock can be used to prevent untrusted callees from re-entering the contract in an intermediate state. -In file: @openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:66 - -### Code - -``` -_status = _NOT_ENTERED -``` - -## Action Taken - -NO-ACTION: This is an Openzeppelin contract. We accept these as correct. - -### Initial State: - -Account: [CREATOR], balance: 0x41000000013d9d, nonce:0, storage:{} -Account: [ATTACKER], balance: 0x11080092424488001, nonce:0, storage:{} - -### Transaction Sequence - -Caller: [CREATOR], calldata: , value: 0x0 -Caller: [ATTACKER], function: withdraw(), txdata: 0x3ccfd60b, value: 0x0 diff --git a/doc/deprecated/nightfall_3 architecture.png b/doc/deprecated/nightfall_3 architecture.png deleted file mode 100644 index bb7037fec..000000000 Binary files a/doc/deprecated/nightfall_3 architecture.png and /dev/null differ diff --git a/doc/deprecated/slither.md b/doc/deprecated/slither.md deleted file mode 100644 index 1990868b1..000000000 --- a/doc/deprecated/slither.md +++ /dev/null @@ -1,2149 +0,0 @@ -This was another _Static Test_ run using [Slither](https://github.com/crytic/slither). The command -used was -`slither . --exclude msg-value-loop,delegatecall-loop --checklist --markdown-root https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/ > slither-nightfall-results.MD` -which generates a file with the name `slither-nightfall-results.MD` containing the content of the -analyze. I had to exclude some the `detectors` **msg-value-loop** and **delegatecall-loop**, because -the tool was failing during the analyze. - -There should be some false positives, like the three ones with Severity = HIGH. Most of the warnings -are "Informational", but there are some with LOW (25) and MEDIUM (28) severity. - -**Please, ignore the ones related to OpenZeppelin. The tool doesn't have an option to ignore -warnings in libraries.** - ---- - -Summary - -- [uninitialized-state](#uninitialized-state) (3 results) (High) NO-ACTION None of these are local - variables and, thus, they will not act as uninitialised pointers. I can see no other issues here - but happy to be corrected. -- [locked-ether](#locked-ether) (1 results) (Medium) NO-ACTION The withdraw() function is available - to withdraw Ether. -- [uninitialized-local](#uninitialized-local) (10 results) (Medium) NO-ACTION Unclear why this is an - issue. -- [unused-return](#unused-return) (17 results) (Medium) NO-ACTION These calls update state variables - and thus a return is superfluous -- [shadowing-local](#shadowing-local) (1 results) (Low) NO-ACTION This is in an Openzeppelin ERC - mock contract used for testing only -- [missing-zero-check](#missing-zero-check) (7 results) (Low) NO-ACTION The lack of a zero check in - these functions is not material: it's not special compared to any other value we might set -- [incorrect-modifier](#incorrect-modifier) (1 results) (Low) NO-ACTION This is in the Truffle - migration contract. -- [variable-scope](#variable-scope) (7 results) (Low) NO-ACTION These refer to Openzeppelin - contracts -- [reentrancy-events](#reentrancy-events) (3 results) (Low) NO-ACTION These functions call our own - contracts so there is no possibility of malicious re-entrancy -- [timestamp](#timestamp) (6 results) (Low) NO-ACTION Small variations in timestamp value do not - affect the integrity of the code -- [assembly](#assembly) (12 results) (Informational) -- [boolean-equal](#boolean-equal) (1 results) (Informational) -- [pragma](#pragma) (1 results) (Informational) -- [dead-code](#dead-code) (6 results) (Informational) -- [solc-version](#solc-version) (49 results) (Informational) -- [low-level-calls](#low-level-calls) (11 results) (Informational) -- [missing-inheritance](#missing-inheritance) (1 results) (Informational) -- [naming-convention](#naming-convention) (58 results) (Informational) -- [similar-names](#similar-names) (9 results) (Informational) -- [too-many-digits](#too-many-digits) (9 results) (Informational) -- [unimplemented-functions](#unimplemented-functions) (2 results) (Informational) -- [unused-state](#unused-state) (24 results) (Informational) -- [constable-states](#constable-states) (1 results) (Optimization) -- [external-function](#external-function) (63 results) (Optimization) - -## uninitialized-state - -Impact: High Confidence: High - -- [ ] ID-0 - [State.currentProposer](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L28) - is never initialized. It is used in: - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L28 - -- [ ] ID-1 - [Config.bootProposer](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L16) - is never initialized. It is used in: - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L16 - -- [ ] ID-2 - [Config.bootChallenger](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L17) - is never initialized. It is used in: - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L17 - -## locked-ether - -Impact: Medium Confidence: High - -- [x] ID-3 Contract locking ether found: Contract - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - has payable functions: - - [State.receive()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L71-L73) - - [State.proposeBlock(Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L81-L174) - But does not have a function to withdraw the ether - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375 - -## uninitialized-local - -Impact: Medium Confidence: Medium - -- [ ] ID-4 - [Verifier.verificationCalculation(uint256[],uint256[],uint256[]).vk](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L72) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L72 - -- [ ] ID-5 - [Utils.filterNonZeroValues(bytes32[2]).count](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L70) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L70 - -- [ ] ID-6 - [Proposers.registerProposer(string).proposer](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L58) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L58 - -- [ ] ID-7 - [Utils.filterCommitments(Structures.Transaction[]).count](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L92) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L92 - -- [ ] ID-8 - [ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes).response](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L498) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L498 - -- [ ] ID-9 - [ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L480) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L480 - -- [ ] ID-10 - [Utils.countNonZeroValues(bytes32[2]).count](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L61) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L61 - -- [ ] ID-11 - [ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L503) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L503 - -- [ ] ID-12 - [Verifier.verificationCalculation(uint256[],uint256[],uint256[]).proof](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L70) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L70 - -- [ ] ID-13 - [ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes).response](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L476) - is a local variable never initialized - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L476 - -## unused-return - -Impact: Medium Confidence: Medium - -- [ ] ID-14 - [Challenges.challengeProofVerification(Structures.Block,Structures.Transaction[],uint256,Structures.Block[2],Structures.Block[2],Structures.Transaction[][2],Structures.Transaction[][2],uint256[8],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2ContainingHistoricRoot[0],transactionsOfblockL2ContainingHistoricRoot[0])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L135-L138) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196 - -- [ ] ID-15 - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L87-L115) - ignores return value by - [state.areBlockAndTransactionsReal(block2,transactions2)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L99) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L87-L115 - -- [ ] ID-16 - [ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L488-L509) - ignores return value by - [IERC1155Receiver(to).onERC1155BatchReceived(operator,from,ids,amounts,data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L497-L507) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L488-L509 - -- [ ] ID-17 - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L203-L236) - ignores return value by - [state.areBlockAndTransactionsReal(block1,txs1)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L217) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L203-L236 - -- [ ] ID-18 - [ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L467-L486) - ignores return value by - [IERC1155Receiver(to).onERC1155Received(operator,from,id,amount,data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L476-L484) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L467-L486 - -- [ ] ID-19 - [Challenges.challengeNewRootCorrect(Structures.Block,Structures.Transaction[],bytes32[33],Structures.Block,Structures.Transaction[],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L59-L80) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2,transactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L70) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L59-L80 - -- [ ] ID-20 - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L87-L115) - ignores return value by - [state.areBlockAndTransactionsReal(block1,transactions1)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L98) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L87-L115 - -- [ ] ID-21 - [Challenges.challengeHistoricRoot(Structures.Block,Structures.Transaction[],uint256,bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L243-L303) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2,transactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L250) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L243-L303 - -- [ ] ID-22 - [Challenges.challengeProofVerification(Structures.Block,Structures.Transaction[],uint256,Structures.Block[2],Structures.Block[2],Structures.Transaction[][2],Structures.Transaction[][2],uint256[8],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2ContainingHistoricRootFee[0],transactionsOfblockL2ContainingHistoricRootFee[0])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L161-L164) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196 - -- [ ] ID-23 - [Challenges.challengeLeafCountCorrect(Structures.Block,Structures.Transaction[],Structures.Block,Structures.Transaction[],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L33-L50) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2,transactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L43) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L33-L50 - -- [ ] ID-24 - [Challenges.challengeProofVerification(Structures.Block,Structures.Transaction[],uint256,Structures.Block[2],Structures.Block[2],Structures.Transaction[][2],Structures.Transaction[][2],uint256[8],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2,transactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L129) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196 - -- [ ] ID-25 - [ERC721.\_checkOnERC721Received(address,address,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416) - ignores return value by - [IERC721Receiver(to).onERC721Received(\_msgSender(),from,tokenId,data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L401-L412) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416 - -- [ ] ID-26 - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L203-L236) - ignores return value by - [state.areBlockAndTransactionsReal(block2,txs2)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L218) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L203-L236 - -- [ ] ID-27 - [Challenges.challengeNewRootCorrect(Structures.Block,Structures.Transaction[],bytes32[33],Structures.Block,Structures.Transaction[],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L59-L80) - ignores return value by - [state.areBlockAndTransactionsReal(priorBlockL2,priorBlockTransactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L69) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L59-L80 - -- [ ] ID-28 - [Challenges.challengeLeafCountCorrect(Structures.Block,Structures.Transaction[],Structures.Block,Structures.Transaction[],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L33-L50) - ignores return value by - [state.areBlockAndTransactionsReal(priorBlockL2,priorBlockTransactions)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L42) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L33-L50 - -- [ ] ID-29 - [Challenges.challengeProofVerification(Structures.Block,Structures.Transaction[],uint256,Structures.Block[2],Structures.Block[2],Structures.Transaction[][2],Structures.Transaction[][2],uint256[8],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2ContainingHistoricRootFee[1],transactionsOfblockL2ContainingHistoricRootFee[1])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L174-L177) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196 - -- [ ] ID-30 - [Challenges.challengeProofVerification(Structures.Block,Structures.Transaction[],uint256,Structures.Block[2],Structures.Block[2],Structures.Transaction[][2],Structures.Transaction[][2],uint256[8],bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196) - ignores return value by - [state.areBlockAndTransactionsReal(blockL2ContainingHistoricRoot[1],transactionsOfblockL2ContainingHistoricRoot[1])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L148-L151) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L117-L196 - -## shadowing-local - -Impact: Low Confidence: High - -- [ ] ID-31 - [ERC721Mock.awardItem(address,string).tokenURI](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L13) - shadows: - - [ERC721URIStorage.tokenURI(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol#L20-L36) - (function) - - [ERC721.tokenURI(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L93-L98) - (function) - - [IERC721Metadata.tokenURI(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#L26) - (function) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L13 - -## missing-zero-check - -Impact: Low Confidence: Medium - -- [ ] ID-32 - [Config.setFeeL2TokenAddress(address).\_feeL2TokenAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L56) - lacks a zero-check on : - - [feeL2TokenAddress = \_feeL2TokenAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L57) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L56 - -- [ ] ID-33 - [State.initialize(address,address,address).\_proposersAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L42) - lacks a zero-check on : - - [proposersAddress = \_proposersAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L46) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L42 - -- [ ] ID-34 - [State.initialize(address,address,address).\_shieldAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L44) - lacks a zero-check on : - - [shieldAddress = \_shieldAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L48) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L44 - -- [ ] ID-35 - [Config.setBootChallenger(address).challenger](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L46) - lacks a zero-check on : - - [bootChallenger = challenger](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L47) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L46 - -- [ ] ID-36 - [SimpleMultiSig.execute(uint8[],bytes32[],bytes32[],address,uint256,bytes,address,uint256).destination](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L117) - lacks a zero-check on : - - [(success,None) = destination.call{gas: gasLimit,value: value}(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L136) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L117 - -- [ ] ID-37 - [Config.setBootProposer(address).proposer](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L31) - lacks a zero-check on : - - [bootProposer = proposer](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L32) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L31 - -- [ ] ID-38 - [State.initialize(address,address,address).\_challengesAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L43) - lacks a zero-check on : - - [challengesAddress = \_challengesAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L47) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L43 - -## incorrect-modifier - -Impact: Low Confidence: High - -- [ ] ID-39 Modifier - [Migrations.restricted()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L12-L14) - does not always execute \_; or revert - https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L12-L14 - -## variable-scope - -Impact: Low Confidence: High - -- [ ] ID-40 Variable - '[ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L503)' - in - [ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L488-L509) - potentially used before declaration: - [revert(string)(reason)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L504) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L503 - -- [ ] ID-41 Variable - '[ERC721.\_checkOnERC721Received(address,address,uint256,bytes).retval](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L401)' - in - [ERC721.\_checkOnERC721Received(address,address,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416) - potentially used before declaration: - [retval == IERC721Receiver.onERC721Received.selector](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L402) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L401 - -- [ ] ID-42 Variable - '[ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L480)' - in - [ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L467-L486) - potentially used before declaration: - [revert(string)(reason)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L481) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L480 - -- [ ] ID-43 Variable - '[ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes).response](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L498)' - in - [ERC1155.\_doSafeBatchTransferAcceptanceCheck(address,address,address,uint256[],uint256[],bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L488-L509) - potentially used before declaration: - [response != IERC1155Receiver.onERC1155BatchReceived.selector](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L500) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L498 - -- [ ] ID-44 Variable - '[ERC721.\_checkOnERC721Received(address,address,uint256,bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L403)' - in - [ERC721.\_checkOnERC721Received(address,address,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416) - potentially used before declaration: - [reason.length == 0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L404) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L403 - -- [ ] ID-45 Variable - '[ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes).response](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L476)' - in - [ERC1155.\_doSafeTransferAcceptanceCheck(address,address,address,uint256,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L467-L486) - potentially used before declaration: - [response != IERC1155Receiver.onERC1155Received.selector](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L477) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L476 - -- [ ] ID-46 Variable - '[ERC721.\_checkOnERC721Received(address,address,uint256,bytes).reason](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L403)' - in - [ERC721.\_checkOnERC721Received(address,address,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416) - potentially used before declaration: - [revert(uint256,uint256)(32 + reason,mload(uint256)(reason))](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L409) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L403 - -## reentrancy-events - -Impact: Low Confidence: Medium - -- [ ] ID-47 Reentrancy in - [Proposers.changeCurrentProposer()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L26-L35): - External calls: - - [state.setProposerStartBlock(block.number)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L31) - - [state.setCurrentProposer(currentProposer.nextAddress)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L33) - Event emitted after the call(s): - - [NewCurrentProposer(currentProposer.nextAddress)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L34) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L26-L35 - -- [ ] ID-48 Reentrancy in - [Shield.setAdvanceWithdrawalFee(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L225-L252): - External calls: - - [(success) = address(address(state)).call{value: msg.value}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L249) - Event emitted after the call(s): - - [InstantWithdrawalRequested(withdrawTransactionHash,msg.sender,msg.value)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L251) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L225-L252 - -- [ ] ID-49 Reentrancy in - [Proposers.registerProposer(string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L38-L84): - External calls: - - [(success) = address(address(state)).call{value: REGISTRATION_BOND}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L45) - - [state.setBondAccount(msg.sender,REGISTRATION_BOND)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L47) - - [state.setProposer(msg.sender,currentProposer)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L52) - - [state.setProposerStartBlock(block.number)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L53) - External calls sending eth: - - [(success) = address(address(state)).call{value: REGISTRATION_BOND}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L45) - Event emitted after the call(s): - - [NewCurrentProposer(currentProposer.thisAddress)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L54) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L38-L84 - -## timestamp - -Impact: Low Confidence: Medium - -- [ ] ID-50 - [Shield.isValidWithdrawal(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L117-L140) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(time + COOLING_OFF_PERIOD < block.timestamp,It is too soon to withdraw funds from this block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L127-L130) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L117-L140 - -- [ ] ID-51 - [Shield.finaliseWithdrawal(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L150-L176) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(time + COOLING_OFF_PERIOD < block.timestamp,It is too soon to withdraw funds from this block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L160-L163) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L150-L176 - -- [ ] ID-52 - [Challenges.challengeAccepted(Structures.Block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L306-L324) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(state.getBlockData(badBlock.blockNumberL2).time >= (block.timestamp - 604800),Cannot challenge block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L308-L311) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L306-L324 - -- [ ] ID-53 - [Shield.requestBlockPayment(Structures.Block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(time + COOLING_OFF_PERIOD < block.timestamp,It is too soon to get paid for this block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L57-L60) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90 - -- [ ] ID-54 - [Proposers.withdrawBond()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L99-L112) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(bond.time + COOLING_OFF_PERIOD < block.timestamp,It is too soon to withdraw your bond)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L101-L104) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L99-L112 - -- [ ] ID-55 - [State.proposeBlock(Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L81-L174) - uses timestamp for comparisons Dangerous comparisons: - - [require(bool,string)(b.blockNumberL2 == blockHashes.length,The block is out of order)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L87) - - [require(bool,string)(b.previousBlockHash == blockHashes[blockHashes.length - 1].blockHash,The block is flawed or out of order)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L89-L92) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L81-L174 - -## assembly - -Impact: Informational Confidence: High - -- [ ] ID-56 - [Pairing.scalar_mul(Pairing.G1Point,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L67-L80) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L72-L76) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L67-L80 - -- [ ] ID-57 - [Pairing.pairing(Pairing.G1Point[],Pairing.G2Point[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L85-L111) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L102-L106) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L85-L111 - -- [ ] ID-58 - [MerkleTree_Stateless.insertLeaves(bytes32[],bytes32[33],uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L90-L192) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L116-L118) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L90-L192 - -- [ ] ID-59 - [ERC721.\_checkOnERC721Received(address,address,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L408-L410) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L394-L416 - -- [ ] ID-60 - [AddressUpgradeable.verifyCallResult(bool,bytes,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L174-L194) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L186-L189) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L174-L194 - -- [ ] ID-61 - [Utils.calculateMerkleRoot(bytes32[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L151-L185) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L152-L184) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L151-L185 - -- [ ] ID-62 - [Address.verifyCallResult(bool,bytes,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L201-L221) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L213-L216) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L201-L221 - -- [ ] ID-63 - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L36-L61) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62 - -- [ ] ID-64 - [Pairing.addition(Pairing.G1Point,Pairing.G1Point)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L50-L64) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L56-L60) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L50-L64 - -- [ ] ID-65 - [Poseidon.poseidon.asm_0.mix()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12-L25) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12-L25) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12-L25 - -- [ ] ID-66 - [State.proposeBlock(Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L81-L174) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L111-L159) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L81-L174 - -- [ ] ID-67 - [Poseidon.poseidon(uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L9-L522) - uses assembly - - [INLINE ASM](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L10-L520) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L9-L522 - -## boolean-equal - -Impact: Informational Confidence: High - -- [ ] ID-68 - [Shield.requestBlockPayment(Structures.Block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90) - compares to a boolean - constant: -[require(bool,string)(state.isBlockStakeWithdrawn(blockHash) == false,The block stake for this block is already claimed)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L62-L65) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90 - -## pragma - -Impact: Informational Confidence: High - -- [ ] ID-69 Different versions of Solidity are used: - Version used: ['>=0.4.21<0.9.0', '^0.8.0', - '^0.8.1', '^0.8.2'] - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L12) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#L4) - - [^0.8.1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Context.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L6) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L2) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Stateful.sol#L9) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L12) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L3) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L3) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L3) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L3) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L2) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol#L4) - - [^0.8.2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Structures.sol#L6) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L2) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L7) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L14) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol#L4) - - [>=0.4.21<0.9.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L2) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L5) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Counters.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L3) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#L4) - - [^0.8.1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Strings.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L28) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol#L4) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC20Mock.sol#L2) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L9) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L47) - - [^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#L4) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L12 - -## dead-code - -Impact: Informational Confidence: Medium - -- [ ] ID-70 - [Pairing.P2()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L33-L40) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L33-L40 - -- [ ] ID-71 - [Pairing.P1()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L29-L31) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L29-L31 - -- [ ] ID-72 - [Pairing.pairingProd2(Pairing.G1Point,Pairing.G2Point,Pairing.G1Point,Pairing.G2Point)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L113-L121) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L113-L121 - -- [ ] ID-73 - [MiMC.GetScalarField()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19 - -- [ ] ID-74 - [Utils.filterNonZeroValues(bytes32[2])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L68-L74) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L68-L74 - -- [ ] ID-75 - [Pairing.pairingProd3(Pairing.G1Point,Pairing.G2Point,Pairing.G1Point,Pairing.G2Point,Pairing.G1Point,Pairing.G2Point)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L123-L137) - is never used and should be removed - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L123-L137 - -## solc-version - -Impact: Informational Confidence: High - -- [ ] ID-76 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol#L4 - -- [ ] ID-77 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L4 - -- [ ] ID-78 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L3) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L3 - -- [ ] ID-79 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L6) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L6 - -- [ ] ID-80 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol#L4 - -- [ ] ID-81 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol#L4 - -- [ ] ID-82 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L3) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L3 - -- [ ] ID-83 Pragma - version[^0.8.2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol#L4 - -- [ ] ID-84 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol#L4 - -- [ ] ID-85 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol#L4 - -- [ ] ID-86 Pragma - version[>=0.4.21<0.9.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L2) - is too complex - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L2 - -- [ ] ID-87 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L2) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L2 - -- [ ] ID-88 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L12) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L12 - -- [ ] ID-89 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol#L4 - -- [ ] ID-90 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L12) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L12 - -- [ ] ID-91 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol#L4 - -- [ ] ID-92 solc-0.8.3 is not recommended for deployment - -- [ ] ID-93 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L4 - -- [ ] ID-94 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L28) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L28 - -- [ ] ID-95 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol#L4 - -- [ ] ID-96 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol#L4 - -- [ ] ID-97 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol#L4 - -- [ ] ID-98 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol#L4 - -- [ ] ID-99 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L4 - -- [ ] ID-100 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Structures.sol#L6) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Structures.sol#L6 - -- [ ] ID-101 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L2) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L2 - -- [ ] ID-102 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L5) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L5 - -- [ ] ID-103 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L2) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L2 - -- [ ] ID-104 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Strings.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Strings.sol#L4 - -- [ ] ID-105 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L4 - -- [ ] ID-106 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L4 - -- [ ] ID-107 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L4 - -- [ ] ID-108 Pragma - version[^0.8.1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L4 - -- [ ] ID-109 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol#L4 - -- [ ] ID-110 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#L4 - -- [ ] ID-111 Pragma - version[^0.8.1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L4 - -- [ ] ID-112 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC20Mock.sol#L2) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC20Mock.sol#L2 - -- [ ] ID-113 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Counters.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Counters.sol#L4 - -- [ ] ID-114 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L3) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L3 - -- [ ] ID-115 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L14) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L14 - -- [ ] ID-116 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L3) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L3 - -- [ ] ID-117 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/IERC1155.sol#L4 - -- [ ] ID-118 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L7) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L7 - -- [ ] ID-119 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Stateful.sol#L9) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Stateful.sol#L9 - -- [ ] ID-120 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L9) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L9 - -- [ ] ID-121 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L4 - -- [ ] ID-122 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L3) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L3 - -- [ ] ID-123 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L47) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L47 - -- [ ] ID-124 Pragma - version[^0.8.0](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Context.sol#L4) - allows old versions - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Context.sol#L4 - -## low-level-calls - -Impact: Informational Confidence: High - -- [ ] ID-125 Low level call in - [Address.functionDelegateCall(address,bytes,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L184-L193): - - [(success,returndata) = target.delegatecall(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L191) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L184-L193 - -- [ ] ID-126 Low level call in - [AddressUpgradeable.sendValue(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L60-L65): - - [(success) = recipient.call{value: amount}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L63) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L60-L65 - -- [ ] ID-127 Low level call in - [Shield.setAdvanceWithdrawalFee(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L225-L252): - - [(success) = address(address(state)).call{value: msg.value}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L249) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L225-L252 - -- [ ] ID-128 Low level call in - [Address.sendValue(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L60-L65): - - [(success) = recipient.call{value: amount}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L63) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L60-L65 - -- [ ] ID-129 Low level call in - [Address.functionCallWithValue(address,bytes,uint256,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L128-L139): - - [(success,returndata) = target.call{value: value}(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L137) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L128-L139 - -- [ ] ID-130 Low level call in - [Shield.requestBlockPayment(Structures.Block)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90): - - [(success) = address(address(state)).call{value: feePaymentsEth}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L77) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L49-L90 - -- [ ] ID-131 Low level call in - [Address.functionStaticCall(address,bytes,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L157-L166): - - [(success,returndata) = target.staticcall(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L164) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/utils/Address.sol#L157-L166 - -- [ ] ID-132 Low level call in - [AddressUpgradeable.functionCallWithValue(address,bytes,uint256,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L128-L139): - - [(success,returndata) = target.call{value: value}(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L137) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L128-L139 - -- [ ] ID-133 Low level call in - [Proposers.registerProposer(string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L38-L84): - - [(success) = address(address(state)).call{value: REGISTRATION_BOND}()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L45) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L38-L84 - -- [ ] ID-134 Low level call in - [SimpleMultiSig.execute(uint8[],bytes32[],bytes32[],address,uint256,bytes,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L117-L138): - - [(success,None) = destination.call{gas: gasLimit,value: value}(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L136) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L117-L138 - -- [ ] ID-135 Low level call in - [AddressUpgradeable.functionStaticCall(address,bytes,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L157-L166): - - [(success,returndata) = target.staticcall(data)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L164) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol#L157-L166 - -## missing-inheritance - -Impact: Informational Confidence: High - -- [ ] ID-136 - [Shield](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324) - should inherit from - [IERC721Receiver](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol#L11-L27) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324 - -## naming-convention - -Impact: Informational Confidence: High - -- [ ] ID-137 Contract - [MerkleTree_Stateless](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L16-L193) - is not in CapWords - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L16-L193 - -- [ ] ID-138 Parameter - [MerkleTree_Stateless.insertLeaves(bytes32[],bytes32[33],uint256).\_frontier](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L92) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L92 - -- [ ] ID-139 Function - [IERC20PermitUpgradeable.DOMAIN_SEPARATOR()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol#L59) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-IERC20PermitUpgradeable.sol#L59 - -- [ ] ID-140 Function - [MiMC.Encipher(uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21-L26) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21-L26 - -- [ ] ID-141 Parameter - [Poseidon.poseidon.asm_0.mix().\_t2_poseidon_asm_0_mix](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12 - -- [ ] ID-142 Parameter - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256).in_seed](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64 - -- [ ] ID-143 Variable - [Migrations.last_completed_migration](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L6) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L6 - -- [ ] ID-144 Parameter - [Verifier.verify(uint256[],uint256[],uint256[]).\_publicInputs](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L55) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L55 - -- [ ] ID-145 Parameter - [MiMC.mimcHash(bytes32[]).in_msgs](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L84) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L84 - -- [ ] ID-146 Parameter - [Verifier.verify(uint256[],uint256[],uint256[]).\_vk](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L56) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L56 - -- [ ] ID-147 Parameter - [State.initialize(address,address,address).\_shieldAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L44) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L44 - -- [ ] ID-148 Variable - [ContextUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L36) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L36 - -- [ ] ID-149 Function - [ReentrancyGuardUpgradeable.\_\_ReentrancyGuard_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L44-L46) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L44-L46 - -- [ ] ID-150 Parameter - [Key_Registry.registerVerificationKey(uint256[],Structures.TransactionTypes).\_txType](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L22) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L22 - -- [ ] ID-151 Function - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62 - -- [ ] ID-152 Function - [Pairing.scalar_mul(Pairing.G1Point,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L67-L80) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L67-L80 - -- [ ] ID-153 Parameter - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256).in_seed](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33 - -- [ ] ID-154 Parameter - [State.initialize(address,address,address).\_proposersAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L42) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L42 - -- [ ] ID-155 Parameter - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256).round_count](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33 - -- [ ] ID-156 Parameter - [MiMC.mimcHash2(bytes32[2]).in_msgs](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L93) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L93 - -- [ ] ID-157 Variable - [PausableUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116 - -- [ ] ID-158 Parameter - [MiMC.Encipher(uint256,uint256).in_x](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21 - -- [ ] ID-159 Contract - [Key_Registry](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L8-L32) - is not in CapWords - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L8-L32 - -- [ ] ID-160 Parameter - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256).in_k](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64 - -- [ ] ID-161 Parameter - [MiMC.Hash(uint256[],uint256).in_key](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77 - -- [ ] ID-162 Function - [ReentrancyGuardUpgradeable.\_\_ReentrancyGuard_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L40-L42) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L40-L42 - -- [ ] ID-163 Parameter - [MiMC.Encipher(uint256,uint256).in_k](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21 - -- [ ] ID-164 Variable - [SimpleMultiSig.DOMAIN_SEPARATOR](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L71) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/SimpleMultiSig.sol#L71 - -- [ ] ID-165 Function - [ContextUpgradeable.\_\_Context_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L21-L22) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L21-L22 - -- [ ] ID-166 Parameter - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256).round_count](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64 - -- [ ] ID-167 Variable - [Ownable.\_owner](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L20) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L20 - -- [ ] ID-168 Parameter - [State.initialize(address,address,address).\_challengesAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L43) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L43 - -- [ ] ID-169 Parameter - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256).in_x](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33 - -- [ ] ID-170 Variable - [ReentrancyGuardUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L74) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L74 - -- [ ] ID-171 Struct - [Verifier.Proof_G16](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L39-L43) - is not in CapWords - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L39-L43 - -- [ ] ID-172 Parameter - [Verifier.verify(uint256[],uint256[],uint256[]).\_proof](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L54) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L54 - -- [ ] ID-173 Function - [MiMC.GetScalarField()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19 - -- [ ] ID-174 Function - [Pairing.P2()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L33-L40) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L33-L40 - -- [ ] ID-175 Parameter - [Verifier.verificationCalculation(uint256[],uint256[],uint256[]).\_publicInputs](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L67) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L67 - -- [ ] ID-176 Constant - [MerkleTree_Stateless.treeWidth](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L50) - is not in UPPER_CASE_WITH_UNDERSCORES - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L50 - -- [ ] ID-177 Constant - [MerkleTree_Stateless.treeHeight](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L49) - is not in UPPER_CASE_WITH_UNDERSCORES - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L49 - -- [ ] ID-178 Parameter - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256).in_k](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33 - -- [ ] ID-179 Function - [Pairing.P1()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L29-L31) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pairing.sol#L29-L31 - -- [ ] ID-180 Parameter - [MerkleTree_Stateless.insertLeaves(bytes32[],bytes32[33],uint256).\_leafCount](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L93) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MerkleTree_Stateless.sol#L93 - -- [ ] ID-181 Function - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64-L75) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64-L75 - -- [ ] ID-182 Parameter - [Verifier.verificationCalculation(uint256[],uint256[],uint256[]).\_proof](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L66) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L66 - -- [ ] ID-183 Function - [MiMC.Hash(uint256[],uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77-L82) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77-L82 - -- [ ] ID-184 Parameter - [MiMC.Hash(uint256[],uint256).in_msgs](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77 - -- [ ] ID-185 Parameter - [Poseidon.poseidon.asm_0.mix().\_t0_poseidon_asm_0_mix](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12 - -- [ ] ID-186 Function - [PausableUpgradeable.\_\_Pausable_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L34-L36) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L34-L36 - -- [ ] ID-187 Parameter - [Config.setFeeL2TokenAddress(address).\_feeL2TokenAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L56) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L56 - -- [ ] ID-188 Function - [ContextUpgradeable.\_\_Context_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L18-L19) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L18-L19 - -- [ ] ID-189 Parameter - [Key_Registry.registerVerificationKey(uint256[],Structures.TransactionTypes).\_vk](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L21) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L21 - -- [ ] ID-190 Struct - [Verifier.Verification_Key_G16](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L45-L51) - is not in CapWords - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L45-L51 - -- [ ] ID-191 Parameter - [Poseidon.poseidon.asm_0.mix().\_t1_poseidon_asm_0_mix](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L12 - -- [ ] ID-192 Parameter - [Verifier.verificationCalculation(uint256[],uint256[],uint256[]).\_vk](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L68) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L68 - -- [ ] ID-193 Parameter - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256).in_x](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64 - -- [ ] ID-194 Function - [PausableUpgradeable.\_\_Pausable_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L38-L40) - is not in mixedCase - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L38-L40 - -## similar-names - -Impact: Informational Confidence: Medium - -- [ ] ID-195 Variable - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactionIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L92) - is too similar to - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactionIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L93) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L92 - -- [ ] ID-196 Variable - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).nullifierIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L207) - is too similar to - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).nullifierIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L212) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L207 - -- [ ] ID-197 Variable - [ChallengesUtil.libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool).nullifierIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L103) - is too similar to - [ChallengesUtil.libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool).nullifierIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L106) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L103 - -- [ ] ID-198 Variable - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactionIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L92) - is too similar to - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).transactionIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L211) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L92 - -- [ ] ID-199 Variable - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactions1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L90) - is too similar to - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactions2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L91) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L90 - -- [ ] ID-200 Variable - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).transactionIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L206) - is too similar to - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).transactionIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L211) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L206 - -- [ ] ID-201 Variable - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).isNullifierFee1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L208) - is too similar to - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).isNullifierFee2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L213) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L208 - -- [ ] ID-202 Variable - [Challenges.challengeNullifier(Structures.Block,Structures.Transaction[],uint256,uint256,bool,Structures.Block,Structures.Transaction[],uint256,uint256,bool,bytes32).transactionIndex1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L206) - is too similar to - [Challenges.challengeNoDuplicateTransaction(Structures.Block,Structures.Block,Structures.Transaction[],Structures.Transaction[],uint256,uint256,bytes32).transactionIndex2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L93) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L206 - -- [ ] ID-203 Variable - [ChallengesUtil.libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool).isNullifierFee1](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L104) - is too similar to - [ChallengesUtil.libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool).isNullifierFee2](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L107) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L104 - -## too-many-digits - -Impact: Informational Confidence: Medium - -- [ ] ID-204 - [Shield.payIn(Structures.Transaction)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L287-L323) - uses literals with too many digits: - - [require(bool,string)(addrNum < 0x010000000000000000000000000000000000000000,The given address is more than 160 bits)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L290-L293) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L287-L323 - -- [ ] ID-205 - [ERC1155Mock.constructor()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19) - uses literals with too many digits: - - [\_mint(msg.sender,GOLD,1100000,)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L14) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19 - -- [ ] ID-206 - [ChallengesUtil.slitherConstructorConstantVariables()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L9-L140) - uses literals with too many digits: - - [ZERO = 0x0000000000000000000000000000000000000000000000000000000000000000](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L10-L11) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L9-L140 - -- [ ] ID-207 - [Poseidon.poseidon(uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L9-L522) - uses literals with too many digits: - - [t0 = addmod(uint256,uint256,uint256)(t0,16930089744400890347392540468934821520000065594669279286854302439710657571308,q_poseidon_asm_0)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L408) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Poseidon.sol#L9-L522 - -- [ ] ID-208 - [Utils.compressG1(uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L34-L41) - uses literals with too many digits: - - [parity = 0x8000000000000000000000000000000000000000000000000000000000000000 \* (y % 2)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L36-L37) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L34-L41 - -- [ ] ID-209 - [ERC1155Mock.constructor()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19) - uses literals with too many digits: - - [\_mint(msg.sender,SILVER,1200000,)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L15) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19 - -- [ ] ID-210 - [ERC1155Mock.constructor()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19) - uses literals with too many digits: - - [\_mint(msg.sender,SHIELD,1100000,)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L18) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC1155Mock.sol#L13-L19 - -- [ ] ID-211 - [MiMC.GetScalarField()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19) - uses literals with too many digits: - - [0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L18) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L15-L19 - -- [ ] ID-212 - [MiMC.MiMCpe7(uint256,uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62) - uses literals with too many digits: - - [localQ_MiMCpe7_asm_0 = 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L44) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L33-L62 - -## unimplemented-functions - -Impact: Informational Confidence: High - -- [ ] ID-213 - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - does not implement functions: - - [ContextUpgradeable.\_\_Context_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L18-L19) - - [ContextUpgradeable.\_\_Context_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L21-L22) - - [PausableUpgradeable.\_\_Pausable_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L34-L36) - - [PausableUpgradeable.\_\_Pausable_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L38-L40) - - [ReentrancyGuardUpgradeable.\_\_ReentrancyGuard_init()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L40-L42) - - [ReentrancyGuardUpgradeable.\_\_ReentrancyGuard_init_unchained()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L44-L46) - - [Initializable.\_disableInitializers()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol#L131-L137) - - [ContextUpgradeable.\_msgData()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L27-L29) - - [ContextUpgradeable.\_msgSender()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol#L23-L25) - - [PausableUpgradeable.\_pause()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L94-L97) - - [PausableUpgradeable.\_requireNotPaused()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L76-L78) - - [PausableUpgradeable.\_requirePaused()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L83-L85) - - [PausableUpgradeable.\_unpause()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L106-L109) - - [State.addPendingWithdrawal(address,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L256-L263) - - [State.areBlockAndTransactionReal(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L327-L341) - - [State.areBlockAndTransactionsReal(Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L312-L325) - - [State.deleteProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L192-L194) - - [State.emitRollback(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L180-L182) - - [State.getAllBlockData()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L243-L245) - - [State.getBlockData(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L235-L237) - - [State.getBondAccount(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L347-L349) - - [Config.getBootChallenger()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L51-L53) - - [Config.getBootProposer()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L36-L38) - - [State.getCurrentProposer()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L200-L202) - - [State.getFeeBookInfo(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L204-L211) - - [State.getLatestBlockHash()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L251-L254) - - [Config.getFeeL2TokenAddress()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L60-L62) - - [State.getNumberOfL2Blocks()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L247-L249) - - [State.getProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L188-L190) - - [State.getProposerStartBlock()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L288-L290) - - [Config.getRestriction(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L66-L72) - - [Config.initialize()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L21-L23) - - [Pausable.initialize()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L10-L13) - - [State.isBlockStakeWithdrawn(bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L368-L370) - - [Ownable.owner()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L41-L43) - - [Pausable.pause()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L15-L17) - - [PausableUpgradeable.paused()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L69-L71) - - [State.popBlockData()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L228-L233) - - [State.pushBlockData(Structures.BlockData)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L224-L226) - - [State.removeProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L292-L303) - - [Config.removeRestriction(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L83-L86) - - [State.rewardChallenger(address,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L351-L360) - - [State.setBlockStakeWithdrawn(bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L372-L374) - - [State.setBondAccount(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L343-L345) - - [Config.setBootChallenger(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L46-L49) - - [Config.setBootProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L31-L34) - - [State.setCurrentProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L196-L198) - - [State.setFeeBookInfo(address,uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L213-L222) - - [Config.setFeeL2TokenAddress(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L56-L58) - - [Ownable.setOwner(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L48-L50) - - [State.setProposer(address,Structures.LinkedAddress)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L184-L186) - - [State.setProposerStartBlock(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L284-L286) - - [Config.setRestriction(address,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L74-L81) - - [Ownable.transferOwnership(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L56-L60) - - [Pausable.unpause()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Pausable.sol#L19-L21) - - [State.updateBondAccountTime(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L362-L366) - - [State.updateProposer(address,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L305-L307) - - [State.withdraw()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L265-L282) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375 - -- [ ] ID-214 - [MiMC](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L13-L101) - does not implement functions: - - [MiMC.Hash(uint256[],uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77-L82) - - [MiMC.MiMCpe7_mp(uint256[],uint256,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L64-L75) - - [MiMC.mimcHash(bytes32[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L84-L92) - - [MiMC.mimcHash2(bytes32[2])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L93-L100) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L13-L101 - -## unused-state - -Impact: Informational Confidence: High - -- [ ] ID-215 - [Utils.TRANSACTIONS_BATCH_SIZE](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L9) - is never used in - [Utils](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L7-L202) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L9 - -- [ ] ID-216 - [Config.ROTATE_PROPOSER_BLOCKS](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11) - is never used in - [Shield](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11 - -- [ ] ID-217 - [Config.REGISTRATION_BOND](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9 - -- [ ] ID-218 - [ReentrancyGuardUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L74) - is never used in - [Proposers](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L13-L122) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol#L74 - -- [ ] ID-219 - [Config.TXHASH_TREE_HEIGHT](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14 - -- [ ] ID-220 - [Config.REGISTRATION_BOND](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9) - is never used in - [Shield](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9 - -- [ ] ID-221 - [Config.ROTATE_PROPOSER_BLOCKS](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11 - -- [ ] ID-222 - [Config.COOLING_OFF_PERIOD](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L12) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L12 - -- [ ] ID-223 - [Config.ZERO](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13 - -- [ ] ID-224 - [Config.BLOCK_STAKE](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L10) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L10 - -- [ ] ID-225 - [Config.REGISTRATION_BOND](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9) - is never used in - [Challenges](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Challenges.sol#L17-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L9 - -- [ ] ID-226 - [PausableUpgradeable.\_paused](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L29) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L29 - -- [ ] ID-227 - [PausableUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116 - -- [ ] ID-228 - [Config.TXHASH_TREE_HEIGHT](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14) - is never used in - [Shield](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14 - -- [ ] ID-229 - [Config.feeL2TokenAddress](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L18) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L18 - -- [ ] ID-230 - [PausableUpgradeable.\_\_gap](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116) - is never used in - [Shield](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Shield.sol#L22-L324) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol#L116 - -- [ ] ID-231 - [Config.BLOCK_STAKE](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L10) - is never used in - [Proposers](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L13-L122) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L10 - -- [ ] ID-232 - [Config.ZERO](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13 - -- [ ] ID-233 - [Config.ROTATE_PROPOSER_BLOCKS](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L11 - -- [ ] ID-234 - [Config.erc20limit](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L19) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L19 - -- [ ] ID-235 - [Config.TXHASH_TREE_HEIGHT](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14) - is never used in - [Proposers](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L13-L122) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14 - -- [ ] ID-236 - [Config.COOLING_OFF_PERIOD](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L12) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L12 - -- [ ] ID-237 - [Config.TXHASH_TREE_HEIGHT](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14) - is never used in - [State](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L18-L375) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L14 - -- [ ] ID-238 - [Config.ZERO](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13) - is never used in - [Proposers](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Proposers.sol#L13-L122) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Config.sol#L13 - -## constable-states - -Impact: Optimization Confidence: High - -- [ ] ID-239 - [State.proposerStartBlock](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L29) - should be constant - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L29 - -## external-function - -Impact: Optimization Confidence: High - -- [ ] ID-240 rewardChallenger(address,address,uint256) should be declared external: - - [State.rewardChallenger(address,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L351-L360) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L351-L360 - -- [ ] ID-241 transferFrom(address,address,uint256) should be declared external: - - [ERC20.transferFrom(address,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L158-L167) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L158-L167 - -- [ ] ID-242 updateProposer(address,string) should be declared external: - - [State.updateProposer(address,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L305-L307) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L305-L307 - -- [ ] ID-243 libChallengeLeafCountCorrect(Structures.Block,Structures.Transaction[],uint256) should - be declared external: - - [ChallengesUtil.libChallengeLeafCountCorrect(Structures.Block,Structures.Transaction[],uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L17-L25) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L17-L25 - -- [ ] ID-244 emitRollback(uint256) should be declared external: - - [State.emitRollback(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L180-L182) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L180-L182 - -- [ ] ID-245 getNumberOfL2Blocks() should be declared external: - - [State.getNumberOfL2Blocks()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L247-L249) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L247-L249 - -- [ ] ID-246 symbol() should be declared external: - - [ERC721.symbol()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L86-L88) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L86-L88 - -- [ ] ID-247 uri(uint256) should be declared external: - - [ERC1155.uri(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L59-L61) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L59-L61 - -- [ ] ID-248 libCheckOverflows(Structures.Block,Structures.Transaction) should be declared - external: - - [ChallengesUtil.libCheckOverflows(Structures.Block,Structures.Transaction)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L87-L99) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L87-L99 - -- [ ] ID-249 getBondAccount(address) should be declared external: - - [State.getBondAccount(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L347-L349) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L347-L349 - -- [ ] ID-250 safeTransferFrom(address,address,uint256,uint256,bytes) should be declared external: - - [ERC1155.safeTransferFrom(address,address,uint256,uint256,bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L117-L129) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L117-L129 - -- [ ] ID-251 Encipher(uint256,uint256) should be declared external: - - [MiMC.Encipher(uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21-L26) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L21-L26 - -- [ ] ID-252 setProposer(address,Structures.LinkedAddress) should be declared external: - - [State.setProposer(address,Structures.LinkedAddress)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L184-L186) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L184-L186 - -- [ ] ID-253 safeBatchTransferFrom(address,address,uint256[],uint256[],bytes) should be declared - external: - - [ERC1155.safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L134-L146) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L134-L146 - -- [ ] ID-254 safeTransferFrom(address,address,uint256) should be declared external: - - [ERC721.safeTransferFrom(address,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L164-L170) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L164-L170 - -- [ ] ID-255 mimcHash(bytes32[]) should be declared external: - - [MiMC.mimcHash(bytes32[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L84-L92) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L84-L92 - -- [ ] ID-256 removeProposer(address) should be declared external: - - [State.removeProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L292-L303) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L292-L303 - -- [ ] ID-257 decreaseAllowance(address,uint256) should be declared external: - - [ERC20.decreaseAllowance(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L201-L210) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L201-L210 - -- [ ] ID-258 setBondAccount(address,uint256) should be declared external: - - [State.setBondAccount(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L343-L345) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L343-L345 - -- [ ] ID-259 deleteProposer(address) should be declared external: - - [State.deleteProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L192-L194) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L192-L194 - -- [ ] ID-260 symbol() should be declared external: - - [ERC20.symbol()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L70-L72) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L70-L72 - -- [ ] ID-261 getAllBlockData() should be declared external: - - [State.getAllBlockData()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L243-L245) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L243-L245 - -- [ ] ID-262 balanceOf(address) should be declared external: - - [ERC20.balanceOf(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L101-L103) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L101-L103 - -- [ ] ID-263 transfer(address,uint256) should be declared external: - - [ERC20.transfer(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L113-L117) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L113-L117 - -- [ ] ID-264 increaseAllowance(address,uint256) should be declared external: - - [ERC20.increaseAllowance(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L181-L185) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L181-L185 - -- [ ] ID-265 getProposerStartBlock() should be declared external: - - [State.getProposerStartBlock()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L288-L290) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L288-L290 - -- [ ] ID-266 getCurrentProposer() should be declared external: - - [State.getCurrentProposer()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L200-L202) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L200-L202 - -- [ ] ID-267 transferFrom(address,address,uint256) should be declared external: - - [ERC721.transferFrom(address,address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L150-L159) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L150-L159 - -- [ ] ID-268 setCompleted(uint256) should be declared external: - - [Migrations.setCompleted(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L16-L18) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Migrations.sol#L16-L18 - -- [ ] ID-269 approve(address,uint256) should be declared external: - - [ERC721.approve(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L112-L122) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L112-L122 - -- [ ] ID-270 getBlockData(uint256) should be declared external: - - [State.getBlockData(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L235-L237) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L235-L237 - -- [ ] ID-271 mimcHash2(bytes32[2]) should be declared external: - - [MiMC.mimcHash2(bytes32[2])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L93-L100) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L93-L100 - -- [ ] ID-272 verify(uint256[],uint256[],uint256[]) should be declared external: - - [Verifier.verify(uint256[],uint256[],uint256[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L53-L63) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Verifier.sol#L53-L63 - -- [ ] ID-273 setCurrentProposer(address) should be declared external: - - [State.setCurrentProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L196-L198) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L196-L198 - -- [ ] ID-274 transferOwnership(address) should be declared external: - - [Ownable.transferOwnership(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L56-L60) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Ownable.sol#L56-L60 - -- [ ] ID-275 decimals() should be declared external: - - [ERC20.decimals()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L87-L89) - - [ERC20Mock.decimals()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC20Mock.sol#L11-L13) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L87-L89 - -- [ ] ID-276 setBlockStakeWithdrawn(bytes32) should be declared external: - - [State.setBlockStakeWithdrawn(bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L372-L374) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L372-L374 - -- [ ] ID-277 addPendingWithdrawal(address,uint256,uint256) should be declared external: - - [State.addPendingWithdrawal(address,uint256,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L256-L263) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L256-L263 - -- [ ] ID-278 initialize(address,address,address) should be declared external: - - [State.initialize(address,address,address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L41-L50) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L41-L50 - -- [ ] ID-279 name() should be declared external: - - [ERC20.name()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L62-L64) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L62-L64 - -- [ ] ID-280 setProposerStartBlock(uint256) should be declared external: - - [State.setProposerStartBlock(uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L284-L286) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L284-L286 - -- [ ] ID-281 hashTransactionHashes(Structures.Transaction[]) should be declared external: - - [Utils.hashTransactionHashes(Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L19-L32) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Utils.sol#L19-L32 - -- [ ] ID-282 popBlockData() should be declared external: - - [State.popBlockData()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L228-L233) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L228-L233 - -- [ ] ID-283 name() should be declared external: - - [ERC721.name()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L79-L81) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L79-L81 - -- [ ] ID-284 balanceOfBatch(address[],uint256[]) should be declared external: - - [ERC1155.balanceOfBatch(address[],uint256[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L82-L98) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L82-L98 - -- [ ] ID-285 getFeeBookInfo(address,uint256) should be declared external: - - [State.getFeeBookInfo(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L204-L211) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L204-L211 - -- [ ] ID-286 pushBlockData(Structures.BlockData) should be declared external: - - [State.pushBlockData(Structures.BlockData)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L224-L226) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L224-L226 - -- [ ] ID-287 getLatestBlockHash() should be declared external: - - [State.getLatestBlockHash()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L251-L254) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L251-L254 - -- [ ] ID-288 awardItem(address,string) should be declared external: - - [ERC721Mock.awardItem(address,string)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L13-L24) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/mocks/ERC721Mock.sol#L13-L24 - -- [ ] ID-289 setApprovalForAll(address,bool) should be declared external: - - [ERC1155.setApprovalForAll(address,bool)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L103-L105) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC1155/ERC1155.sol#L103-L105 - -- [ ] ID-290 getProposer(address) should be declared external: - - [State.getProposer(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L188-L190) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L188-L190 - -- [ ] ID-291 isBlockStakeWithdrawn(bytes32) should be declared external: - - [State.isBlockStakeWithdrawn(bytes32)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L368-L370) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L368-L370 - -- [ ] ID-292 areBlockAndTransactionsReal(Structures.Block,Structures.Transaction[]) should be - declared external: - - [State.areBlockAndTransactionsReal(Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L312-L325) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L312-L325 - -- [ ] ID-293 getVerificationKey(Structures.TransactionTypes) should be declared external: - - [Key_Registry.getVerificationKey(Structures.TransactionTypes)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L29-L31) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/Key_Registry.sol#L29-L31 - -- [ ] ID-294 totalSupply() should be declared external: - - [ERC20.totalSupply()](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L94-L96) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L94-L96 - -- [ ] ID-295 approve(address,uint256) should be declared external: - - [ERC20.approve(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L136-L140) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol#L136-L140 - -- [ ] ID-296 balanceOf(address) should be declared external: - - [ERC721.balanceOf(address)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L62-L65) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L62-L65 - -- [ ] ID-297 areBlockAndTransactionReal(Structures.Block,Structures.Transaction,uint256,bytes32[6]) - should be declared external: - - [State.areBlockAndTransactionReal(Structures.Block,Structures.Transaction,uint256,bytes32[6])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L327-L341) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L327-L341 - -- [ ] ID-298 - libChallengeNewRootCorrect(Structures.Block,Structures.Transaction[],bytes32[33],Structures.Block,Structures.Transaction[]) - should be declared external: - - [ChallengesUtil.libChallengeNewRootCorrect(Structures.Block,Structures.Transaction[],bytes32[33],Structures.Block,Structures.Transaction[])](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L27-L52) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L27-L52 - -- [ ] ID-299 updateBondAccountTime(address,uint256) should be declared external: - - [State.updateBondAccountTime(address,uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L362-L366) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/State.sol#L362-L366 - -- [ ] ID-300 Hash(uint256[],uint256) should be declared external: - - [MiMC.Hash(uint256[],uint256)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77-L82) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/MiMC.sol#L77-L82 - -- [ ] ID-301 setApprovalForAll(address,bool) should be declared external: - - [ERC721.setApprovalForAll(address,bool)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L136-L138) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol#L136-L138 - -- [ ] ID-302 - libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool) - should be declared external: - - [ChallengesUtil.libChallengeNullifier(Structures.Transaction,uint256,bool,Structures.Transaction,uint256,bool)](https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L101-L139) - -https://github.com/EYBlockchain/nightfall_3/blob/master/nightfall-deployer/contracts/ChallengesUtil.sol#L101-L139 diff --git a/doc/deprecated/wallet-privacy.md b/doc/deprecated/wallet-privacy.md deleted file mode 100644 index a2c1445c2..000000000 --- a/doc/deprecated/wallet-privacy.md +++ /dev/null @@ -1,59 +0,0 @@ -# Maintaining Privacy with the Nightfall Wallet - -When used correctly, the Nightfall wallet can provide fully private transfers -of ERC20 tokens. However, correct use is important. This document describes how to -achieve that. - -Nightfall is tested on a Chrome browser. During Beta, mileage may vary on -other browsers. - -## Privacy of commitments - -Zero Knowledge proofs are computed in the browser, so that your secret keys remain with you, and the -wallet keeps track of any commitments that you own, in its IndexedDb. -Anyone with access to this data can find out which commitments you own, although -they can't steal them without your keys. Keys are only decrypted when you enter the -mnemonic. Thus you should only use the wallet on a machine which you trust. - -For now, this data is _not_ exported anywhere. Thus, if you use a browser on a different -machine, you will not have access to your commitments unless you transfer the IndexedDB -contents. We may change this in future, depending on Beta feedback. It's a security versus -convenience debate. - -## On-Chain privacy - -Recall that Nightfall has three parts to its token lifecycle: - -1. Deposit of conventional ERC20 tokens from Ethereum (Layer 1) into the Nightfall -Layer 2. -2. UTXO-like transfer within Layer 2, including possible receipt of change if the -transferred amount is less than the input amount. -3. Withdraw of tokens from Layer 2 to Layer 1. - -It's important to understand that Deposit and Withdraw transactions *are not private*. That is because -they interact with Layer 1 and Layer 1 is not private. This means that everyone knows if you -create a Layer 2 commitment and how much it contains. Likewise, if you return a token back -to Layer 1 by destroying a Layer 2 commitment, everyone knows who received it and how much. - -Privacy comes entirely from transfers within Layer 2. From the point of view of the -Ethereum blockchain, these are fully private. The only data leaked is your IP address when -you send a transfer transaction to a Block Proposer. - -Remember too that ZKP privacy solutions are, essentially, decentralised coin tumblers, and so privacy -comes from hiding in a crowd. - -From this discussion, we can infer some dos and don'ts: - -### Dos and don'ts - -- Don't deposit a very unique coin value (e.g. 3.1415 USDC) and then withdraw the same -amount. People will be able to guess who you probably sent it to. Likewise don't deposit and -withdraw exceptionally large values. -- Do withdraw different amounts from what you deposit. This makes it harder to guess who you paid. -- Do wait awhile. You should ensure that there are at least a few other transactions between the -deposit and withdraw. If there are no other transactions in the time you make a deposit and withdraw, -people may be able to guess that they are connected. -- Don't make regular or predictable transactions. For example, if a deposit from a particular Ethereum address is always -made at 12:01 on the first of the month and a withdraw is always made to a particular Ethereum -address at 12:05 on the second of the month people may guess that they are related; - you expose yourself to statistical analysis even if the amounts are uncorrelated. diff --git a/doc/in-band-secret-distribution.md b/doc/in-band-secret-distribution.md deleted file mode 100644 index 5330cd20c..000000000 --- a/doc/in-band-secret-distribution.md +++ /dev/null @@ -1,89 +0,0 @@ -# In Band Secret Distribution - -## Overview - -To ensure a recipient receives the secret information required to spend their commitment, the sender -encrypts the secrets (salt, value, tokenId, ercAddress) of the commitment sent to the recipient and -proves using zkp that they encrypted this correctly with the recipient's public key. We use the -KEM-DEM hybrid encryption paradigm. - -## KEM-DEM Hybrid Encryption - -### Key Creation - -Use Elliptic curve (here we use Baby Jubjub curve) `E` over a finite field `Fp` where `p` is a large -prime and `G` is the generator. - -Alice generates a random ephemeral asymmetric key-pair $(x_e, Q_e)$: -$$ x_e \; \leftarrow\; \{0, 1\}^{256} \qquad Q_e \coloneqq x_eG $$ - -These keys are only used once, and are unique to this transaction. - -### Encryption - -The encryption process involves 2 steps: a KEM step to derive a symmetric encryption key from a shared secret, and a DEM step to encrypt the plaintexts using the encryption key. - -### Key Encapsulation Method (Encryption) -Using the previously generated asymmetric private key, we obtain a shared secret, $key_{DH}$, using standard Diffie-Hellman. This is hashed alongside the ephemeral public key to obtain the encryption key. -$$ key_{DH} \coloneqq x_eQ_r \qquad key_{enc} \coloneqq H_{K}(key_{DH} \; + \;Q_e)$$ - -where -$Q_r$ is the recipient's public key -$H_{K}(x) \coloneqq \text{MIMC}(Domain_{K}, x)$ -$Domain_{K} \coloneqq \text{to\_field}(\text{SHA256}(\text{'nightfall-kem'}))$ - - -### Data Encapsulation Method (Encryption) -For circuit efficiency, the encryption used is a block cipher in counter mode where the cipher algorithm is a mimc hash. Given the ephemeral keys are unique to each transaction, there is no need for a nonce to be included. The encryption of the $i^{th}$ message is as follows: - -$$ c_i \coloneqq H_{D}(key_{enc} + i) + p_i$$ - -where -$H_{D}(x) \coloneqq \text{MIMC}(Domain_{D}, x)$ -$Domain_{D} \coloneqq \text{to\_field}(\text{SHA256}(\text{'nightfall-dem'}))$ - -The sender then provides the recipient with $(Q_e, \text{ciphertexts})$. These are included as part of the transaction struct sent on-chain. - -### Decryption -In order to decrypt, the recipient performs a slightly modified version of the KEM-DEM steps. -### Key Encapsulation Method (Decryption) -Given $Q_e$, the recipient is able to calculate the encryption key locally by performing the following steps. - -$$key_{DH} \coloneqq x_eQ_e \qquad key_{enc} \coloneqq H_{K}(key_{DH} \; + \;Q_e)$$ - -where -$Q_e$ is the ephemeral public key -$H_{K}(x) \coloneqq \text{MIMC}(Domain_{K}, x)$ -$Domain_{K} \coloneqq \text{to\_field}(\text{SHA256}(\text{'nightfall-kem'}))$ - -### Data Encapsulation Method (Decryption) -With $key_{enc}$ and an array of ciphertexts, the $i_{th}$ plaintext can be recovered with the following: - -$$p_i \coloneqq c_i - H_{D}(key_{enc} + i)$$ - -where -$H_{D}(x) \coloneqq \text{MIMC}(Domain_{D}, x)$ -$Domain_{D} \coloneqq \text{to\_field}(SHA256(\text{'nightfall-dem'}))$ - - -## Derivation and generation of the various keys involved in encryption, ownership of commitments and spending - -Using BIP39 generate a 12 word `mnemonic` and from this generate a `seed` by calling `mnemonicToSeedSync`. -Then following the standards of BIP32 and BIP44, generate a `rootKey` based on this `seed` and `path`. - -``` -zkpPrivateKey = mimc(rootKey, 2708019456231621178814538244712057499818649907582893776052749473028258908910) -where 2708019456231621178814538244712057499818649907582893776052749473028258908910 is keccak256(`zkpPrivateKey`) % BN128_GROUP_ORDER - -nullifierKey = mimc(rootKey, 7805187439118198468809896822299973897593108379494079213870562208229492109015n) -where 7805187439118198468809896822299973897593108379494079213870562208229492109015n is keccak256(`nullifierKey`) % BN128_GROUP_ORDER - -zkpPublicKey = zkpPrivateKey * G -``` - -The apps which will use the `ZkpKeys` to generate these keys can store the `rootKey` in different devices by splitting -this into shares using Shamir Secret Sharing. If either `rootKey` or `mnemonic` is compromised, then the adversary -can calculate the `zkpPrivateKey` and `nullifierKey`. The `zkpPrivateKey` can be used to decrypt secrets of a commitment -whilst the `nullifierKey` can be used to spend the commitment. Hence `rootKey` and `mnemonic` must be stored very securely. -It is also recommended to store `zkpPrivateKey` and `nullifierKey` separately to avoid theft of commitments in case one of these -is compromised. diff --git a/doc/nightfall_node.md b/doc/nightfall_node.md deleted file mode 100644 index 229361c53..000000000 --- a/doc/nightfall_node.md +++ /dev/null @@ -1,192 +0,0 @@ -# Running a Nightfall node - -This document describes how to deploy a Nightfall node to interact with a deployed nightfall instance. It's a simple deployment, designed to be run on your local machine and run up with docker-compose but it is straightforward to adapt it to a more production-grade environment; so long as you can run up containers and support volumes, you should be good. Generally nightfall containers can be restarted without issue and will sync themselves to the blockchain. Only your commitment database requires careful handling because, if its contents are lost, you will be unable to prove ownership of any tokens that you deposited into layer 2 (although you can protect against that by doing a transfer to yourself after a deposit to layer 2). - -Although it's a fairly generic document, it focuses on running a node on the Polygon Mumbai testnet. - -## Preliminaries - -[ ] Clone the [nightfall_3](https://github.com/EYBlockchain/nightfall_3) repository. - -### Blockchain node - -[ ] Ensure you can connect to a synchronised blockchain node, exposing a websocket or http port, connected to the chain onto which you wish to run your nightfall node. One way to do this, if you have Geth installed, is with `geth attach ://:`. This is required so that the Nightfall node can communicate with the blockchain. - -[ ] Check that the chain Id is correct. If you are attached with Geth you can do `net.version` it should be 80001 for Mumbai and 137 for Polygon PoS. - -## Configuration - -This configuration assumes that you will run a full Nightfall node with possibly an optional Proposer and a Challenger (see how_it_works.md in the nightfall `doc` folder if these terms are unfamiliar to you), so that you can create layer 2 blocks and also challenge incorrect blocks. The full node also contains a Nightfall Client so that you can create your own transactions. Provided there are enough independent Proposer and Challenger nodes, running their own Optimist nodes so that you aren't worried about possible censorship of your transactions, you only actually need to run a Client. For now, though, we'll create a full Nightfall node. - -### Generate a fresh key pair for the Nightfall node - -[ ] Nightfall is designed to be agnostic about how its transactions get signed. It simply returns a raw Ethereum transaction for signature and expects it to be signed and passed into the blockchain. This is so that security of the Ethereum private key can be managed according to local requirements (e.g. storage in an HSM). For test purposes however, Nightfall provides basic applications that can sign transactions and pass them into the blockchain (the Proposer, Challenger and User applications). These applications require access to an Ethereum private key so that they can sign transactions. This key will be exposed on the host and therefore should not be used for anything else, and should be generated specifically for this use. The easiest way to generate a private key and address is to use Metamask, generate a new account and export the private key. - -Note that to complete the tests, a second account is needed so you may wish to generate two private keys and fund the accounts with a small amount of matic. - -### Set Environment variables - -Note, there is a pre-populated script `bin/mumbai-node.env` for the Mumbai network to create all of the variables needed. This saves having to set them individually and is less error-prone: - -```sh -source bin/mumbai-node.env -``` - -`` is the `ETH_PRIVATE_KEY` value (and `USER1`, `PROPOSER` - see later). It's passed in as an argument for security reasons. `` is used for running tests (see later). The `blockchain node url` is exactly that e.g. `ws://1.2.3.4:8546`. - -If you are not using the `mumbai-node` script then export the following environment variables now: - -[ ] `USE_EXTERNAL_NODE=true` This will stop the containers waiting for a deployer to start. - -[ ] `ETH_PRIVATE_KEY` with the private key of the account which is to sign the Nightfall node's transactions. Do NOT place `0x` at the beginning of the key string. Do not use this account for anything else because this approach is not fully secure. - -[ ] `BLOCKCHAIN_URL` to equal the blockchain node RPC port that you are using (as above). - -[ ] `NF_SERVICES_TO_START='worker, client, optimist'`. - -[ ] `ENVIRONMENT`. The name that you are giving the deployment environment (as described in the ENVIRONMENTS object in `config/default.js`). For the Mumbai testnet, this variable should be set to `mumbai`. - -[ ] Ensure that the account has sufficient funds. For the testnet, the amount that a Proposer has to pay to register is set to 1 Wei, so that actual amount has to be enough to propose a reasonable number of blocks (~100kGas/block). 10 Matic/ETH should be plenty for the testnet. - -### Set config items - -If you are running in Mumbai, there is nothing to do in this section; it's all prepopulated for you in the config. - -[ ] The `ENVIRONMENTS` object needs to be set for your deployment. There should be an `ENVIRONMENTS` object that matches the name of the deployment `ENVIRONMENT` variable (e.g. 'mumbai'). Set the URLs so that the various Nightfall containers can find each other. If they are running on `localhost` then the values given in 'mumbai' can be used. You have the option either to edit an existing object or to add your own. - -## Create volumes for build and trusted setup artifacts - -The Nightfall node requires the ABIs and addresses of the smart contracts that are deployed (including Openzeppelin Upgrade data, although the deployments are fully decentralised, so upgradability is in fact disabled). It also requires the reference strings from the trusted setup. These are available as a set of folders in a tar [archive](https://github.com/EYBlockchain/nightfall-artifacts) for the Mumbai deployment. Others will be available soon. The following assumes you are using the Mumbai artifacts but it's straightforward to adapt it for other chains. - -[ ] Download the `mumbai.tar.gz` tar archive into the nightfall root directory and unpack it. - -```sh -tar xzvf mumbai.tar.gz -cd mumbai -ls -a -``` - -You should have three sub-directories: `build`, `proving_files` and `.openzeppelin` (you will need to do `ls -a` to see the latter). Make them into docker volumes, which the Nightfall node will read from: - -[ ] Remove any existing volumes - -```sh -docker volume rm nightfall_3_build -docker volume rm nightfall_3_proving_files -docker volume rm nightfall_3_.openzeppelin -``` - -If you get an error to the effect that there is no such volume, don't worry. It just means you had no pre-existing ones. - -[ ] create empty volumes - -```sh -docker volume create nightfall_3_build -docker volume create nightfall_3_proving_files -docker volume create nightfall_3_.openzeppelin -``` - -[ ] Copy the downloaded data into the volumes - -```sh -docker container create --name temp -v nightfall_3_build:/mnt busybox -docker cp mumbai/build/. temp:/mnt -docker rm temp -docker container create --name temp -v nightfall_3_proving_files:/mnt busybox -docker cp mumbai/proving_files/. temp:/mnt -docker rm temp -docker container create --name temp -v nightfall_3_.openzeppelin:/mnt busybox -docker cp mumbai/.openzeppelin/. temp:/mnt -docker rm temp -``` - -When the containers are started, they will mount these volumes and use the downloaded data to interact with the nighfall smart contracts and to compute zero knowledge proofs. - -## Run the deployment - -### Build the containers - -We include a build step so that we are not dependent on any local bind mount. This makes the deploy a little more reproducible. - -[ ] Run `bin/setup-nightfall` - -### Deploy the Nightfall node - -[ ] Run `bin/start-nightfall -n` *NB: do not use the `-g -d` arguments that you may be habituated with*. Doing so will remove the volumes that you have created. - -Note that when the containers start, they will begin to synchronise themselves with the Layer 2 on-chain data. This currently takes about 10 minutes but the time will increase as the size of the on-chain data grows. It's analogous to a conventional Blockchain node syncing. Once you see both Client and Optimist containers report that Queue 0 has been started, you are good to go. Do not attempt to make transactions while they are syncing as this is not a fully-tested situation. - -### Deploy basic Proposer and Challenger applications (optional - not needed to run tests) - -These can be run from another terminal window because the terminal used to deploy the Nightfall node is used for log output. They are not part of the nightfall node and you may well be using your own versions, in which case they are not required. Note that the tests provide their own applications and thus you do not need to deploy these to run tests. There is no short-cut script for these environment variables, enter them manually or make your own script. - -[ ] Set the `ENVIRONMENT` environment variable as above (and to the same value) -[ ] Set the `PROPOSER_KEY` and `CHALLENGER_KEY` environment variables separately if you want to use different accounts from `ETH_PRIVATE_KEY`, otherwise just set them to the same value as `ETH_PRIVATE_KEY` (the value can be different from the one used for deployment), and that will be used by the Proposer and Challenger applications by default. - -[ ] Set the `BLOCKCHAIN_URL` environment variable as above (and to the same value). - -[ ] Run `bin/start-apps`. - -You now have a complete nightfall node running. The `Nf3` class is the simplest way to interact with it from a user application. - -## Test the deployment (Mumbai only) - -We will test the deployment using the erc20 and x509 tests, as these tests have been adapted to run on Mumbai as well as locally. The test does not require a Proposer and Challenger to run because the test scripts create their own, where needed. It does require working Optimist and Client containers though, so get them running, if you haven't already, and keep the logging window open. Note also that some tests require the blockchain to time-shift over the challenge period. Obviously this only works with a blockchain simulator, so these tests are automatically skipped. - -### x509 - -The first thing we need to do is to whitelist our account by providing the correct x509 certificate to the x509 smart contract. The easiest way to do this is to run the x509 test. You are probably using a different terminal so first re-export the environment variables that you need: - -```sh -source mumbai-node.env -``` - -Relevant at this stage is that the script has also set private keys for the test actors: `USER1_KEY`, `USER2_KEY` and `PROPOSER_KEY`; the `ETH_NETWORK` so that it can find contract addresses; and also the currency that we will deal in `ERC20_COIN=WMATIC`. Note that this coin must have been made available during deployment. You are not free to use just any coin. The list of acceptable coins is in the `RESTRICTIONS` section of `config/default.js` under `mumbai:`. The USER1_KEY and the USER2_KEY are set to the values provided as arguments `` and ``. - -Then we can run the x509 test: - -```sh -npm run test-x509 -``` - -Note that this test can be very slow to finish (~5 minutes). Don't assume it's hung. Please be patient. Improvements are being worked on. - -### ERC20 - -Complete the previous test first, to activate whitelisting. - -The erc20 test has four actors: - -1. User 1 -2. User 2 -3. Proposer -4. Sanctioned User - -The only new actor here is the Sanctioned User. This user is on the sanctioned list for the mock Chainalysis sanctions list contract that will have been deployed to Mumbai as part of the deployment (Mumbai does not have a real version of the contract). We do not use this test however because that would require setting up a sanctioned user address to match that in the deployed contract. To skip it, we clear the `DEPLOY_MOCKED_SANCTIONS_CONTRACT` environment variable. - -Note that you do need to set Ethereum private keys for the Proposer and users though. You can reuse the User 1 key for the Proposer but User 1 and User 2 need different keys. Unless you are using the `mumbai-node.env` script above, which will already have set these keys, you should export these environment variables now: - -```sh -export USER1_KEY= -export PROPOSER_KEY=$USER1_KEY -export USER2_KEY= -``` - -Again, if not using `mumbai-node.env` you should tell the test which currency to use: - -```sh -export ERC20_COIN=WMATIC -export FEE_L2_TOKEN_ID=WMATIC -``` - -[ ] The test can then be run against the deployed contracts: - -```sh -npm run test-erc20-tokens -``` - -Note that these tests are very much integration tests and are stateful. They depend on a correct test sequence (you can't transfer a commitment that you haven't yet deposited). - -If your tests begin to fail, the most likely cause is that your Client and/or Optimist has dropped out of sync with the blockchain. This can happen if the tests terminate unexpectedly or are stopped during execution. Restarting the Optimist and Client containers will let them re-sync using on-chain data, which is, by definition, the true state of the system. - -The tests currently make the assumption that there is no other proposer running. If this is not the case it's possible that another proposer may post the test transactions. The tests listens for a block to be proposed before continuing and if another proposer does post the transactions before the test starts listening for the block proposal, there could be a race-condition failure. This is not known to be an issue but it is something to watch for. diff --git a/doc/pos.md b/doc/pos.md deleted file mode 100644 index a4d35c95a..000000000 --- a/doc/pos.md +++ /dev/null @@ -1,131 +0,0 @@ -## Nightfall PoS - -Using a similar approach to Polygon proposer selection protocol, with proposer set based on staking, -and Tendermint's proposer selection algorithm, Nightfall will select next proposer. - -Terminology: - -- **Slots**. Units assigned to proposers based on their stake. A proposer should have at least to - register the minimum stake and every time a proposer propose a block this stake is reduced by the - block stake. This block reduced it's blocked until the challenge period is over. The minimum stake - and block stake are configurable through the variables `minimumStake` and `blockStake` in the - Config contract. -- **Value per slot**. Amount of the stake for each slot to calculate the slots that a proposer will - have based on their stake. If a proposer has 10K staked and the value per slot is 1K then the - proposer will have 10 slots to calculate their stake power in the weighted round robin algorithm. - This parameter is calculated dynamically based on the proposer with the higher stake. -- **Sprint**. The time a proposer is proposing blocks being the current proposer. It will be the - equivalent as ROTATE_PROPOSER_BLOCKS (L1 blocks). The rotate proposer blocks is configurable - through the variable `rotateProposerBlocks` in the Config contract. -- **Span**. Unit composed of various sprints in which we use the same proposer set for the Weighted - Round Robin algorithm to select next current proposer. The number of sprints in a span is - configurable through the variable `sprintsInSpan` in the Config contract. -- **Proposer set**. Proposers with calculated weights that will be proposers during the sprints of - next span. -- **Proposer set count**. After shuffling the slots, we take this number of slots to build the - proposer set. The proposer set count is configurable through the variable `proposerSetCount` in - the Config contract. - -We need a shuffling the slots at the begining of each span in order to introduce some randomness in -the proposer selection process. - -Similar to Polygon approach we define these initial numbers that could be configured by the multisig -administrator contract: - -- Minimum stake will be 20K MATIC. -- Block stake every time the proposer propose a block will be 200 MATIC. -- Each proposer slot will be the calculated from the biggest stake divided by 10 in order to have 10 - slots maximum for the proposer with the biggest stake. **1 Slot = MaxProsposerStake / 10 MATIC** -- Proposer set for each span will be built from 10 slots after shuffling all the slots. (Random - shuffling is employed by Ethereum 2.0 too. It helps to mitigate DoS attacks and collusion among - nodes) **Proposer set = 10 slots** -- Span will have 10 sprints for a complete rotation of the proposer set. The same number as proposer - set count. **Span = 10 Sprints** -- Sprint will be equal to ROTATE_PROPOSER_BLOCKS = 32. Probably we could increase this in mainnet. - **Sprint = 32 Blocks**. -- We will take into account to block the stake of the proposer for the blocks that are still pending - in the CHALLENGE_PERIOD of the proposer so it could be slashed in case of bad blocks to cover this - slash. And in the next span this proposer will have less staking power. (total stake - blocked - stake). Once the CHALLENGE_PERIOD of the block proposed is over then this stake will be restored - to the proposer. More less in the same way as now but in this case the payment is based on the - proposer stake instead of paying in every transaction of the block proposed directly. -- If changes are made to the staking of the proposers, we will take this into account in next span - and not in the current span. - -#### Example - -- Let's suppose we have 3 proposers, and they are Alice, Bill and Clara. -- Alice staked 5K Matic tokens whereas Bill and Clara staked 2K Matic tokens. -- We define 1K Matic per slot to define the staking power. -- All the proposers are given these slots [ A, A, A, A, A, B, B, C, C ] -- Using historical Ethereum block data as seed, we shuffle this array. -- After shuffling the slots using the seed, say we get this array [ A, B, A, A, C, B, A, A, C] -- Now we pop 5 proposers slots from the top defined by proposer set as [ A, B, A, A, C] -- Hence the proposer set is defined as [ A: 3, B:1, C:1 ]. -- Using this proposer set and tendermint's proposer selection algorithm based on the Weighted Round - Robin we choose a proposer for every sprint (5 sprints for 1 span defined). In every sprint the - current proposer is proposing blocks during ROTATE_PROPOSER_BLOCKS. - -A model that gives a good intuition on how / why the selection algorithm works and it is fair is -that of a priority queue. The proposers move ahead in this queue according to their voting power -(the higher the voting power the faster a proposer moves towards the head of the queue). When the -algorithm runs the following happens: - -- All proposers move "ahead" according to their powers: for each proposer, increase the priority by - the voting power -- First in the queue becomes the proposer: select the proposer with highest priority -- Move the proposer back in the queue: decrease the proposer's priority by the total voting power - -## How the economics work - -The proposal of the different actors profitability and fees are explained below. - -### The Proposer - -- Proposer profitability: Fees collected from transfers in L2 block. - $$ - ProposerProfit = Fee_{tx}·txPerBlock-blockPropose_{gasCost}·gasPrice - $$ - $$ - RoCE_{perBlock}=\frac{ProposerProfit}{(blockPropose_{gasCost}·gasPrice)+blockStake} - $$ -- Proposers should need a stake to guarantee possible block challenges or idle situation while they - are proposing blocks. - $$ - {StakeNeeded} = {idleProposerStake}+\,(blocksCp·blockStake) - $$ - Where _StakeNeeded_ is the stake needed to cover all these possible penalizations, - _idleProposerStake_ is the equivalent to the current minimum stake when register, _blocksCp_ are - the blocks in the CHALLENGE*PERIOD still pending for this proposer and \_blockStake* is the - BLOCK_STAKE that now proposers are submitting in every block proposal. So the stake the proposer - has in the State contract is used for the weighted round robin algorithm to select next proposer - and if you have more amount staked you have higher probability to be elegible as next proposer, - but also you have to guarantee that you have a minimum amount staked to propose new blocks if they - are still in the CHALLENGE_PERIOD and are suitable for a challenge. We will manage this blocked - stake to cover possible challenges. -- The proposer will be incentivated to stake more amount of MATIC as it will increase the - probability to propose blocks in a Weighted Round Robin algorithm. - -### The Challenger - -- Challengers profitability. - $$ - ChallengerProfit_{challengeSuccess} = blockStake-(challenge_{gasCost}·gasPrice) - $$ - $$ - RoCE_{perChallengeSuccess} = \frac{ChallengerProfit_{challengeSuccess}}{challenge_{gasCost}·gasPrice} - $$ - $$ - blockStake >> (challenge_{gasCost}·gasPrice) - $$ - This $blockStake$ will be slashed from the stake of the proposer in case of successful challenge. - So the proposer will lose this amount of the staking and also will lose power in the weighted - round robin algorithm for next span as it would be calculated with the adjustment of the new stake - amount that is less than before. If now is the current proposer he will lose also the turn because - it will be removed from the proposer set. -- This _blockStake_ should be enough to be interesting for the challenger to create challenges. - -## References - -- https://wiki.polygon.technology/docs/maintain/validator/core-components/proposers-producers-selection -- https://docs.tendermint.com/master/spec/consensus/proposer-selection.html