Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
c1268e23
Unverified
Commit
c1268e23
authored
Mar 10, 2022
by
norswap
Committed by
GitHub
Mar 10, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into ns/replaced-transfer-with-call
parents
50db0484
50997ddc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
README.md
README.md
+7
-0
Challenge.sol
contracts/Challenge.sol
+1
-6
Lib_MerkleTrie.sol
contracts/lib/Lib_MerkleTrie.sol
+0
-4
No files found.
README.md
View file @
c1268e23
...
...
@@ -3,6 +3,13 @@
<!---->

---
**
NEW: Cannon is currently the object of
[
a bug bounty on Immunefi
](
https://immunefi.com/bounty/optimismcannon/
)
. Find vulnerabilities
in Cannon for up to a $50.000 payout.
**
---
The cannon (cannon cannon cannon) is an on chain interactive dispute engine implementing EVM-equivalent fault proofs.
It's half geth, half MIPS, and whole awesome.
...
...
contracts/Challenge.sol
View file @
c1268e23
...
...
@@ -3,7 +3,6 @@ pragma solidity ^0.7.3;
pragma experimental ABIEncoderV2;
import "./lib/Lib_RLPReader.sol";
import "hardhat/console.sol";
interface IMIPS {
function Step(bytes32 stateHash) external returns (bytes32);
...
...
@@ -66,7 +65,7 @@ contract Challenge {
// the challenger arrives
c.challenger = msg.sender;
// the state is set
// the state is set
c.blockNumberN = blockNumberN;
// NOTE: if they disagree on the start, 0->1 will fail
c.assertedState[0] = startState;
...
...
@@ -210,8 +209,6 @@ contract Challenge {
require(!isSearching(challengeId), "binary search not finished");
bytes32 stepState = mips.Step(c.assertedState[c.L]);
console.logBytes32(stepState);
console.logBytes32(c.assertedState[c.R]);
require(stepState == c.assertedState[c.R], "wrong asserted state for challenger");
// pay out bounty!!
...
...
@@ -235,8 +232,6 @@ contract Challenge {
return;
}
console.logBytes32(stepState);
console.logBytes32(c.defendedState[c.R]);
require(stepState == c.defendedState[c.R], "wrong asserted state for defender");
// consider the challenger mocked
...
...
contracts/lib/Lib_MerkleTrie.sol
View file @
c1268e23
...
...
@@ -6,8 +6,6 @@ import { Lib_BytesUtils } from "./Lib_BytesUtils.sol";
import { Lib_RLPReader } from "./Lib_RLPReader.sol";
import { Lib_RLPWriter } from "./Lib_RLPWriter.sol";
import "hardhat/console.sol";
/**
* @title Lib_MerkleTrie
*/
...
...
@@ -682,12 +680,10 @@ library Lib_MerkleTrie {
bytes memory _hash
)
{
//console.logBytes(_encoded);
if (_encoded.length < 32) {
return _encoded;
} else {
bytes32 encodedHash = keccak256(_encoded);
//console.logBytes32(encodedHash);
GetTrie()[encodedHash] = _encoded;
return abi.encodePacked(encodedHash);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment