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
4e9f4728
Commit
4e9f4728
authored
Mar 08, 2022
by
Mark Tyneway
Committed by
norswap
Mar 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contracts: remove hardhat/console
parent
a22c36eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
11 deletions
+2
-11
Challenge.sol
contracts/Challenge.sol
+2
-7
Lib_MerkleTrie.sol
contracts/lib/Lib_MerkleTrie.sol
+0
-4
No files found.
contracts/Challenge.sol
View file @
4e9f4728
...
...
@@ -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);
...
...
@@ -65,7 +64,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;
...
...
@@ -209,13 +208,11 @@ 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!!
c.challenger.transfer(address(this).balance);
emit ChallengerWins(challengeId);
}
...
...
@@ -233,8 +230,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 @
4e9f4728
...
...
@@ -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