Commit c1268e23 authored by norswap's avatar norswap Committed by GitHub

Merge branch 'master' into ns/replaced-transfer-with-call

parents 50db0484 50997ddc
......@@ -3,6 +3,13 @@
<!--![cannon](https://static.wikia.nocookie.net/ageofempires/images/8/80/Bombard_cannon_aoe2DE.png/revision/latest/top-crop/width/360/height/360?cb=20200331021834)-->
![cannon](https://paradacreativa.es/wp-content/uploads/2021/05/Canon-orbital-GTA-01.jpg)
---
**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.
......
......@@ -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
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment