near / rainbow-bridge-sol

10 stars 8 forks source link

Address solidity contract audit issues #12

Open ailisp opened 4 years ago

ailisp commented 4 years ago

2. ProofDecoder.sol (6993b73)

In this section we describe issues related to the smart contract defined in the ProofDecoder.sol ​.

2.1 Moderate Flaws

This section lists moderate flaws, which were found in the smart contract.

Bo: This is impossible, given:

        outcome.merkelization_hashes = new bytes32[](1 + outcome.logs.length);

And logs.length is not possible to exceed 2^32-1 in nearcore given the gas limit, am i correct? @nearmax @bowenwang1996

2.2 Suboptimal Code

This section lists suboptimal code patterns, which were found in the smart contract.

3. NearProver.sol (3563521)

In this section we describe issues related to the smart contract defined in the NearProver.sol​.

3.1 Suboptimal Code

This section lists suboptimal code patterns, which were found in the smart contract.

4.1 Suboptimal Code

This section lists suboptimal code patterns, which were found in te smart contract.

6. Borsh.sol (6993b73)

In this section we describe issues related to the smart contract defined in the Borsh.sol ​.

6.1 Critical Flaws

This section lists critical flaws, which were found in the smart contract.

7. NearBridge.sol (4031aa8)

In this section we describe issues related to the smart contract defined in the NearBridge.sol​.

7.1 Moderate Flaws

This section lists moderate flaws, which were found in the smart contract.

7.4 Suboptimal Code

This section lists suboptimal code patterns, which were found in the smart contract.

7.5 Unclear Behaviour

This section lists issues of the smart contract, where the contract behavior is unclear: the business logic might be violated here, but the documentation and functional requirements are not sufficiently documented to make a clear decision.

8. INearBridge.sol (1b1f5fd)

In this section we describe issues related to the smart contract defined in the INearBridge.sol (1b1f5fd).

8.1 Documentation Issues

This section lists documentation issues, which were found in the smart contract

Summary

Based on our findings, we also recommend the following:

MaksymZavershynskyi commented 4 years ago

I am going to close this issue to not confuse people. @ailisp , @Kouprin let's go over the audits and create issues for each of the findings that were not addressed yet. @ailisp , thank you for drafting the document!

ailisp commented 4 years ago

@Kouprin I found i only created issues for the concensys report, the solidity report and today's fuzz test report is missing, I think they maybe more suitable to create as one big issue than a few smaller issues.

MaksymZavershynskyi commented 4 years ago

@ailisp Thank you for converting this into a checkpoint list.

Kouprin commented 4 years ago

According @nearmax idea about having the only assigned person, I withdraw my assignment.

MaksymZavershynskyi commented 4 years ago

Might require quite some time to address and test all of them. Setting estimate to 3.

MaksymZavershynskyi commented 4 years ago

For the record, as discussed @ailisp will address Major and Critical flaws (except ED25519) and @abacabadabacaba will take over the rest.